... because I doubt that any browser vendor would kill them.
I have written a strawman here: https://github.com/claudepache/es-legacy-function-reflection
Some notes:
Function#caller and Function#arguments are specced as configurable getters on Function.prototype rather than properties of individual functions, following Firefox's example.
- Moreover, a basic realm check is performed (step 3 of GetTopMostExecutionContextIfLeakable), so that after those properties are deleted, they cannot be recovered from another realm.
- As
arguments.caller is not supported by any browser, I think that step 9 of CreateUnmappedArgumentsObject can be removed.
arguments.callee is currently specced in ECMA262 as unavailable for sloppy-mode functions with nonsimple parameter list. Question: Should Function#arguments and Function#caller be disabled for those functions as well?
... because I doubt that any browser vendor would kill them.
I have written a strawman here: https://github.com/claudepache/es-legacy-function-reflection
Some notes:
Function#callerandFunction#argumentsare specced as configurable getters onFunction.prototyperather than properties of individual functions, following Firefox's example.arguments.calleris not supported by any browser, I think that step 9 of CreateUnmappedArgumentsObject can be removed.arguments.calleeis currently specced in ECMA262 as unavailable for sloppy-mode functions with nonsimple parameter list. Question: ShouldFunction#argumentsandFunction#callerbe disabled for those functions as well?