@@ -282,7 +282,7 @@ describe('Object Comparison Tests', function() {
282
282
} ) ;
283
283
284
284
it ( 'should strictly compare two Map objects from different realms with identical entries' , function ( ) {
285
- const map1 = new vm . runInNewContext ( 'Map' ) ( [ [ ' key1' , ' value1' ] , [ ' key2' , ' value2' ] ] ) ;
285
+ const map1 = new vm . runInNewContext ( 'new Map([[" key1", " value1" ], [" key2", " value2"]])' ) ;
286
286
const map2 = new Map ( [
287
287
[ 'key1' , 'value1' ] ,
288
288
[ 'key2' , 'value2' ] ,
@@ -291,7 +291,7 @@ describe('Object Comparison Tests', function() {
291
291
} ) ;
292
292
293
293
it ( 'should not strictly compare two Set objects from different realms with different values' , function ( ) {
294
- const set1 = new vm . runInNewContext ( 'Set' ) ( [ ' value1' , ' value2' ] ) ;
294
+ const set1 = new vm . runInNewContext ( 'new Set([" value1", " value2"])' ) ;
295
295
const set2 = new Set ( [ 'value1' , 'value3' ] ) ;
296
296
assert . throws ( ( ) => assert . matchObjectStrict ( set1 , set2 ) , Error ) ;
297
297
} ) ;
@@ -303,10 +303,18 @@ describe('Object Comparison Tests', function() {
303
303
} ) ;
304
304
305
305
it ( 'should compare plain objects from different realms' , function ( ) {
306
- assert . matchObjectStrict (
307
- vm . runInNewContext ( '({ a: 1, b: 2n, c: "3", d: /4/, e: new Set([5]), f: [6], g: new Uint8Array })' ) ,
308
- { b : 2n , e : new Set ( [ 5 ] ) , f : [ 6 ] , g : new Uint8Array ( ) }
309
- ) ;
306
+ const obj1 = vm . runInNewContext ( `({
307
+ a: 1,
308
+ b: 2n,
309
+ c: "3",
310
+ d: /4/,
311
+ e: new Set([5]),
312
+ f: [6],
313
+ g: new Uint8Array()
314
+ })` ) ;
315
+ const obj2 = { b : 2n , e : new Set ( [ 5 ] ) , f : [ 6 ] , g : new Uint8Array ( ) } ;
316
+
317
+ assert . throws ( ( ) => assert . matchObjectStrict ( obj1 , obj2 ) , Error ) ;
310
318
} ) ;
311
319
312
320
it ( 'should strictly compare two objects with identical getter/setter properties' , function ( ) {
0 commit comments