Update to Promise version from Rojo, which changes await()

This commit is contained in:
Lucien Greathouse 2018-04-20 23:25:23 -07:00
parent 9bc03fc001
commit 7fb09d103f

View file

@ -221,15 +221,11 @@ function Promise:await()
local ok = bindable.Event:Wait()
bindable:Destroy()
if not ok then
error(tostring(result[1]), 2)
end
return unpack(result)
return ok, unpack(result)
elseif self._status == Promise.Status.Resolved then
return unpack(self._value)
return true, unpack(self._value)
elseif self._status == Promise.Status.Rejected then
error(tostring(self._value[1]), 2)
return false, unpack(self._value)
end
end