-
Notifications
You must be signed in to change notification settings - Fork 460
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
081afde
commit cf37b03
Showing
4 changed files
with
76 additions
and
104 deletions.
There are no files selected for viewing
57 changes: 0 additions & 57 deletions
57
test/built-ins/Promise/all/invoke-resolve-get-error-close.js
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// Copyright (C) 2015 the V8 project authors. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
/*--- | ||
esid: sec-promise.all | ||
description: > | ||
Promise.resolve is retrieved before GetIterator call (abrupt lookup). | ||
info: | | ||
Promise.all ( iterable ) | ||
[...] | ||
3. Let promiseResolve be GetPromiseResolve(C). | ||
4. IfAbruptRejectPromise(promiseResolve, promiseCapability). | ||
GetPromiseResolve ( promiseConstructor ) | ||
[...] | ||
2. Let promiseResolve be ? Get(promiseConstructor, "resolve"). | ||
flags: [async] | ||
features: [Symbol.iterator] | ||
---*/ | ||
|
||
const iter = { | ||
get [Symbol.iterator]() { | ||
throw new Test262Error('unreachable'); | ||
}, | ||
}; | ||
|
||
const resolveError = { name: 'MyError' }; | ||
Object.defineProperty(Promise, 'resolve', { | ||
get() { | ||
throw resolveError; | ||
}, | ||
}); | ||
|
||
Promise.all(iter).then(() => { | ||
throw new Test262Error('The promise should be rejected, but it was resolved'); | ||
}, (reason) => { | ||
assert.sameValue(reason, resolveError); | ||
}).then($DONE, $DONE); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Copyright (C) 2020 the V8 project authors. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
/*--- | ||
esid: sec-promise.all | ||
description: > | ||
Promise.resolve is retrieved before GetIterator call (non-callable). | ||
info: | | ||
Promise.all ( iterable ) | ||
[...] | ||
3. Let promiseResolve be GetPromiseResolve(C). | ||
4. IfAbruptRejectPromise(promiseResolve, promiseCapability). | ||
GetPromiseResolve ( promiseConstructor ) | ||
[...] | ||
2. Let promiseResolve be ? Get(promiseConstructor, "resolve"). | ||
3. If IsCallable(promiseResolve) is false, throw a TypeError exception. | ||
flags: [async] | ||
features: [Symbol.iterator] | ||
---*/ | ||
|
||
const iter = { | ||
get [Symbol.iterator]() { | ||
throw new Test262Error("unreachable"); | ||
}, | ||
}; | ||
|
||
Promise.resolve = "certainly not callable"; | ||
|
||
Promise.all(iter).then(() => { | ||
throw new Test262Error("The promise should be rejected, but it was resolved"); | ||
}, (reason) => { | ||
assert(reason instanceof TypeError); | ||
}).then($DONE, $DONE); |
This file was deleted.
Oops, something went wrong.