-
Notifications
You must be signed in to change notification settings - Fork 35
Conversation
JavaMap was incorrectly passing a Map Iterator to the JavaArray class instead of an array.
awesome |
Does this mean the $util.map util functions also need to be updated? I'm getting some strange results using $util.map.copyAndRemoveAllKeys. |
@thisjeremiah -- most likely, feel free to put up a PR ( and tests if you can ) ! |
@thisjeremiah @cbaron After this PR I've run into a couple of issues. This PR has exposed a deeper problem with the JavaArray class. The problem is that JavaArray extends Array but does not implement the same constructor as the native Array class. This means that native Array functions (such as map) behave incorrectly with the JavaArray class. For reference, native Array functions will call the constructor method with a number for the array's length, and then it populates that indexes. This is causing an |
@marklawlor -- thanks for digging in a bit more and providing us with information. Currently, I do not have bandwidth to iterate on a solution, but again, will gladly accept PRs. While I will not require tests ( as we did not originally write any ), I think they would be helpful in the long run. |
I created an issue to track the topic #76 I haven't used the @thisjeremiah Can you confirm that the code is failing on the |
Now that I'm glancing at the code, I think @thisjeremiah has a different issue.
|
fix: values() was incorrectly passing a MapIterator to the JavaArray constructor instead of an array causing a runtime error.
feature: entrySet() now returns a JavaArray of key,value JavaMaps