@@ -95,6 +95,13 @@ describe('ES2015 Specific', function () {
9595 assert ( eql ( mapA , mapB ) , 'eql(Map { a => 1, b => 2, c => 3 }, Map { a => 1, b => 2, c => 3 })' ) ;
9696 } ) ;
9797
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+
98105 } ) ;
99106
100107 describeIf ( symbolAndMapExist && typeof Map . prototype [ Symbol . iterator ] === 'function' ) ( 'map iterator' , function ( ) {
@@ -238,6 +245,13 @@ describe('ES2015 Specific', function () {
238245 assert ( eql ( setA , setB ) === true , 'eql(Set { -> }, Set { <- }) === true' ) ;
239246 } ) ;
240247
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+
241255 } ) ;
242256
243257 describeIf ( symbolAndSetExist && typeof Set . prototype [ Symbol . iterator ] === 'function' ) ( 'set iterator' , function ( ) {
0 commit comments