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(), {
284284 assert . strictEqual ( Object . isSealed ( obj ) , true ) ;
285285
286286 assert . throws ( ( ) => {
287- obj [ 'w' ] = 'd'
287+ obj . w = 'd' ;
288288 } , / 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 / ) ;
289289
290290 assert . throws ( ( ) => {
291- delete obj [ 'x' ]
291+ delete obj . x ;
292292 } , / 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 > / ) ;
293293
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' ;
296297}
297298
298299{
@@ -303,14 +304,14 @@ assert.deepStrictEqual(test_object.TestGetProperty(), {
303304 assert . strictEqual ( Object . isFrozen ( obj ) , true ) ;
304305
305306 assert . throws ( ( ) => {
306- obj [ 'x' ] = 10
307+ obj . x = 10 ;
307308 } , / 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 > / ) ;
308309
309310 assert . throws ( ( ) => {
310- obj [ 'w' ] = 15
311+ obj . w = 15 ;
311312 } , / 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 / ) ;
312313
313314 assert . throws ( ( ) => {
314- delete obj [ 'x' ]
315+ delete obj . x ;
315316 } , / 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 > / ) ;
316317}
You can’t perform that action at this time.
0 commit comments