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

Object.isExtensible (and likely others) return incorrect result for functions #418

Closed
whyisthisfieldhere opened this issue May 12, 2016 · 2 comments

Comments

@whyisthisfieldhere
Copy link

whyisthisfieldhere commented May 12, 2016

According to both (my understanding of) the ES6 spec and firefox, Object.isExtensible should return true for functions (as they are considered object types)
However, es6-shim's Object.isExtensible returns false for functions because it uses Type.object instead of !Type.primitive for checking the argument.
As a practical example, this bug breaks Benvie's WeakMap shim when applied to functions.

I've just checked and the other usages of Type.object (seal, isSealed, freeze, isFrozed,preventExtensions) have the same issue according to MUO of the spec.

(Sidenote - why not add something like Benvie's WeakMap shim as a shim or sham? it seems well good enough)

@ljharb
Copy link
Collaborator

ljharb commented May 12, 2016

Thanks! Let me fix that right now.

@ljharb
Copy link
Collaborator

ljharb commented May 12, 2016

Released as v0.35.1.

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

No branches or pull requests

2 participants