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

Unified Diff: src/factory.cc

Issue 2703563002: [ESNext] Implement DynamicImportCall (Closed)
Patch Set: rebase Created 3 years, 8 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/factory.h ('k') | src/full-codegen/full-codegen.cc » ('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 7b0196a99c533286ba9ba9240c6bff57d35087ab..df119795418b345ec375ba15e71dad5d32d5d9c1 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -916,6 +916,21 @@ 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);
+
+ isolate()->RunPromiseHook(PromiseHookType::kInit, promise, undefined_value());
+ return promise;
+}
Handle<Context> Factory::NewNativeContext() {
Handle<FixedArray> array =
« no previous file with comments | « src/factory.h ('k') | src/full-codegen/full-codegen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698