Skip to content

Commit

Permalink
fixed typo
Browse files Browse the repository at this point in the history
  • Loading branch information
dankmolot committed Jul 14, 2024
1 parent d8fd8fa commit bfe0c6f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion promise.lua
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ do
end
elseif STATE_REJECTED == _exp_0 then
if onRejected then
resolve(self, onRejected(self.reason))
resolve(p, onRejected(self.reason))
else
reject(p, self.reason)
end
Expand Down
3 changes: 2 additions & 1 deletion promise.yue
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class Promise
if onFulfilled then resolve( p, onFulfilled(@value) )
else resolve( p, @value )
when STATE_REJECTED
if onRejected then resolve( @, onRejected(@reason) )
if onRejected then resolve( p, onRejected(@reason) )
else reject( p, @reason )

if onFinally
Expand Down Expand Up @@ -140,6 +140,7 @@ class Promise
if value == @
return reject @, TypeError "Cannot resolve a promise with itself"


@resolving = true
@onFulfilled = nil
@onRejected = nil
Expand Down

0 comments on commit bfe0c6f

Please sign in to comment.