forward-incompatible Function.prototype.toString requirement

Andreas Rossberg rossberg at google.com
Thu Apr 16 09:56:30 UTC 2015


On 16 April 2015 at 11:34, Michael Ficarra <mficarra at shapesecurity.com>
wrote:

> ES2015 section 19.2.3.5 (Function.prototype.toString) places four
> restrictions on the output of Function.prototype.toString, one of which is
>
> If the implementation cannot produce a source code string that meets these
>> criteria then it must return a string for which *eval* will throw a
>> *SyntaxError* exception.
>>
>
> What is a SyntaxError today may not be a SyntaxError tomorrow. How can an
> implementation return a string that will satisfy this requirement in the
> future when the language has added new syntax? Does the committee have a
> SyntaxError recommendation that can be added as a non-normative note to
> that section?
>

In the (probably unlikely) case that the language changed that way, and an
affected implementation adopted that change, then it would simply have to
change its toString implementation accordingly at that point. I don't see a
problem there.

/Andreas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20150416/1d05ac0a/attachment-0001.html>


More information about the es-discuss mailing list