-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Functions returned by Function.prototype.bind() have non-configurable lengths #4122
Comments
There's a whole lot of special casing in BoundFunction.cpp for not allowing things to happen to the length property (its hard-coded to be non-configurable, non-enumerable, non-writable, and non-delete-able). |
Removing Intl-ICU tag since this applies to non-ICU Intl as well. |
Possibly related: #3606. |
well #3606 didn't address the boundfunction scenario. But it can easily be done by returning true in the IsConfigurable function. |
Removing that if block definitely resolves the test262 failures, but I didn't test how that impacted actually trying to configure it. There's enough special casing about the length property in BoundFunction.cpp that I would imagine it would still fail in relatively interesting ways. |
even though the length is marked as configurable, we actually don't honor it's configurability. function foo() { }
delete foo.length;
print(foo.hasOwnProperty("length")); this should yield |
Taking a look at this, there seem to be several related problems:
These errors appear to relate to the mechanism for handling length:
I'll look at fixing this by making length into a normal property and getting rid of the trap(s). |
…ndFunction.length Merge pull request #5405 from rhuanjl:boundFunction Fix: #4122 This PR addresses several issues with the length property of JavascriptFunctions and BoundFunctions. Length should be configurable (previously worked for JavascriptFunctions but not BoundFunctions) Deleting length should succeed (previously failed for both) Deleting length should not throw in strict mode (previously failed for both) value after deletion = 0 (previously failed for both) using defineProperty to redefine length should work (previously failed silently for both)
Example:
This is blocking tests 10.3.2_1_a_L15.js, 12.3.2_1_a_L15, 11.3.2_1_a_L15, 10.2.2_L15.js, 12.2.2_L15.js, and 11.2.2_L15.js in test262/test/intl402
/cc @bterlson
The text was updated successfully, but these errors were encountered: