-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test which restrictions are currently implemented in browsers #1
Comments
Preliminary tests on Firefox, Chrome, Safari and Edge:
Note: When testing Safari, we should be aware that, because of PTC, the caller may not be the one that you think: function getCaller() { return getCaller.caller }
;(function() { "use strict"; var r = getCaller(); return r })()
// TypeError: Function.caller used to retrieve strict caller
;(function() { "use strict"; return getCaller() })()
// PTC applies; no error (unless executed from within a strict-mode environment, of course) |
So, roughly, for case 1, we can distinguish two classes of functions:
Edge treats methods and getters in object literals as “ES3 functions”, other engines as “other functions”. And for case 2, we can distinguish three or four classes of functions:
|
Current implementations may or may not add restrictions on the following kinds of (mostly post-ES3) function:
Moreover, there are two kinds of restriction that may apply:
caller
or thearguments
property on such a function object:caller
property is about to return such a function object:The text was updated successfully, but these errors were encountered: