Skip to content
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

Remove the AddRestrictedFunctionProperties abstract operation #877

Open
allenwb opened this issue Apr 7, 2017 · 5 comments
Open

Remove the AddRestrictedFunctionProperties abstract operation #877

allenwb opened this issue Apr 7, 2017 · 5 comments

Comments

@allenwb
Copy link
Member

allenwb commented Apr 7, 2017

In ES6 we intended to eliminate the poison-pill string function properties caller and arguments but a few vestiges remain and should be eliminated.

#867 identifies that the reference to AddRestrictedFunctionProperties (which adds the poison-pill properties to a function) in https://tc39.github.io/ecma262/#sec-forbidden-extensions is unnecessary and should be eliminated.

The only remaining use of AddRestrictedFunctionProperties is in CreateIntrinsics. That use is also unnecessary because of the definition of built-in function and the forbidden extension restrictions. Step 12 of that abstract operation should be deleted.

With those changes, there will not longer be any references to AddRestrictedFunctionProperties so its definition should also be removed from the specification.

@claudepache
Copy link
Contributor

For reference, an alternative (or complementary) proposal is #562, which attempts to reflect what FireFox does.

@littledan
Copy link
Member

@allenwb I'm confused by this change. I thought we were removing the poison pill from arguments, but leaving it on Function.prototype so that strict mode functions will throw when they are accessed. It looks like this issue would remove that poison, though.

@claudepache
Copy link
Contributor

@littledan I thought we were removing the poison pill from arguments

Unless I’ve missed something, poison pill is not being removed from arguments (arguments.callee still throws in strict mode). We have removed the specific case arguments.caller because it was dead also in sloppy mode.

@littledan
Copy link
Member

@claudepache What do you think of this patch?

@claudepache
Copy link
Contributor

@claudepache What do you think of this patch?

Frankly, I don’t care. The best implementation of the wart (after nuking it), namely a deletable accessor property on a single object, Function.prototype, as implemented by FF, isn’t compliant to the spec, with or without this patch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants