File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed
test/js-native-api/test_object Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -284,15 +284,16 @@ assert.deepStrictEqual(test_object.TestGetProperty(), {
284
284
assert . strictEqual ( Object . isSealed ( obj ) , true ) ;
285
285
286
286
assert . throws ( ( ) => {
287
- obj [ 'w' ] = 'd'
287
+ obj . w = 'd' ;
288
288
} , / C a n n o t a d d p r o p e r t y w , o b j e c t i s n o t e x t e n s i b l e / ) ;
289
289
290
290
assert . throws ( ( ) => {
291
- delete obj [ 'x' ]
291
+ delete obj . x ;
292
292
} , / C a n n o t d e l e t e p r o p e r t y ' x ' o f # < O b j e c t > / ) ;
293
293
294
- // Sealed objects allow updating existing properties.
295
- assert . doesNotThrow ( ( ) => { obj [ 'x' ] = 'd' } ) ;
294
+ // Sealed objects allow updating existing properties,
295
+ // so this should not throw.
296
+ obj . x = 'd' ;
296
297
}
297
298
298
299
{
@@ -303,14 +304,14 @@ assert.deepStrictEqual(test_object.TestGetProperty(), {
303
304
assert . strictEqual ( Object . isFrozen ( obj ) , true ) ;
304
305
305
306
assert . throws ( ( ) => {
306
- obj [ 'x' ] = 10
307
+ obj . x = 10 ;
307
308
} , / C a n n o t a s s i g n t o r e a d o n l y p r o p e r t y ' x ' o f o b j e c t ' # < O b j e c t > / ) ;
308
309
309
310
assert . throws ( ( ) => {
310
- obj [ 'w' ] = 15
311
+ obj . w = 15 ;
311
312
} , / C a n n o t a d d p r o p e r t y w , o b j e c t i s n o t e x t e n s i b l e / ) ;
312
313
313
314
assert . throws ( ( ) => {
314
- delete obj [ 'x' ]
315
+ delete obj . x ;
315
316
} , / C a n n o t d e l e t e p r o p e r t y ' x ' o f # < O b j e c t > / ) ;
316
317
}
You can’t perform that action at this time.
0 commit comments