mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 697279 - Properly disable some E4X opcodes in strict mode. r=brendan
This commit is contained in:
parent
d2d3e17c2f
commit
d2e73d550b
@ -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;
|
||||
|
17
js/src/jit-test/tests/basic/xml-in-strict.js
Normal file
17
js/src/jit-test/tests/basic/xml-in-strict.js
Normal file
@ -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');
|
Loading…
Reference in New Issue
Block a user