@@ -97,6 +97,14 @@ describe('ES2015 Specific', function () {
97
97
assert ( eql ( mapA , mapB ) , 'eql(Map { a => 1, b => 2, c => 3 }, Map { a => 1, b => 2, c => 3 })' ) ;
98
98
} ) ;
99
99
100
+ ( setExists ? it : it . skip ) ( 'returns false for fake Maps' , function ( ) {
101
+ var maplikeSet = new Set ( ) ;
102
+ Object . defineProperty ( maplikeSet , 'constructor' , { enumerable : false , value : Map } ) ;
103
+ Object . setPrototypeOf ( maplikeSet , Map . prototype ) ;
104
+
105
+ assert ( eql ( maplikeSet , new Map ( ) ) === false , 'eql(Set pretending to be a Map, Map { })' ) ;
106
+ } ) ;
107
+
100
108
} ) ;
101
109
102
110
describeIf ( symbolAndMapExist && typeof Map . prototype [ Symbol . iterator ] === 'function' ) ( 'map iterator' , function ( ) {
@@ -240,6 +248,14 @@ describe('ES2015 Specific', function () {
240
248
assert ( eql ( setA , setB ) === true , 'eql(Set { -> }, Set { <- }) === true' ) ;
241
249
} ) ;
242
250
251
+ ( mapExists ? it : it . skip ) ( 'returns false for fake Sets' , function ( ) {
252
+ var setlikeMap = new Map ( ) ;
253
+ Object . defineProperty ( setlikeMap , 'constructor' , { enumerable : false , value : Set } ) ;
254
+ Object . setPrototypeOf ( setlikeMap , Set . prototype ) ;
255
+
256
+ assert ( eql ( setlikeMap , new Set ( ) ) === false , 'eql(Map pretending to be a Set, Set { })' ) ;
257
+ } ) ;
258
+
243
259
} ) ;
244
260
245
261
describeIf ( symbolAndSetExist && typeof Set . prototype [ Symbol . iterator ] === 'function' ) ( 'set iterator' , function ( ) {
0 commit comments