Commit 2f0e566c authored by Yang Guo's avatar Yang Guo Committed by Commit Bot

Remove bogus assertion for script contexts.

We assume that during bootstrapping, we won't create script contexts.
This is wrong, since JavaScript code in extensions may introduce
let/const variables.

R=jgruber@chromium.org

Change-Id: I02595abdbb65f41faffc90bde142849bbde6b554
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1666994
Auto-Submit: Yang Guo <yangguo@chromium.org>
Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#63161}
parent ef24a565
...@@ -678,9 +678,6 @@ RUNTIME_FUNCTION(Runtime_NewScriptContext) { ...@@ -678,9 +678,6 @@ RUNTIME_FUNCTION(Runtime_NewScriptContext) {
FindNameClash(isolate, scope_info, global_object, script_context_table); FindNameClash(isolate, scope_info, global_object, script_context_table);
if (isolate->has_pending_exception()) return name_clash_result; if (isolate->has_pending_exception()) return name_clash_result;
// We do not need script contexts here during bootstrap.
DCHECK(!isolate->bootstrapper()->IsActive());
Handle<Context> result = Handle<Context> result =
isolate->factory()->NewScriptContext(native_context, scope_info); isolate->factory()->NewScriptContext(native_context, scope_info);
......
...@@ -3565,6 +3565,7 @@ UNINITIALIZED_TEST(SnapshotCreatorIncludeGlobalProxy) { ...@@ -3565,6 +3565,7 @@ UNINITIALIZED_TEST(SnapshotCreatorIncludeGlobalProxy) {
base::make_unique<v8::Extension>("new extension", base::make_unique<v8::Extension>("new extension",
"function i() { return 24; }" "function i() { return 24; }"
"function j() { return 25; }" "function j() { return 25; }"
"let a = 26;"
"try {" "try {"
" if (o.p == 7) o.p++;" " if (o.p == 7) o.p++;"
"} catch {}"); "} catch {}");
...@@ -3582,6 +3583,7 @@ UNINITIALIZED_TEST(SnapshotCreatorIncludeGlobalProxy) { ...@@ -3582,6 +3583,7 @@ UNINITIALIZED_TEST(SnapshotCreatorIncludeGlobalProxy) {
ExpectInt32("i()", 24); ExpectInt32("i()", 24);
ExpectInt32("j()", 25); ExpectInt32("j()", 25);
ExpectInt32("o.p", 8); ExpectInt32("o.p", 8);
ExpectInt32("a", 26);
v8::TryCatch try_catch(isolate); v8::TryCatch try_catch(isolate);
CHECK(CompileRun("x").IsEmpty()); CHECK(CompileRun("x").IsEmpty());
CHECK(try_catch.HasCaught()); CHECK(try_catch.HasCaught());
......
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