Object.values is not working with ClientRect object
Reported by
cyril.au...@gmail.com,
Jul 14 2016
|
||
Issue description
UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.8 Safari/537.36
Steps to reproduce the problem:
1. Object.values(document.body.getBoundingClientRect())
2.
3.
What is the expected behavior?
Object.values(document.body.getBoundingClientRect()) should return the values for top, left, ...
like:
Object.values({bottom : 0, height : 0, left : 12, right : 0, top : 0, width : 0})
or
Object.values(new class{constructor(){this.a=1;this.b=2}})
What went wrong?
it returns []
Did this work before? N/A
Chrome version: 53.0.2785.8 Channel: dev
OS Version: 10.0
Flash Version: Shockwave Flash 22.0 r0
it's the same on Firefox though
,
Jul 14 2016
Object.values iterates over own values. All of the getters of the ClientRect instance are on the prototype, so you won't really get any Object.values or Object.keys: http://jsbin.com/jalewijuqu/edit?js,console
,
Jul 14 2016
Yes, thanks, I saw that Object.getOwnPropertyNames(document.body.getBoundingClientRect())) was also [], ok I didn't know it was getters |
||
►
Sign in to add a comment |
||
Comment 1 by cyril.au...@gmail.com
, Jul 14 2016