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

[JS] MapRowProxyHandler.ownKeys can return a typed array #40407

Closed
mbostock opened this issue Mar 7, 2024 · 0 comments
Closed

[JS] MapRowProxyHandler.ownKeys can return a typed array #40407

mbostock opened this issue Mar 7, 2024 · 0 comments

Comments

@mbostock
Copy link
Contributor

mbostock commented Mar 7, 2024

Describe the bug, including details regarding any error messages, version, and platform.

The MapRowProxyHandler ownKeys implementation currently calls array.map:

arrow/js/src/row/map.ts

Lines 109 to 111 in 40d4c54

ownKeys(row: MapRow<K, V>) {
return row[kKeys].toArray().map(String);
}

When row[kKeys].toArray() returns a typed array such as Float32Array, this means that ownKeys returns a Float32Array, which is a bug because a ProxyHandler is required to return an iterable of string or Symbol. (See Proxy.ownKeys.) This results in a crash when trying to use the in operator with a MapRow object.

Component(s)

JavaScript

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