What was said in this sentence?

T.J. Crowder tj.crowder at farsightsoftware.com
Wed Feb 14 07:06:41 UTC 2018

On Wed, Feb 14, 2018 at 5:15 AM, Maxim Vaarwel <paloshmax at gmail.com> wrote:
>> "Whether the toString function can be applied successfully to a host
object is implementation-dependent". What "implementation-dependent"
> What does this sentence say? What kind of implementation are we talking
about (The algorithm toString is concrete described)?

The most recent spec I can find with that sentence is the 5th edition,
which is 3-4 editions out of date. I suggest using the [latest draft
standard][2] as your primary reference.

To answer your question: The implementation in question is the
implementation of the host object, not `toString`. In the 5th edition,
["host object"][1] is defined as:

> object supplied by the host environment to complete the execution
environment of ECMAScript

For instance, a DOM object in a browser. ECMAScript cannot say that
applying `Array.prototype.toString` or `Object.prototype.toString` to a
host object will necessarily work as described (for instance,
`Object.prototype.toString.call(domElement)`); it depends on the
implementation of the host object.

-- T.J. Crowder

[1]: http://ecma-international.org/ecma-262/5.1/#sec-4.3.8
[2]: https://tc39.github.io/ecma262/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20180214/ed5ee91e/attachment.html>

More information about the es-discuss mailing list