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

Unified Diff: src/factory.cc

Issue 2889863002: Allow embedder to set promise internal field count (Closed)
Patch Set: More BUILD.gn fixes 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
« no previous file with comments | « src/builtins/builtins-promise-gen.cc ('k') | src/objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « src/builtins/builtins-promise-gen.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698