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(); |
+ } |
} |
} |