[Webkit-unassigned] [Bug 205590] Fail to throw TypeError in Promise.race

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jan 8 14:39:51 PST 2020


https://bugs.webkit.org/show_bug.cgi?id=205590

Yusuke Suzuki <ysuzuki at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID

--- Comment #4 from Yusuke Suzuki <ysuzuki at apple.com> ---
No, the current behavior of JSC is correct in terms of the spec.
When non-iterable object comes to Promise.race, we should return rejected promise, not throwing a type error.

https://tc39.es/ecma262/#sec-promise.race

3. Let iteratorRecord be GetIterator(iterable).
4. IfAbruptRejectPromise(iteratorRecord, promiseCapability).

And JSC returns rejected promise from Promise.race.

$ Promise.race({}).catch(function (error) { print(error); });
[object Promise]
TypeError: undefined is not a function

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20200108/603037d5/attachment-0001.htm>


More information about the webkit-unassigned mailing list