-
Notifications
You must be signed in to change notification settings - Fork 858
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
Cannot modify length property of TypedArray #1572
Comments
Do you know if this is just a misconfigured propertyDescriptor, or is there more to it? |
I'm not sure I get what this case is about. Unless I'm reading things wrong, the length property of a TypedArray is to be an accessor property without a The above referenced spec doesn't say anything more about the setup of the property, meaning https://tc39.es/ecma262/multipage/ecmascript-data-types-and-values.html#sec-property-attributes kicks in, which says that unless specified the defaults kick in and So that leads me to conclude that it shouldn't be possible to redefine the length property Or am I missing something? |
I haven't checked the spec, but there's a lot of test262 cases that fail because of this issue. They are those named Object.defineProperty(TypedArray.prototype, "length", {value: 0}); or Object.defineProperty(TypedArray.prototype, "length", desc); |
Had a look at Once the test would be able to get passed that hurdle, I'm not sure what would happen: the test tries to reconfigure the length property to see whether the internal code never looks at the length property(as per the spec it should look at the [ArrayLength] internal slot). While I think our impl. does that, the test may or may not bomb out because Rhino seems to have some flaws in redefining properties. Long story short I don't think we need this case:
Agree? |
This is not allowed by rhino:
The text was updated successfully, but these errors were encountered: