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

TypedArrays incorrectly write to "NaN" properties #886

Closed
gibson042 opened this issue Mar 24, 2022 · 0 comments
Closed

TypedArrays incorrectly write to "NaN" properties #886

gibson042 opened this issue Mar 24, 2022 · 0 comments
Labels
confirmed issue reported has been reproduced fixed - please verify Issue has been fixed. Please verify and close.

Comments

@gibson042
Copy link

Environment: XS 11.6.0 32 4

Description
XS incorrectly honors writes to a typed array property named "NaN".

Steps to Reproduce

const arr = new Int8Array();
Reflect.set(arr, NaN, 42); // => true
arr.NaN; // => 42

Expected behavior
Per Integer-Indexed Exotic Objects [[Set]] (and related internal methods), any string-valued property recognized as a canonical numeric string by CanonicalNumericIndexString should be subject to special treatment that includes silent failure when the property name is out of bounds or non-integer. Above, Reflect.set correctly returns true but the subsequent read should return undefined.

@phoddie phoddie added the confirmed issue reported has been reproduced label Mar 24, 2022
mkellner pushed a commit that referenced this issue Mar 30, 2022
@phoddie phoddie added the fixed - please verify Issue has been fixed. Please verify and close. label Mar 30, 2022
@phoddie phoddie closed this as completed May 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed issue reported has been reproduced fixed - please verify Issue has been fixed. Please verify and close.
Projects
None yet
Development

No branches or pull requests

2 participants