Bug 1260620 - Ensure that possibleErrors are not null before attempting to check them; r=jorendorff

This commit is contained in:
Morgan Phillips 2016-03-30 02:53:44 -07:00
parent c5fa3b7151
commit da0f14f2ef
2 changed files with 6 additions and 2 deletions

View File

@ -7587,8 +7587,11 @@ Parser<ParseHandler>::expr(InHandling inHandling, YieldHandling yieldHandling,
// We begin by checking for an outer pending error since it would
// have occurred first.
if (possibleError->checkForExprErrors())
possibleErrorInner.checkForExprErrors();
if (possibleError && !possibleError->checkForExprErrors())
return null();
// Go ahead and report the inner error.
possibleErrorInner.checkForExprErrors();
return null();
}
handler.addList(seq, pn);

View File

@ -38,6 +38,7 @@ const SYNTAX_ERROR_STMTS = [
"delete ({x=1})",
"delete {x=1} = {}",
"({x=1}.abc)",
"x > (0, {a = b} );",
// declarations
"var x = 0 + {a=1} = {}",
"let o = {x=1};",