[JSC] use ExpressionErrorClassifier for AwaitExpression operand
authorcaitp@igalia.com <caitp@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 14 Apr 2017 19:50:24 +0000 (19:50 +0000)
committercaitp@igalia.com <caitp@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 14 Apr 2017 19:50:24 +0000 (19:50 +0000)
commit678d1e62da2aa593227976b355449c49513dc986
treef9ab66cce8f757dea2a02dbfe091727b01593958
parentac7830473bfdfbc12d051c17f2b40799e6cd78b9
[JSC] use ExpressionErrorClassifier for AwaitExpression operand
https://bugs.webkit.org/show_bug.cgi?id=170844

Reviewed by Saam Barati.

JSTests:

* stress/regress-170732.js: Added.

Source/JavaScriptCore:

In parseAssignmentExpression(), several cover grammars are handled, and
use ExpressionErrorClassifier to record hints about which grammars to
try.

In parseAwaitExpression(), the hints recorded during parsing of the
operand need to be discarded, because if they propagate to the outer
parseAssignmentExpression(), the hints will lead the parser down invalid
branches that should be skipped.

This change adds an additional ExpressionErrorClassifier to
parseAwaitExpression(), in order to discard hints recorded trying to
parse the operand.

* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseAwaitExpression):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215370 268f45cc-cd09-0410-ab3c-d52691b4dbfc
JSTests/ChangeLog
JSTests/stress/regress-170732.js [new file with mode: 0644]
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/parser/Parser.cpp