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)); |