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

Unified Diff: src/isolate.cc

Issue 2362503003: [promises] PromiseResolveThenableJob: change then to be a JSReceiver (Closed)
Patch Set: Created 4 years, 3 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.cc ('k') | src/objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/isolate.cc
diff --git a/src/isolate.cc b/src/isolate.cc
index cbbfeb9d9e1fed44556ff2abd7b05deaf1bf7201..a053cf48115ec36b5277bc7da7d53f38f4a1785a 100644
--- a/src/isolate.cc
+++ b/src/isolate.cc
@@ -2981,7 +2981,7 @@ void Isolate::PromiseResolveThenableJob(Handle<PromiseContainer> container,
Handle<JSReceiver> thenable(container->thenable(), this);
Handle<JSFunction> resolve(container->resolve(), this);
Handle<JSFunction> reject(container->reject(), this);
- Handle<JSFunction> then(container->then(), this);
+ Handle<JSReceiver> then(container->then(), this);
Handle<Object> argv[] = {resolve, reject};
*result = Execution::TryCall(this, then, thenable, arraysize(argv), argv,
maybe_exception);
@@ -3057,10 +3057,11 @@ void Isolate::RunMicrotasksInternal() {
callback(data);
} else {
SaveContext save(this);
- Context* context =
- microtask->IsJSFunction()
- ? Handle<JSFunction>::cast(microtask)->context()
- : Handle<PromiseContainer>::cast(microtask)->then()->context();
+ Context* context = microtask->IsJSFunction()
+ ? Handle<JSFunction>::cast(microtask)->context()
+ : Handle<PromiseContainer>::cast(microtask)
+ ->resolve()
+ ->context();
set_context(context->native_context());
handle_scope_implementer_->EnterMicrotaskContext(
Handle<Context>(context, this));
« no previous file with comments | « src/factory.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698