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