mbostock commented on code in PR #40408:
URL: https://github.com/apache/arrow/pull/40408#discussion_r1516682831


##########
js/src/row/map.ts:
##########
@@ -107,7 +107,7 @@ class MapRowProxyHandler<K extends DataType = any, V 
extends DataType = any> imp
     deleteProperty() { return false; }
     preventExtensions() { return true; }
     ownKeys(row: MapRow<K, V>) {
-        return row[kKeys].toArray().map(String);
+        return Array.from(row[kKeys].toArray(), String);
     }
     has(row: MapRow<K, V>, key: string | symbol) {
         return row[kKeys].includes(key);

Review Comment:
   (I’m not fixing this in this PR, but I suspect that there’s also a bug here: 
if `key` is a string, and `rows[kKeys]` is a typed array, then `includes(key)` 
will always return false. You’d need to coerce the `key` to a number, or coerce 
`rows[kKeys]` to strings, for this test to return true. Same with other usage 
of `row[kKeys].indexOf(key)` below, I expect.)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to