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
Set.prototype.has throws when the value argument is omitted. The same behavior occurs with Set.prototype.delete and Set.prototype.add.
An omitted argument supplies undefined, which is a valid Set value. Therefore, has and delete should return false for an empty Set, while add should add undefined and return the Set.
Steps to Reproduce
$ xst -e "Set.prototype.has.call(new Set());"
TypeError: no value (in Set.prototype.has)
Expected behavior
false is returned without an exception.
For comparison, V8 (15.3.27):
$ v8 -e "print(String(Set.prototype.has.call(new Set())))"
false
Other information
XS already produces the expected result when undefined is passed explicitly:
$ xst -e "print(String(Set.prototype.has.call(new Set(), undefined)))"
false
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
Set.prototype.hasthrows when thevalueargument is omitted. The same behavior occurs withSet.prototype.deleteandSet.prototype.add.An omitted argument supplies
undefined, which is a valid Set value. Therefore,hasanddeleteshould returnfalsefor an empty Set, whileaddshould addundefinedand return the Set.Steps to Reproduce
$ xst -e "Set.prototype.has.call(new Set());" TypeError: no value (in Set.prototype.has)Expected behavior
falseis returned without an exception.For comparison, V8 (15.3.27):
Other information
XS already produces the expected result when
undefinedis passed explicitly: