@@ -7,7 +7,7 @@ module.exports = require('../common').runTest(test);
77function test ( binding ) {
88 {
99 const obj = { x : 'a' , y : 'b' , z : 'c' } ;
10- binding . object_freeze_seal . freeze ( obj ) ;
10+ assert . strictEqual ( binding . object_freeze_seal . freeze ( obj ) , true ) ;
1111 assert . strictEqual ( Object . isFrozen ( obj ) , true ) ;
1212 assert . throws ( ( ) => {
1313 obj . x = 10 ;
@@ -20,9 +20,21 @@ function test(binding) {
2020 } , / 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 > / ) ;
2121 }
2222
23+ {
24+ const obj = new Proxy ( { x : 'a' , y : 'b' , z : 'c' } , {
25+ preventExtensions ( ) {
26+ throw new Error ( 'foo' ) ;
27+ } ,
28+ } ) ;
29+
30+ assert . throws ( ( ) => {
31+ binding . object_freeze_seal . freeze ( obj ) ;
32+ } , / f o o / ) ;
33+ }
34+
2335 {
2436 const obj = { x : 'a' , y : 'b' , z : 'c' } ;
25- binding . object_freeze_seal . seal ( obj ) ;
37+ assert . strictEqual ( binding . object_freeze_seal . seal ( obj ) , true ) ;
2638 assert . strictEqual ( Object . isSealed ( obj ) , true ) ;
2739 assert . throws ( ( ) => {
2840 obj . w = 'd' ;
@@ -34,4 +46,16 @@ function test(binding) {
3446 // so this should not throw.
3547 obj . x = 'd' ;
3648 }
49+
50+ {
51+ const obj = new Proxy ( { x : 'a' , y : 'b' , z : 'c' } , {
52+ preventExtensions ( ) {
53+ throw new Error ( 'foo' ) ;
54+ } ,
55+ } ) ;
56+
57+ assert . throws ( ( ) => {
58+ binding . object_freeze_seal . seal ( obj ) ;
59+ } , / f o o / ) ;
60+ }
3761}
0 commit comments