-
Notifications
You must be signed in to change notification settings - Fork 20.5k
Deferred: Stop inventing jQuery.when() resolution values #3445
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
Conversation
|
@gibson042, thanks for your PR! By analyzing the history of the files in this pull request, we identified @markelog, @jaubourg and @dmethvin to be potential reviewers. |
| // Support: Android 4.0 only | ||
| // Strict mode functions invoked without .call/.apply get global-object context | ||
| resolve.call( undefined, value ); | ||
| resolve.apply( undefined, [ value ].slice( noValue ) ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like "clever code", this passing booleans to slice. I guess that's done to reduce size (a regular if-else would be larger) but at least an explanatory comment would be useful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, and correct. Updated.
| // Support: Android 4.0 only | ||
| // Strict mode functions invoked without .call/.apply get global-object context | ||
| reject.call( undefined, value ); | ||
| reject.apply( undefined, [ value ] ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the reason for this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consistency with the preceding block, which also effects size reduction (reuse of the .apply( undefined, [ value ]… pattern is good for compression).
Fixes gh-3442