@@ -42,6 +42,7 @@ const {
42
42
ObjectPrototypePropertyIsEnumerable,
43
43
ObjectSeal,
44
44
ObjectSetPrototypeOf,
45
+ ReflectOwnKeys,
45
46
RegExp,
46
47
RegExpPrototypeTest,
47
48
RegExpPrototypeToString,
@@ -612,11 +613,7 @@ function addPrototypeProperties(ctx, main, obj, recurseTimes, output) {
612
613
keys . forEach ( ( key ) => keySet . add ( key ) ) ;
613
614
}
614
615
// Get all own property names and symbols.
615
- keys = ObjectGetOwnPropertyNames ( obj ) ;
616
- const symbols = ObjectGetOwnPropertySymbols ( obj ) ;
617
- if ( symbols . length !== 0 ) {
618
- keys . push ( ...symbols ) ;
619
- }
616
+ keys = ReflectOwnKeys ( obj ) ;
620
617
for ( const key of keys ) {
621
618
// Ignore the `constructor` property and keys that exist on layers above.
622
619
if ( key === 'constructor' ||
@@ -660,12 +657,10 @@ function getPrefix(constructor, tag, fallback, size = '') {
660
657
// Look up the keys of the object.
661
658
function getKeys ( value , showHidden ) {
662
659
let keys ;
663
- const symbols = ObjectGetOwnPropertySymbols ( value ) ;
664
660
if ( showHidden ) {
665
- keys = ObjectGetOwnPropertyNames ( value ) ;
666
- if ( symbols . length !== 0 )
667
- keys . push ( ...symbols ) ;
661
+ keys = ReflectOwnKeys ( value ) ;
668
662
} else {
663
+ const symbols = ObjectGetOwnPropertySymbols ( value ) ;
669
664
// This might throw if `value` is a Module Namespace Object from an
670
665
// unevaluated module, but we don't want to perform the actual type
671
666
// check because it's expensive.
0 commit comments