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

Comments

Projects
None yet
3 participants
@allenwb
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.

ljharb added a commit to ljharb/ecma262 that referenced this issue Mar 21, 2018

Editorial: remove unnecessary AddRestrictedFunctionProperties
 - also de-nests `%ThrowTypeError%`

Fixes tc39#877. Relates to tc39#867.
@claudepache

This comment has been minimized.

Show comment
Hide comment
@claudepache

claudepache Apr 4, 2018

Contributor

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

Contributor

claudepache commented Apr 4, 2018

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

@littledan

This comment has been minimized.

Show comment
Hide comment
@littledan

littledan Apr 5, 2018

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.

Member

littledan commented Apr 5, 2018

@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

This comment has been minimized.

Show comment
Hide comment
@claudepache

claudepache Apr 5, 2018

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.

Contributor

claudepache commented Apr 5, 2018

@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

This comment has been minimized.

Show comment
Hide comment
@littledan

littledan Apr 12, 2018

Member

@claudepache What do you think of this patch?

Member

littledan commented Apr 12, 2018

@claudepache What do you think of this patch?

@claudepache

This comment has been minimized.

Show comment
Hide comment
@claudepache

claudepache Apr 13, 2018

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.

Contributor

claudepache commented Apr 13, 2018

@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.

ljharb added a commit to ljharb/ecma262 that referenced this issue Apr 17, 2018

Editorial: remove unnecessary AddRestrictedFunctionProperties
 - also de-nests `%ThrowTypeError%`

Fixes tc39#877. Relates to tc39#867.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment