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

Unified Diff: src/factory.cc

Issue 2703563002: [ESNext] Implement DynamicImportCall (Closed)
Patch Set: fix build Created 3 years, 9 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 b80aaf37a34e09b665b5030c54880cf261f43d00..985694f240078f0b4da7069381dc549b2885da55 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -915,6 +915,19 @@ Handle<Symbol> Factory::NewPrivateSymbol() {
return symbol;
}
+Handle<JSPromise> Factory::NewJSPromise() {
+ Handle<JSFunction> constructor(
+ isolate()->native_context()->promise_function(), isolate());
+ DCHECK(constructor->has_initial_map());
+ Handle<Map> map(constructor->initial_map(), isolate());
+
+ DCHECK(!map->is_prototype_map());
+ Handle<JSObject> promise_obj = NewJSObjectFromMap(map);
+ Handle<JSPromise> promise = Handle<JSPromise>::cast(promise_obj);
+ promise->set_status(v8::Promise::kPending);
+ promise->set_flags(0);
adamk 2017/03/15 21:36:44 There are other fields, don't we need to initializ
gsathya 2017/03/16 00:59:24 Those are set to undefined by default which is val
adamk 2017/03/16 21:41:23 Ah, ok. Can you add comments to both places refere
+ return promise;
+}
Handle<Context> Factory::NewNativeContext() {
Handle<FixedArray> array =

Powered by Google App Engine
This is Rietveld 408576698