@@ -72,6 +72,18 @@ const test = (binding) => {
7272 obj [ clazz . kTestAccessorTInternal ] = 'instance internal getset 4' ;
7373 assert . strictEqual ( obj [ clazz . kTestAccessorTInternal ] , 'instance internal getset 4' ) ;
7474 }
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+ }
7587 } ;
7688
7789 const testMethod = ( obj , clazz ) => {
@@ -84,10 +96,12 @@ const test = (binding) => {
8496 } ;
8597
8698 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 ) ;
89103
90- // for..in: object + prototype
104+ // for..in: object and prototype
91105 {
92106 const keys = [ ] ;
93107 for ( let key in obj ) {
0 commit comments