Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(654)

Unified Diff: src/parsing/parser-base.h

Issue 2599253002: [counters] Add UseCounters for 'f() = 0' syntax (Closed)
Patch Set: fix test Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/v8.h ('k') | test/cctest/test-usecounters.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « include/v8.h ('k') | test/cctest/test-usecounters.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698