[JS] Implement Promise.race()
https://bugs.webkit.org/show_bug.cgi?id=126506
Reviewed by Oliver Hunt.
Source/JavaScriptCore:
* runtime/CommonIdentifiers.h:
Add identifier for "cast".
* runtime/JSPromiseConstructor.cpp:
(JSC::abruptRejection):
Helper for the RejectIfAbrupt abstract operation.
(JSC::JSPromiseConstructorFuncRace):
Add implementation of Promise.race()
LayoutTests:
Enabled and fix the existing Promise.race() test case.
- Promise.race() and Promise.race({}) should reject by my reading of the spec.
* js/dom/Promise-static-race-expected.txt:
* js/dom/Promise-static-race.html:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161330 268f45cc-cd09-0410-ab3c-d52691b4dbfc
6 files changed