mirror of https://github.com/boa-dev/boa.git
Browse Source
This Pull Request fixes [built-ins/Array/prototype/toString/non-callable-join-string-tag.js](https://github.com/tc39/test262/blob/main/test/built-ins/Array/prototype/toString/non-callable-join-string-tag.js) Previously: ``` Array.prototype.toString.call(new Proxy(() => {}, {})) => "[object Object]" ``` With this change: ``` Array.prototype.toString.call(new Proxy(() => {}, {})) => "[object Function]" ``` Reasoning: 1) [23.1.3.33 Array.prototype.toString](https://tc39.es/ecma262/#sec-array.prototype.tostring): Assuming `this` does not have a callable `join` property, delegate to `Object.prototype.toString`. 2) [20.1.3.6 Object.prototype.toString](https://tc39.es/ecma262/#sec-object.prototype.tostring): if `O` has a `[[Call]]` internal method set, `builtinTag` should be "Function". a) This was what was not correctly done in the existing implementation 3) [10.5.14 ProxyCreate](https://tc39.es/ecma262/#sec-proxycreate): If the `target` passed isCallable, set the `[[Call]]` internal methodpull/2462/head
Arjun Kavi
2 years ago
1 changed files with 2 additions and 3 deletions
Loading…
Reference in new issue