File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -657,6 +657,8 @@ class Interp {
657
657
isAllObject = isAllObject && Reflect .isObject (key );
658
658
isAllEnum = isAllEnum && Reflect .isEnumValue (key );
659
659
}
660
+
661
+ #if (haxe_ver >= 4.1)
660
662
if ( isAllInt ) {
661
663
var m = new Map <Int ,Dynamic >();
662
664
for ( i => key in keys )
@@ -681,6 +683,20 @@ class Interp {
681
683
m .set (key , values [i ]);
682
684
return m ;
683
685
}
686
+ #else
687
+ var m : Dynamic = {
688
+ if ( isAllInt ) new haxe.ds. IntMap <Dynamic >();
689
+ else if ( isAllString ) new haxe.ds. StringMap <Dynamic >();
690
+ else if ( isAllEnum ) new haxe.ds. EnumValueMap <Dynamic , Dynamic >();
691
+ else if ( isAllObject ) new haxe.ds. ObjectMap <Dynamic , Dynamic >();
692
+ else null ;
693
+ }
694
+ if ( m != null ) {
695
+ for ( n in 0 ... keys .length )
696
+ setMapValue (m , keys [n ], values [n ]);
697
+ return m ;
698
+ }
699
+ #end
684
700
error (ECustom (" Invalid map keys " + keys ));
685
701
return null ;
686
702
}
You can’t perform that action at this time.
0 commit comments