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

Unified Diff: src/runtime/runtime-promise.cc

Issue 2497523002: [promises] Move promise constructor to TFS (Closed)
Patch Set: use jsbuiltinconstruct stub 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
« src/objects.h ('K') | « src/runtime/runtime.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-promise.cc
diff --git a/src/runtime/runtime-promise.cc b/src/runtime/runtime-promise.cc
index 226993a50ec7d92c3fe753d21531f566476ae148..b528ff7137a91d6620952316c08b730b3aaa747e 100644
--- a/src/runtime/runtime-promise.cc
+++ b/src/runtime/runtime-promise.cc
@@ -189,5 +189,20 @@ RUNTIME_FUNCTION(Runtime_RunMicrotasks) {
return isolate->heap()->undefined_value();
}
+RUNTIME_FUNCTION(Runtime_CreateResolvingFunctions) {
+ HandleScope scope(isolate);
+ CONVERT_ARG_HANDLE_CHECKED(JSObject, promise, 0);
+ Handle<JSFunction> resolve, reject;
+
+ PromiseUtils::CreateResolvingFunctions(
+ isolate, promise, isolate->factory()->true_value(), &resolve, &reject);
+
+ Handle<FixedArray> result = isolate->factory()->NewFixedArray(2);
+ result->set(0, *resolve);
+ result->set(1, *reject);
+
+ return *result;
+}
+
} // namespace internal
} // namespace v8
« src/objects.h ('K') | « src/runtime/runtime.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698