Reflect.toStringSpec proposal

Allen Wirfs-Brock allen at
Wed Dec 14 03:37:24 UTC 2016

> On Dec 13, 2016, at 4:51 PM, Sergey R <chi187 at> wrote:
> I want to propose a new language feature — Reflect.toStringSpec.
> Here is a repo <>
> Some context: <>_______________________________________________

Doesn’t this do exactly what you want:

// JS level equivalent of ES spec ToString abstract operation <> 
function ToString(v) {
   if (typeof v === “symbol”) throw TypeError(“Can’t convert a symbol to a string”);
   return String(v);  //for non-symbols String(v) primitively returns ToString(v)

This seems like something that can reasonably be coded as part of a polyfill
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list