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

[].hasOwnProperty('length') returns incorrect result #9

Closed
drsm opened this issue Apr 21, 2018 · 3 comments
Closed

[].hasOwnProperty('length') returns incorrect result #9

drsm opened this issue Apr 21, 2018 · 3 comments
Assignees
Labels

Comments

@drsm
Copy link
Contributor

drsm commented Apr 21, 2018

>> [].hasOwnProperty('length')
false
>> [1,2,3].hasOwnProperty('length')
true
@xeioex xeioex added the bug label Apr 22, 2018
@xeioex xeioex self-assigned this May 3, 2018
@drsm
Copy link
Contributor Author

drsm commented Jul 4, 2018

here some more tests

>> [,].hasOwnProperty('length')
false
>> [,2].hasOwnProperty('length')
false
>> (new Array(10)).hasOwnProperty('length')
false
>> (new Array('10')).hasOwnProperty('length')
true
>> (new Array()).hasOwnProperty('length')
false
>> (Array.of()).hasOwnProperty('length')
false
>> (Array.of(1)).hasOwnProperty('length')
true

also related

>> 'asdf'.hasOwnProperty('length')
false
>> (new String('asdf')).hasOwnProperty('length')
false

@xeioex
Copy link
Contributor

xeioex commented Sep 20, 2018

Hi @drsm,

Please, take a look at the following patch: https://gist.github.com/xeioex/f691a64d48ddb7db0fda16ceceab5670

@drsm
Copy link
Contributor Author

drsm commented Sep 22, 2018

Hi @xeioex!

the patch fixes the original issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants