Skip to content

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

@mbostock

Description

@mbostock

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions