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

Unified Diff: src/api.cc

Issue 1477023002: Deprecate Promise::Chain from V8 APIs (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 5 years 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 | « include/v8.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index 29e417c8d527b3d16e2fc1a97f631aafab5670b7..38d641dd99bfac3280f4b6185d74d44e2d9a042c 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -6461,10 +6461,12 @@ void Promise::Resolver::Reject(Local<Value> value) {
}
-MaybeLocal<Promise> Promise::Chain(Local<Context> context,
- Local<Function> handler) {
+namespace {
+
+MaybeLocal<Promise> DoChain(Value* value, Local<Context> context,
+ Local<Function> handler) {
PREPARE_FOR_EXECUTION(context, "Promise::Chain", Promise);
- auto self = Utils::OpenHandle(this);
+ auto self = Utils::OpenHandle(value);
i::Handle<i::Object> argv[] = {Utils::OpenHandle(*handler)};
i::Handle<i::Object> result;
has_pending_exception = !i::Execution::Call(isolate, isolate->promise_chain(),
@@ -6474,10 +6476,18 @@ MaybeLocal<Promise> Promise::Chain(Local<Context> context,
RETURN_ESCAPED(Local<Promise>::Cast(Utils::ToLocal(result)));
}
+} // namespace
+
+
+MaybeLocal<Promise> Promise::Chain(Local<Context> context,
+ Local<Function> handler) {
+ return DoChain(this, context, handler);
+}
+
Local<Promise> Promise::Chain(Local<Function> handler) {
auto context = ContextFromHeapObject(Utils::OpenHandle(this));
- RETURN_TO_LOCAL_UNCHECKED(Chain(context, handler), Promise);
+ RETURN_TO_LOCAL_UNCHECKED(DoChain(this, context, handler), Promise);
}
« no previous file with comments | « include/v8.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698