File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -179,3 +179,25 @@ const expected10 = '[Function (anonymous)]';
179179const expected11 = '[Function (anonymous)]' ;
180180assert . strictEqual ( util . inspect ( proxy10 ) , expected10 ) ;
181181assert . strictEqual ( util . inspect ( proxy11 ) , expected11 ) ;
182+
183+ // Regression test for https://github.com/nodejs/node/issues/61061
184+ {
185+ const throwingProxy = new Proxy ( { } , {
186+ get ( ) {
187+ throw new EvalError ( 'boom' ) ;
188+ }
189+ } ) ;
190+
191+ const nestedThrowingProxy = new Proxy ( throwingProxy , { } ) ;
192+
193+ // showProxy: false must NOT trigger proxy traps
194+ assert . doesNotThrow ( ( ) => {
195+ const result = util . inspect ( throwingProxy , { showProxy : false } ) ;
196+ assert . strictEqual ( result , '{}' ) ;
197+ } ) ;
198+
199+ assert . doesNotThrow ( ( ) => {
200+ const result = util . inspect ( nestedThrowingProxy , { showProxy : false } ) ;
201+ assert . strictEqual ( result , '{}' ) ;
202+ } ) ;
203+ }
You can’t perform that action at this time.
0 commit comments