Skip to content

Conversation

@gibson042
Copy link
Member

Fixes gh-3442

@mention-bot
Copy link

@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 ) );
Copy link
Member

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.

Copy link
Member Author

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 ] );
Copy link
Member

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?

Copy link
Member Author

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).

@gibson042 gibson042 merged commit 5d79c64 into jquery:master Dec 16, 2016
@lock lock bot locked as resolved and limited conversation to collaborators Jan 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants