The erroneous line is:
<button id="syntaxError" onclick="2BeOrNot2Be(40)">Syntax Error</button>
Before the message was:
Error: missing ; before statement
Now in 3.7:
Error: identifier starts immediately after numeric literal
I can't make sense of either message so I can't figure out if this is a
bug or a feature.
I would understand if the new message was
"2BeOrNot2Be is not an identifier, number, or keyword".
or even
"identifier 'BeOrNot2Be' starts immediately after numeric literal '2'"
of course in the latter case I would say "So, deal with it" since it can
tell them apart.
bug or feature?
jjb
Compare the quality of the error reporting in the command line tool used
by the javascript engine development team:
---
js> 1for (i in this);
typein:1: SyntaxError: missing ; before statement:
typein:1: 1for (i in this);
typein:1: ^
---
to the error reporting given to our web developers:
---
Error: identifier starts immediately after numeric literal
(no source line, no line number, no column pointer).
---
Also the ECMA standard according to the bug report says:
---
The source character immediately following a NumericLiteral must not be
an IdentifierStart or DecimalDigit.
---
To me this is a much clearer error message. It leads me to look for a
numeric literal and its immediate following character, instead of
focusing my attention on "identifier". Of course if I had the source
line and column of the syntax error I probably would not even need the
message.
jjb
That's because your error was in an event handler, where there is no
line/column information (known bug, as you know). Had it been in a
<script> you would have gotten exactly the same information as the js
shell shows there.
-Boris
Yes, I do know, but do the people who write the error messages realize
this? If they use the command line, then they are getting a completely
different effect and may not realize how bad their message really is.
jjb
By and large, yes...
-Boris