mirror of https://github.com/tc39/test262.git
14 lines
376 B
JavaScript
14 lines
376 B
JavaScript
|
function shouldBe(actual, expected) {
|
||
|
if (actual !== expected)
|
||
|
throw new Error('bad value: ' + actual);
|
||
|
}
|
||
|
|
||
|
class DerivedPromise extends Promise {
|
||
|
static get [Symbol.species]() {
|
||
|
return Promise;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
shouldBe(DerivedPromise.all([ 1, 2, 3]) instanceof DerivedPromise, true);
|
||
|
shouldBe(DerivedPromise.race([ 1, 2, 3]) instanceof DerivedPromise, true);
|