Skip to content

Commit 8220564

Browse files
authored
Merge pull request #15 from jridgewell/PerformPromiseResolveThenable
Fix incorrect type in PerformPromiseResolveThenable
2 parents 2035018 + 40e1fe3 commit 8220564

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

spec.emu

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,14 +150,17 @@ This spec text is not reviewed yet and may have issues.
150150
PerformPromiseResolveThenable (
151151
_promiseToResolve_: a Promise,
152152
_thenable_: an Object,
153-
_then_: a JobCallback Record,
153+
_then_: a JobCallback Record or a function object,
154154
): either a normal completion containing *undefined* or a throw completion
155155
</h1>
156156
<dl class="header">
157157
</dl>
158158
<emu-alg>
159159
1. Let _resolvingFunctions_ be CreateResolvingFunctions(_promiseToResolve_).
160-
1. Let _thenCallResult_ be Completion(HostCallJobCallback(_then_, _thenable_, « _resolvingFunctions_.[[Resolve]], _resolvingFunctions_.[[Reject]] »)).
160+
1. If _then_ is a function object, then
161+
1. Let _thenCallResult_ be Completion(Call(_then_, _thenable_, « _resolvingFunctions_.[[Resolve]], _resolvingFunctions_.[[Reject]] »)).
162+
1. Else,
163+
1. Let _thenCallResult_ be Completion(HostCallJobCallback(_then_, _thenable_, « _resolvingFunctions_.[[Resolve]], _resolvingFunctions_.[[Reject]] »)).
161164
1. If _thenCallResult_ is an abrupt completion, then
162165
1. Return ? Call(_resolvingFunctions_.[[Reject]], *undefined*, « _thenCallResult_.[[Value]] »).
163166
1. Return ! _thenCallResult_.

0 commit comments

Comments
 (0)