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

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

Issue 1931003003: Fix 'eval' in class extends clauses to be always-strict (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Remove unrelated test case Created 4 years, 8 months 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 | « src/interpreter/bytecode-generator.cc ('k') | test/mjsunit/regress/regress-4970.js » ('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 7202c981e566165d4cf8495e86aad758ae2ae5ae..dfaf642eb734132ac405a8de757c1bea1a3140d8 100644
--- a/src/parsing/parser-base.h
+++ b/src/parsing/parser-base.h
@@ -913,8 +913,12 @@ class ParserBase : public Traits {
void CheckPossibleEvalCall(ExpressionT expression, Scope* scope) {
if (Traits::IsIdentifier(expression) &&
Traits::IsEval(Traits::AsIdentifier(expression))) {
- scope->DeclarationScope()->RecordEvalCall();
scope->RecordEvalCall();
+ if (is_sloppy(scope->language_mode())) {
+ // For sloppy scopes we also have to record the call at function level,
+ // in case it includes declarations that will be hoisted.
+ scope->DeclarationScope()->RecordEvalCall();
+ }
}
}
« no previous file with comments | « src/interpreter/bytecode-generator.cc ('k') | test/mjsunit/regress/regress-4970.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698