-
Notifications
You must be signed in to change notification settings - Fork 475
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Promise.prototype.finally #866
Comments
My intention is to write the PR as soon as I reach stage 3, since it's a stage 4 requirement. However, I won't be seeking that until May or July at a minimum, so there's plenty of time. |
There's a bunch of tests in V8 for this FYI |
Some more tests if someone wants to write up a PR -- var count = 0;
class FooPromise extends Promise {
constructor(resolve, reject) {
count++;
return super(resolve, reject);
}
}
testAsync(assert => {
assert.plan(1);
count = 0;
new FooPromise(r => r()).finally(() => {}).then(() => {
assert.equals(6, count);
});
}, "finally/speciesconstructor");
testAsync(assert => {
assert.plan(1);
count = 0;
FooPromise.resolve().finally(() => {}).then(() => {
assert.equals(6, count);
})
}, "resolve/finally/speciesconstructor");
testAsync(assert => {
assert.plan(1);
count = 0;
FooPromise.reject().finally(() => {}).catch(() => {
assert.equals(6, count);
})
}, "reject/finally/speciesconstructor");
testAsync(assert => {
assert.plan(2);
class MyPromise extends Promise {
static get [Symbol.species]() { return Promise; }
}
var p = Promise
.resolve()
.finally(() => MyPromise.resolve());
assert.equals(true, p instanceof Promise);
assert.equals(false, p instanceof MyPromise);
}, "finally/Symbol.Species"); |
Another test for tc39/proposal-promise-finally@a162888 that's missing:
|
test262 doesn't seem to have a |
Per: - #866 (comment) - #866 (comment) Closes #866.
@ljharb I guess you already have some tests for this method, right? We want to make a plan to bring these tests as soon as you get the proposal to stage 3.
The text was updated successfully, but these errors were encountered: