Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix built-ins/Array/prototype/toString/non-callable-join-string-tag.j…
…s test case (#2458) 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 method
- Loading branch information