Undid the ECMA fix that disallowed '08' and '09' numeric literals. According to the ECMA lexical grammar, these literals should be scanned as two consecutive NUMBER tokens ('0' and '9') - which is always a syntax error under the grammar. Unfortunately, the javascript engine has supported these literals (with mathematical values 8 and 9) in the past, and they're likely to crop up in date code... so we probably need to remove this fix. This leaves us a superset of ECMA - by accepting these literals, we accept scripts that are not valid ECMA scripts.
git-svn-id: svn://10.0.0.236/trunk@3746 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
3e5690ef7b
commit
75a2fd1cff
@ -679,7 +679,15 @@ retry:
|
||||
RETURN(TOK_ERROR);
|
||||
c = GetChar(ts);
|
||||
radix = 16;
|
||||
} else if (JS7_ISDEC(c)) {
|
||||
} else if (JS7_ISDEC(c) && c < '8') {
|
||||
/*
|
||||
* XXX Warning needed. Checking against c < '8' above is
|
||||
* non-ECMA, but is required to support legacy code; it's
|
||||
* likely that "08" and "09" are in use in code having to do
|
||||
* with dates. So we need to support it, which makes our
|
||||
* behavior a superset of ECMA in this area. We should be
|
||||
* raising a warning if '8' or '9' is encountered.
|
||||
*/
|
||||
radix = 8;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user