Skip to content

Remove default Deferred callback context #3060

@gibson042

Description

@gibson042

I ran into an interesting obstacle when working on #3029: our longstanding behavior of using a default context for jQuery.Deferred callbacks (specifically, the deferred's base promise). It's not necessarily a blocker, but it does make $.when( $.Deferred().resolve() ).done( whatsMyContext ) very counterintuitive (in that I'm not even sure what to code for #3029). For sanity in that case—and for increased similarity with native Promises—I'd like to remove the default, making *With methods required to provide a meaningful context. In other words, the preceding code would have either undefined or global object context, depending on whether or not it was executed in strict mode.

Any objections?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions