@@ -72,6 +72,18 @@ const test = (binding) => {
72
72
obj [ clazz . kTestAccessorTInternal ] = 'instance internal getset 4' ;
73
73
assert . strictEqual ( obj [ clazz . kTestAccessorTInternal ] , 'instance internal getset 4' ) ;
74
74
}
75
+
76
+ // own property
77
+ {
78
+ obj . testSetter = 'own property value' ;
79
+ // Make sure the properties are enumerable.
80
+ assert ( Object . getOwnPropertyNames ( obj ) . indexOf ( 'ownProperty' ) >= 0 ) ;
81
+ assert ( Object . getOwnPropertyNames ( obj ) . indexOf ( 'ownPropertyT' ) >= 0 ) ;
82
+
83
+ // Make sure the properties return the right value.
84
+ assert . strictEqual ( obj . ownProperty , 'own property value' ) ;
85
+ assert . strictEqual ( obj . ownPropertyT , 'own property value' ) ;
86
+ }
75
87
} ;
76
88
77
89
const testMethod = ( obj , clazz ) => {
@@ -84,10 +96,12 @@ const test = (binding) => {
84
96
} ;
85
97
86
98
const testEnumerables = ( obj , clazz ) => {
87
- // Object.keys: only object
88
- assert . deepEqual ( Object . keys ( obj ) , [ ] ) ;
99
+ // Object.keys: only object without prototype
100
+ assert ( Object . keys ( obj ) . length === 2 ) ;
101
+ assert ( Object . keys ( obj ) . includes ( 'ownProperty' ) ) ;
102
+ assert ( Object . keys ( obj ) . indexOf ( 'ownPropertyT' ) >= 0 ) ;
89
103
90
- // for..in: object + prototype
104
+ // for..in: object and prototype
91
105
{
92
106
const keys = [ ] ;
93
107
for ( let key in obj ) {
0 commit comments