Skip to content

h5.async.when()に渡したprogressフィルタを、notifyWithで呼び出した時にコンテキストが正しくセットされていない #219

@fukudayasuo

Description

@fukudayasuo

whenに渡したdeferredをnotifyWithした時に、when()の戻り値から追加したprogressフィルタが実行されるが、その中のthisがrejectWithで指定したものになっていない。notify時と同様にnotifyしたdfdオブジェクトになっている。

jQuery.whenのprogressは、whenに渡したものからnotifyWithを呼ぶと、thisが配列にになる。

var context;
$.when(df1, df2).progress(function(){ context = this; });
df1.notifyWith({a:1});
// context [{a:1}, undefined]
df2.notifyWith({b:1});
// context [{a:1}, {b:1}]

jQuery.whenと同じような挙動にする。

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions