зеркало из https://github.com/mozilla/gecko-dev.git
Bug 697279 - Properly disable some E4X opcodes in strict mode. r=brendan
This commit is contained in:
Родитель
2703feda57
Коммит
b29f066f78
|
@ -6930,12 +6930,20 @@ Parser::primaryExpr(TokenKind tt, JSBool afterDot)
|
|||
|
||||
#if JS_HAS_XML_SUPPORT
|
||||
case TOK_STAR:
|
||||
if (tc->inStrictMode()) {
|
||||
reportErrorNumber(NULL, JSREPORT_ERROR, JSMSG_SYNTAX_ERROR);
|
||||
return NULL;
|
||||
}
|
||||
pn = qualifiedIdentifier();
|
||||
if (!pn)
|
||||
return NULL;
|
||||
break;
|
||||
|
||||
case TOK_AT:
|
||||
if (tc->inStrictMode()) {
|
||||
reportErrorNumber(NULL, JSREPORT_ERROR, JSMSG_SYNTAX_ERROR);
|
||||
return NULL;
|
||||
}
|
||||
pn = attributeIdentifier();
|
||||
if (!pn)
|
||||
return NULL;
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
/*
|
||||
* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/licenses/publicdomain/
|
||||
*/
|
||||
|
||||
function checkSyntaxError(code) {
|
||||
var error;
|
||||
try {
|
||||
eval(code);
|
||||
} catch (e) {
|
||||
error = e;
|
||||
}
|
||||
assertEq(error.name, 'SyntaxError');
|
||||
}
|
||||
|
||||
checkSyntaxError('"use strict"; *');
|
||||
checkSyntaxError('"use strict"; @7');
|
Загрузка…
Ссылка в новой задаче