I am not sure whether it's an issue or node new stable version have intention to do this
this codeReflect.apply(Object.prototype.toString, {}) throw the error
TypeError: CreateListFromArrayLike called on non-object
I have to using Reflect.apply(Object.prototype.toString, {}, []) to make it working
Reflect.apply(Object.prototype.toString, {}, [])
'[object Object]'
if i am wrong, correct me, and close the issue!!!
By reading the spec at https://tc39.github.io/ecma262/#sec-reflect.apply, we see that CreateListFromArrayLike is called on the third argument. The second step of this operation is "If Type(obj) is not Object, throw a TypeError exception."
This is what happens with your code so I think node (actually V8) behaves correctly here.
Thx!!!
Most helpful comment
By reading the spec at https://tc39.github.io/ecma262/#sec-reflect.apply, we see that
CreateListFromArrayLikeis called on the third argument. The second step of this operation is "If Type(obj) is not Object, throw a TypeError exception."This is what happens with your code so I think node (actually V8) behaves correctly here.