Commit 7f12e75a authored by Dan Elphick's avatar Dan Elphick Committed by Commit Bot

[parsing] Never marks script scopes as sloppy eval

This prevents the bytecode generator generating loads that look for
extensions in the global context, which can never succeed and means
that lazy and eager bytecode compilation will match.

Bug: v8:8510
Change-Id: I51dca62b5d1ee34f8dea82260cf27295ddf427d9
Reviewed-on: https://chromium-review.googlesource.com/c/1425520Reviewed-by: 's avatarToon Verwaest <verwaest@chromium.org>
Commit-Queue: Dan Elphick <delphick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58983}
parent 3f25e56f
......@@ -751,7 +751,10 @@ class V8_EXPORT_PRIVATE DeclarationScope : public Scope {
}
bool calls_sloppy_eval() const {
return scope_calls_eval_ && is_sloppy(language_mode());
// TODO(delphick): Calculate this when setting and change the name of
// scope_calls_eval_.
return !is_script_scope() && scope_calls_eval_ &&
is_sloppy(language_mode());
}
bool was_lazily_parsed() const { return was_lazily_parsed_; }
......
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