String.prototype is a String object (with string value ""), Function.prototype is a function, etc. If you try on ES5 browsers you will get the same result. See the spec for the reason.
Subject: Re: @@toStringTag spoofing for null and undefined From: [email protected] Date: Mon, 9 Feb 2015 16:43:23 +0100 CC: [email protected]; [email protected] To: [email protected] Le 9 févr. 2015 à 16:15, Gary Guo <[email protected]> a écrit :I propose addition of String.prototype[@@toStringTag] as well as abridgement of Object.prototype.toString. The issue with that approach, is that `O.p.toString.call(String.prototype)` will return "[object String]", but, for ES6, `String.prototype` is not a String object, leading to a false positive that could break legacy code. (Don't know whether it is a problem in practice.) ―Claude
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

