New issue
Advanced search Search tips

Issue 674245 link

Starred by 1 user

Issue metadata

Status: Duplicate
Merged: issue 673008
Owner: ----
Closed: Dec 2016
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

hasOwnProperty bug

Reported by alexande...@muranosoft.com, Dec 14 2016

Issue description

Chrome Version       : 55.0.2883.87
URLs (if applicable) :
Other browsers tested:
    Firefox: OK

What steps will reproduce the problem?
var a = {};
a[-1884222448] = 'AbraKadabra';
a.hasOwnProperty(-1884222448); // true
a[506754111] = "KadabraAbra";
a.hasOwnProperty(506754111);   // true
a.hasOwnProperty(-1884222448); // false ???

What is the expected result?
a.hasOwnProperty(-1884222448); // true

What happens instead?
a.hasOwnProperty(-1884222448); // false ???


It is wrong according to specification:
https://www.ecma-international.org/ecma-262/5.1/#sec-11.2.1
https://www.ecma-international.org/ecma-262/5.1/#sec-15.2.4.5

 

Comment 1 by ajha@chromium.org, Dec 14 2016

Labels: M-55 prestable-55.0.2883.87

Comment 2 by tkent@chromium.org, Dec 14 2016

Components: Blink>JavaScript
Labels: Hotlist-Interop

Comment 3 by phistuck@gmail.com, Dec 15 2016

Note - 
a.hasOwnProperty("-1884222448"); // true

So a string based key query instead of a number based key query fixes things. Interesting...
Mergedinto: 673008
Status: Duplicate (was: Unconfirmed)

Sign in to add a comment