зеркало из https://github.com/mozilla/gecko-dev.git
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.
This commit is contained in:
Родитель
274c4ea37a
Коммит
c5c964116c
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче