Index: src/parsing/parser-base.h |
diff --git a/src/parsing/parser-base.h b/src/parsing/parser-base.h |
index 6e407eef6d765e5dfc2e7012728b6019f1976955..9ce9c32309328c7cc890f4877ed169897099685b 100644 |
--- a/src/parsing/parser-base.h |
+++ b/src/parsing/parser-base.h |
@@ -4331,7 +4331,12 @@ ParserBase<Impl>::CheckAndRewriteReferenceExpression( |
} |
if (expression->IsCall()) { |
// If it is a call, make it a runtime error for legacy web compatibility. |
+ // Bug: https://bugs.chromium.org/p/v8/issues/detail?id=4480 |
// Rewrite `expr' to `expr[throw ReferenceError]'. |
+ impl()->CountUsage( |
+ is_strict(language_mode()) |
+ ? v8::Isolate::kAssigmentExpressionLHSIsCallInStrict |
+ : v8::Isolate::kAssigmentExpressionLHSIsCallInSloppy); |
ExpressionT error = impl()->NewThrowReferenceError(message, beg_pos); |
return factory()->NewProperty(expression, error, beg_pos); |
} |