@@ -46,6 +46,7 @@ const {
46
46
ObjectPrototypePropertyIsEnumerable,
47
47
ObjectSeal,
48
48
ObjectSetPrototypeOf,
49
+ ReflectApply,
49
50
RegExp,
50
51
RegExpPrototypeToString,
51
52
Set,
@@ -627,7 +628,7 @@ function addPrototypeProperties(ctx, main, obj, recurseTimes, output) {
627
628
continue ;
628
629
}
629
630
const value = formatProperty (
630
- ctx , obj , recurseTimes , key , kObjectType , desc ) ;
631
+ ctx , obj , recurseTimes , key , kObjectType , desc , main ) ;
631
632
if ( ctx . colors ) {
632
633
// Faint!
633
634
output . push ( `\u001b[2m${ value } \u001b[22m` ) ;
@@ -1677,7 +1678,8 @@ function formatPromise(ctx, value, recurseTimes) {
1677
1678
return output ;
1678
1679
}
1679
1680
1680
- function formatProperty ( ctx , value , recurseTimes , key , type , desc ) {
1681
+ function formatProperty ( ctx , value , recurseTimes , key , type , desc ,
1682
+ original = value ) {
1681
1683
let name , str ;
1682
1684
let extra = ' ' ;
1683
1685
desc = desc || ObjectGetOwnPropertyDescriptor ( value , key ) ||
@@ -1698,7 +1700,7 @@ function formatProperty(ctx, value, recurseTimes, key, type, desc) {
1698
1700
( ctx . getters === 'get' && desc . set === undefined ) ||
1699
1701
( ctx . getters === 'set' && desc . set !== undefined ) ) ) {
1700
1702
try {
1701
- const tmp = value [ key ] ;
1703
+ const tmp = ReflectApply ( desc . get , original , [ ] ) ;
1702
1704
ctx . indentationLvl += 2 ;
1703
1705
if ( tmp === null ) {
1704
1706
str = `${ s ( `[${ label } :` , sp ) } ${ s ( 'null' , 'null' ) } ${ s ( ']' , sp ) } ` ;
0 commit comments