Skip to content

Commit

Permalink
[js] use +key instead of key | 0 in IntMap (fixes #10316)
Browse files Browse the repository at this point in the history
  • Loading branch information
RealyUniqueName committed Jul 13, 2021
1 parent 97659aa commit a7ef93d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions extra/CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
2021-XX-XX 4.2.4:

Bugfixes:

js : fixed IntMap for keys greater than 2^31 (#10316)

2021-07-01 4.2.3:

General improvements:
Expand Down
2 changes: 1 addition & 1 deletion std/js/_std/haxe/ds/IntMap.hx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ package haxe.ds;

public function keys():Iterator<Int> {
var a = [];
js.Syntax.code("for( var key in {0} ) if({0}.hasOwnProperty(key)) {1}.push(key | 0)", h, a);
js.Syntax.code("for( var key in {0} ) if({0}.hasOwnProperty(key)) {1}.push(+key)", h, a);
return a.iterator();
}

Expand Down

0 comments on commit a7ef93d

Please sign in to comment.