Bug 853239 - warn on a statement expression use (r=jorendorff)

This commit is contained in:
Luke Wagner
2013-06-18 13:22:58 -07:00
parent 59bb9b5af8
commit be068bd2ee
6 changed files with 54 additions and 8 deletions

View File

@@ -268,7 +268,7 @@ frontend::CompileScript(JSContext *cx, HandleObject scopeChain,
TokenStream::Position pos(parser.keepAtoms);
parser.tokenStream.tell(&pos);
ParseNode *pn = parser.statement();
ParseNode *pn = parser.statement(canHaveDirectives);
if (!pn) {
if (parser.hadAbortedSyntaxParse()) {
// Parsing inner functions lazily may lead the parser into an