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
Array.from returns an empty array when the required items argument is omitted. An omitted argument supplies undefined, so the call should throw a TypeError.
Steps to Reproduce
$ xst -e "print(JSON.stringify(Array.from()))"
[]
Expected behavior
A TypeError is thrown.
For comparison, V8 (15.3.27):
$ v8 -e "Array.from();"
TypeError: undefined is not iterable
Other information
XS already throws the expected error when undefined is passed explicitly:
$ xst -e "try { Array.from(undefined); } catch (e) { print(e.name); }"
TypeError
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
Array.fromreturns an empty array when the requireditemsargument is omitted. An omitted argument suppliesundefined, so the call should throw aTypeError.Steps to Reproduce
$ xst -e "print(JSON.stringify(Array.from()))" []Expected behavior
A
TypeErroris thrown.For comparison, V8 (15.3.27):
$ v8 -e "Array.from();" TypeError: undefined is not iterableOther information
XS already throws the expected error when
undefinedis passed explicitly:$ xst -e "try { Array.from(undefined); } catch (e) { print(e.name); }" TypeError