On 10/27/15 4:35 AM, Claude Pache wrote:
it is that, for any callable object, it will return a string and not throw, 
because it was so since the dawn of JS.

It's totally false for random "host objects" with a [[Call]] in ES5, per spec and in at least some implementations. As you can tell in Firefox for example:

  Function.prototype.toString.call(document.createElement("object"))

(though it does not throw for document.all in Firefox, for interesting implementation reasons).

That function will work (in the sense of: will return an answer; I'm not judging the quality of 
that answer) with anything reasonable fed to it (where "reasonable" excludes things like 
`(class { static toString() { throw "pwnd!" }})`).

Won't work with an HTMLObjectElement in at least some browsers. How "reasonable" that is, who knows.

-Boris
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to