Skip to content
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

then()をfailハンドラを渡さずに呼んだ場合、then()の戻り値のプロミスのfailハンドラが動作しない #321

Closed
fukudayasuo opened this issue May 15, 2014 · 0 comments
Assignees
Labels
Milestone

Comments

@fukudayasuo
Copy link

jQuery.1.8以降(thenがpipe同様の挙動をする場合)について、then()をfailハンドラ(第2引数)の指定無しで呼んだ場合、then()の戻り値のプロミスから登録したfailハンドラが動作しない。

d = h5.async.deferred();
p = d.then(function() {}); // failハンドラを渡さない
p.fail(function() {
    // d.reject()でここが呼ばれるはずなのに、呼ばれない。
});
d.reject();

then()をdoneハンドラを指定せずに呼んだ場合も、d.resolve()した時にp.done()に渡したハンドラが呼ばれない。

上記のソースコード例で、h5.async.deferred()ではなく、$.Deffered()を用いた場合は、ハンドラは正しく呼ばれる。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants