Commit b11cf2e5 authored by jochen's avatar jochen Committed by Commit bot

Don't record that eval calls in inner scopes in script scopes

When we parse the top-level lazily, we don't get to see eval calls in
inner scopes anyway. By never recording them, we make sure that the
script scope ends up looking the same, no matter how we parsed it.

BUG=v8:5215
R=marja@chromium.org,adamk@chromium.org

Review-Url: https://codereview.chromium.org/2312903003
Cr-Commit-Position: refs/heads/master@{#39232}
parent 8a1747d0
......@@ -202,7 +202,9 @@ class Scope: public ZoneObject {
// eval call.
void RecordEvalCall() {
scope_calls_eval_ = true;
for (Scope* scope = this; scope != nullptr; scope = scope->outer_scope()) {
inner_scope_calls_eval_ = true;
for (Scope* scope = outer_scope(); scope && !scope->is_script_scope();
scope = scope->outer_scope()) {
scope->inner_scope_calls_eval_ = true;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment