Build environment: macOS 26.5.2
Moddable SDK version:
- Installed via jsvu, so there is no SDK source tree /
git describe.
- Engine reports:
XS 17.9.1, slot 32 bytes, ID 4 bytes
Target device: desktop (host xs)
Description
Reflect.get throws when the propertyKey argument is omitted. The same behavior occurs with Reflect.has, Reflect.deleteProperty, Reflect.getOwnPropertyDescriptor, and Reflect.set.
An omitted argument supplies undefined. ToPropertyKey converts undefined to the String "undefined", so these methods should behave as if undefined were passed explicitly.
Steps to Reproduce
$ xst -e "Reflect.get([]);"
TypeError: no key (in Reflect.get)
Expected behavior
undefined is returned without an exception.
For comparison, V8 (15.3.27):
$ v8 -e "print(String(Reflect.get([])))"
undefined
Other information
XS already produces the expected result when undefined is passed explicitly:
$ xst -e "print(String(Reflect.get([], undefined)))"
undefined
Build environment: macOS 26.5.2
Moddable SDK version:
git describe.XS 17.9.1, slot 32 bytes, ID 4 bytesTarget device: desktop (host
xs)Description
Reflect.getthrows when thepropertyKeyargument is omitted. The same behavior occurs withReflect.has,Reflect.deleteProperty,Reflect.getOwnPropertyDescriptor, andReflect.set.An omitted argument supplies
undefined.ToPropertyKeyconvertsundefinedto the String"undefined", so these methods should behave as ifundefinedwere passed explicitly.Steps to Reproduce
$ xst -e "Reflect.get([]);" TypeError: no key (in Reflect.get)Expected behavior
undefinedis returned without an exception.For comparison, V8 (15.3.27):
$ v8 -e "print(String(Reflect.get([])))" undefinedOther information
XS already produces the expected result when
undefinedis passed explicitly:$ xst -e "print(String(Reflect.get([], undefined)))" undefined