Update Promise.race and Promise.all to ES11 (#3954)

Changes based on ECMA-262 v11, 25.6.4.4 and 26.6.4.1 step 3

JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
This commit is contained in:
Szilagyi Adam
2020-07-02 11:46:07 +02:00
committed by GitHub
parent 55d6637da5
commit cd1e067671
5 changed files with 13 additions and 35 deletions
@@ -79,3 +79,7 @@ var closed = false;
delete Promise.resolve;
Promise.all(createIterable([1,2,3], {'return': function () { closed = true; }}));
assert (closed);
var arr = [];
Object.defineProperty(arr, Symbol.species, { get: function () { assert(false) }});
Promise.all(arr);
@@ -67,3 +67,7 @@ var closed = false;
delete Promise.resolve;
Promise.race(createIterable([1,2,3], {'return': function () { closed = true; }}));
assert (closed);
var arr = [];
Object.defineProperty(arr, Symbol.species, { get: function () { assert(false) }});
Promise.race(arr);
@@ -13,9 +13,4 @@
// limitations under the License.
Object.prototype["symbol"] = 0;
try {
Promise.race([]);
assert(false);
} catch(e) {
assert(e instanceof TypeError);
}
Promise.race([]);