Console displays inherited getter as own property
Reported by
a.d.be...@gmail.com,
Dec 17
|
||||
Issue description
UserAgent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.85 Safari/537.36 Vivaldi/2.2.1388.34
Steps to reproduce the problem:
Run the code
```js
var Foo = function(){};
Object.defineProperty(Foo.prototype,'x',{
get(){
return 3;
}
});
var foo = new Foo();
console.dir(foo);
```
Also happens with `console.log` instead of `console.dir`, or when there's a setter alongside the getter.
What is the expected behavior?
The log should show
Foo {
__proto__:{
constructor: ƒ (),
x: 3,
__proto__: Object
}
}
What went wrong?
The log shows
Foo {
x: 3,
__proto__:{
constructor: ƒ (),
x: 3,
__proto__: Object
}
}
It includes the `x` property (first shown as "(...)" with the "invoke property getter" tooltip) on the object itself, not only on the prototype.
Did this work before? Yes
Chrome version: 70.0.3538.110 Channel: stable
OS Version: 6.1 (Windows 7, Windows Server 2008 R2)
Flash Version:
Found at https://stackoverflow.com/questions/53816004/what-happens-when-invoke-object-defineproperty-for-a-functions-prototype
,
Dec 18
,
Dec 18
Thanks for filing the issue! Able to reproduce the issue on reported chrome version 70.0.3538.110 and on the latest canary 73.0.3643.0 using Windows 10, Ubuntu 14.04 and Mac 10.14.1 As the issue is seen from M60(60.0.3112.0) considering it as Non-Regression and marking it as Untriaged. CC'ing eseidel@ from comment#1, for further inputs.
,
Jan 8
|
||||
►
Sign in to add a comment |
||||
Comment 1 by woxxom@gmail.com
, Dec 17