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

Unified Diff: src/promise-utils.cc

Issue 2528603002: [promises] Set promise context's closure to be an empty function (Closed)
Patch Set: Created 4 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/promise-utils.cc
diff --git a/src/promise-utils.cc b/src/promise-utils.cc
index fa5213463b6f4709f181578797af279ba6702d73..607dbe8caa38f658c5edf5b12557bf39e1be325d 100644
--- a/src/promise-utils.cc
+++ b/src/promise-utils.cc
@@ -44,6 +44,8 @@ void PromiseUtils::CreateResolvingFunctions(Isolate* isolate,
isolate->factory()->NewPromiseResolvingFunctionContext(
kPromiseContextLength);
context->set_native_context(*isolate->native_context());
+ // We set the closure to be an empty function, same as native context.
+ context->set_closure(isolate->native_context()->closure());
context->set(kAlreadyVisitedSlot, Smi::kZero);
context->set(kPromiseSlot, *promise);
context->set(kDebugEventSlot, *debug_event);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698