You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to convert an object which has no "toString()" nor "valueOf()" method to string, the ECMAScript 5.1 spec specifies the js system should throw a TypeError exception (point 5 below). Testing shows that mujs returns the string "[object]" instead. Is it an intended non-standard behaviour?
The relevant paragraphs of the ECMAScript 5.1 spec are here:
8.12.8 [[DefaultValue]] (hint)
When the [[DefaultValue]] internal method of O is called with hint String, the following steps are taken:
1. Let toString be the result of calling the [[Get]] internal method of object O with argument "toString".
2. If IsCallable(toString) is true then,
a. Let str be the result of calling the [[Call]] internal method of toString, with O as the this value and
an empty argument list.
b. If str is a primitive value, return str.
3. Let valueOf be the result of calling the [[Get]] internal method of object O with argument "valueOf".
4. If IsCallable(valueOf) is true then,
a. Let val be the result of calling the [[Call]] internal method of valueOf, with O as the this value and
an empty argument list.
b. If val is a primitive value, return val.
5. Throw a TypeError exception
The text was updated successfully, but these errors were encountered:
When trying to convert an object which has no "toString()" nor "valueOf()" method to string, the ECMAScript 5.1 spec specifies the js system should throw a TypeError exception (point 5 below). Testing shows that mujs returns the string "[object]" instead. Is it an intended non-standard behaviour?
The relevant paragraphs of the ECMAScript 5.1 spec are here:
The text was updated successfully, but these errors were encountered: