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

Unified Diff: src/factory.cc

Issue 2889863002: Allow embedder to set promise internal field count (Closed)
Patch Set: Initialize external fields for promises constructed through factory Created 3 years, 7 months 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
Index: src/factory.cc
diff --git a/src/factory.cc b/src/factory.cc
index 3948eec3a722461b50bfdc241322fedb837f6060..7f2eae35ddd4cbc59dc307059e78b5bf65bd0a1a 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -927,6 +927,9 @@ Handle<JSPromise> Factory::NewJSPromise() {
Handle<JSPromise> promise = Handle<JSPromise>::cast(promise_obj);
promise->set_status(v8::Promise::kPending);
promise->set_flags(0);
+ for (int i = 0; i < v8::Promise::kEmbedderFieldCount; i++) {
+ promise->SetEmbedderField(i, Smi::kZero);
+ }
isolate()->RunPromiseHook(PromiseHookType::kInit, promise, undefined_value());
return promise;

Powered by Google App Engine
This is Rietveld 408576698