Status: New
Owner: ----
New issue 2728 by erights: SyntaxErrors aren't always early.
http://code.google.com/p/v8/issues/detail?id=2728
A Program production cannot directly contain return statements.
eval('return') correctly throws a SyntaxError. However
eval('throw "not a SyntaxError"; return;')
throws "not a SyntaxError", which is insane, as the rejection of "return"
must happen early, when the program is parsed, whereas throwing "not a
SyntaxError" happens later, only once the program starts runnings.
Safari Version 6.0.5 (8536.30.1, 537+) correctly reports
SyntaxError: Return statements are only valid inside functions
Firefox Nightly 24.0a1 (2013-06-09) correctly reports
SyntaxError on line 1: return not in function
On old-and-current versions of Chrome still suffering from issue 2470 ,
which includes the current released version 27.0.1453.110, SES would
benefit tremendously from being able to use such early SyntaxErrors for
verification purposes if they were reliably early. (See
https://codereview.appspot.com/10181043/ ) Other testing indicates that
some SyntaxErrors are caught early. For which constructs can we rely on
SyntaxErrors being reliably early, on these browsers?
Note that it would not benefit SES to fix this bug, since such a fix would
only appear on browsers in which issue 2470 was already fixed, where we
wouldn't need it. We just need to know the current extent of the bug.
Thanks.
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.