Skip to content
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

isArraylike #2238

Closed
mhbseal opened this issue Apr 28, 2015 · 9 comments
Closed

isArraylike #2238

mhbseal opened this issue Apr 28, 2015 · 9 comments
Labels
Milestone

Comments

@mhbseal
Copy link
Contributor

@mhbseal mhbseal commented Apr 28, 2015

if ( obj.nodeType === 1 && length ) {
return true;
}

this is not useful, because nodeList has no nodeType.

@markelog
Copy link
Member

@markelog markelog commented Apr 28, 2015

Indeed, removing these lines doesn't break (including FF) any tests, was added in 3c7f2af

Issue exist in FF 19 but it's no longer reproducible in modern browsers. Would you like to sends us a PR?

/cc @rwaldron

@markelog markelog added the Core label Apr 28, 2015
@markelog markelog added this to the 3.0.0 milestone Apr 28, 2015
@mhbseal mhbseal mentioned this issue Apr 28, 2015
@gibson042
Copy link
Member

@gibson042 gibson042 commented Apr 28, 2015

The code still acts as a defense against form aliasing: http://jsfiddle.net/Lz0k4bn4/

We can either drop support or add a unit test.

@dmethvin
Copy link
Member

@dmethvin dmethvin commented Apr 28, 2015

Is this change fixing a bug, or removing a feature? 😈 The length variable in that aliased test case is an HTMLInputElement so you couldn't use the form element as an arraylike object to iterate over its element collection.

@gibson042
Copy link
Member

@gibson042 gibson042 commented Apr 28, 2015

The length variable in that aliased test case is an HTMLInputElement so you couldn't use the form element as an arraylike object to iterate over its element collection.

Nuh-uh: http://jsfiddle.net/Lz0k4bn4/1/ (check the console)

@dmethvin
Copy link
Member

@dmethvin dmethvin commented Apr 28, 2015

I must be missing something, here are some extra console logs: http://jsfiddle.net/Lz0k4bn4/2/

@markelog
Copy link
Member

@markelog markelog commented Apr 28, 2015

Never supported this usage, in fact, we have always closed issues like that, see the most recent one

@dmethvin
Copy link
Member

@dmethvin dmethvin commented Apr 28, 2015

I agree, we have been closing them not because we are happy with having this bug, but because the aliasing problem is too hard to solve.

@timmywil
Copy link
Member

@timmywil timmywil commented Apr 28, 2015

I'm fine with removing it.

@mhbseal mhbseal mentioned this issue Apr 29, 2015
@gibson042
Copy link
Member

@gibson042 gibson042 commented Apr 29, 2015

Working around form aliasing is hard, especially in the general case, but it is possible for length (and also nodeType and nodeName, for that matter). I'm fine if we don't, but it merits a wont-fix mention analogous to Object.prototype manipulation.

@timmywil timmywil closed this in 436f0ae May 5, 2015
timmywil added a commit that referenced this issue May 5, 2015
Fixes gh-2238
Close gh-2243
markelog added a commit that referenced this issue Nov 10, 2015
@dmethvin dmethvin modified the milestones: 1.12/2.2, 3.0.0 Jan 7, 2016
@lock lock bot locked as resolved and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants