Skip to content

isArraylike #2238

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

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 commented Apr 28, 2015

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

this is not useful, because nodeList has no nodeType.

@markelog
Copy link
Member

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

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

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

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

@markelog
Copy link
Member

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

@dmethvin
Copy link
Member

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

I'm fine with removing it.

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

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 pushed a commit that referenced this issue May 5, 2015
markelog pushed 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.
Labels
Development

No branches or pull requests

5 participants