Issue metadata
Sign in to add a comment
|
Object.values skips some public keys when Symbol keys are also stored on the object
Reported by
nisarg.s...@gmail.com,
Apr 28 2018
|
||||||||||||||||||||||||
Issue description
UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.139 Safari/537.36
Steps to reproduce the problem:
1. Create an object.
var obj = {};
2. Add a public property to it.
obj.x = 1;
3. Add a symbol property to it.
var sym1 = Symbol("t");
obj[sym1] = 11;
4. Add another public property to it.
obj.y = 2;
5. Access the values in the object.
console.log(Object.values(obj));
What is the expected behavior?
The value array should be [1, 2], as Symbols property wouldn't be enumerated.
What went wrong?
However, the value array comes out as [1]. The second public property is skipped.
Did this work before? N/A
Does this work in other browsers? Yes
Chrome version: 66.0.3359.139 Channel: stable
OS Version: 10.0
Flash Version:
I have also noticed that if I add two symbol keys to the object, the result of `Object.values` will omit two public keys from the result. I have included other two test cases in the attachment.
I tried iterating over the keys using `for..in` - and that works fine.
The result of `Object.keys` is fine as well.
Note: I just learned about ES6 Symbols today, so I'm not 100% sure about this. But it works as I expect in other browsers, so it does seem like a bug.
,
Apr 30 2018
,
Apr 30 2018
As this issue looks similar to that of issue 836145 , Hence duplicating into it. Please feel free to undupe if both aren't similar. Thanks! |
|||||||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||||||
Comment 1 by woxxom@gmail.com
, Apr 28 2018