Issue metadata
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
,
Dec 14 2016
,
Dec 15 2016
Note -
a.hasOwnProperty("-1884222448"); // true
So a string based key query instead of a number based key query fixes things. Interesting...
,
Dec 15 2016
|
|||||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||||
Comment 1 by ajha@chromium.org
, Dec 14 2016