File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -3258,6 +3258,13 @@ assert.strictEqual(
3258
3258
util . inspect ( { [ '__proto__' ] : { a : 1 } } ) ,
3259
3259
"{ ['__proto__']: { a: 1 } }"
3260
3260
) ;
3261
+
3262
+ const o = { [ '__proto__' ] : { a : 1 } } ;
3263
+ Object . defineProperty ( o , '__proto__' , { enumerable : false } ) ;
3264
+ assert . strictEqual (
3265
+ util . inspect ( o , { showHidden : true } ) ,
3266
+ "{ ['__proto__']: { a: 1 } }"
3267
+ ) ;
3261
3268
}
3262
3269
3263
3270
{
@@ -3323,3 +3330,26 @@ assert.strictEqual(
3323
3330
}
3324
3331
} ) , '{ [Symbol(Symbol.iterator)]: [Getter] }' ) ;
3325
3332
}
3333
+
3334
+ {
3335
+ const sym = Symbol ( 'bar' ) ;
3336
+ const o = {
3337
+ 'foo' : 0 ,
3338
+ 'Symbol(foo)' : 0 ,
3339
+ [ Symbol ( 'foo' ) ] : 0 ,
3340
+ [ Symbol ( 'foo()' ) ] : 0 ,
3341
+ [ sym ] : 0 ,
3342
+ } ;
3343
+ Object . defineProperty ( o , sym , { enumerable : false } ) ;
3344
+
3345
+ assert . strictEqual (
3346
+ util . inspect ( o , { showHidden : true } ) ,
3347
+ '{\n' +
3348
+ ' foo: 0,\n' +
3349
+ " 'Symbol(foo)': 0,\n" +
3350
+ ' [Symbol(foo)]: 0,\n' +
3351
+ ' [Symbol(foo())]: 0,\n' +
3352
+ ' [Symbol(bar)]: 0\n' +
3353
+ '}' ,
3354
+ ) ;
3355
+ }
You can’t perform that action at this time.
0 commit comments