-
Notifications
You must be signed in to change notification settings - Fork 20.5k
Core: Deprecate jQuery.isArray #3278
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
|
Just to note - it might take a bit of time to land, since we want to release patch version first and do this in minor. So it probably be landed at 3.2 time. Thank you! |
|
I don't think these are all |
|
We'll also need to have some simple tests (perhaps even just one test ensuring |
|
There are definitely more uses, both in src/ and in some of the subdirectories. |
|
There are a few more still to go, like |
|
|
|
Or "Find in Project..." in any IDE like WebStorm, Atom or Visual Michał Gołębiowski |
|
I didn't know about |
|
LGTM. I've marked this for the 3.2 milestone, it won't land until after 3.1.1 ships so don't be worried if it stays unmerged for a while. |
test/unit/deprecated.js
Outdated
| } ); | ||
|
|
||
| QUnit.test( "jQuery.isArray", function( assert ) { | ||
| assert.strictEqual( jQuery.isArray, Array.isArray, "jQuery.isArray raises error" ); |
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.
"raises error"?
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.
it's my wrong, I propose to change it as "Array.isArray covers jQuery.isArray"
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.
"jQuery.isArray equals jQuery.isArray" would be better IMO.
|
@kumarmj We'll need you to sign our new JS Foundation CLA; you'll find the link in the checks at the bottom. |
|
LGTM. Thanks, @kumarmj! |
src/deprecated.js
Outdated
| this.off( types, selector || "**", fn ); | ||
| } | ||
| }, | ||
| isArray: Array.isArray |
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 is extending jQuery.fn, not jQuery.
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.
Nice catch. @kumarmj I know this is now fixed but have you run the test suite before submitting the PR? It would fail the test you added in the previous version.
| this.off( selector, "**" ) : | ||
| this.off( types, selector || "**", fn ); | ||
| } | ||
|
|
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.
👍 Looks good. For cleanliness, maybe remove this line which wasn't there. (Sorry)
|
Landed. I made the following changes, please take a look @kumarmj as ideally next time you'd do it yourself:
Thanks for the PR! |
fix #2961