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

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

Issue 2497523002: [promises] Move promise constructor to TFS (Closed)
Patch Set: remove temp code 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/builtins/builtins-promise.cc ('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..55a5380a1c7a29a67d299aefdb0d42a9607a39fe 100644
--- a/src/runtime/runtime-promise.cc
+++ b/src/runtime/runtime-promise.cc
@@ -189,5 +189,21 @@ 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 *isolate->factory()->NewJSArrayWithElements(result, FAST_ELEMENTS, 2,
+ NOT_TENURED);
+}
+
} // namespace internal
} // namespace v8
« src/builtins/builtins-promise.cc ('K') | « src/runtime/runtime.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698