1
0
Fork 0

[jsinterp] Stringify bracket notation keys in object access (#15989)

Authored by: bashonly
This commit is contained in:
bashonly 2026-02-17 17:20:54 -06:00 committed by GitHub
commit c9c8651975
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 1 deletions

View file

@ -385,7 +385,7 @@ class JSInterpreter:
if idx == 'length':
return len(obj)
try:
return obj[int(idx)] if isinstance(obj, list) else obj[idx]
return obj[int(idx)] if isinstance(obj, list) else obj[str(idx)]
except Exception as e:
if allow_undefined:
return JS_Undefined