Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(#1237): polyfill android Map.putIfAbsent #1252

Merged
merged 4 commits into from
Aug 6, 2022
Merged

fix(#1237): polyfill android Map.putIfAbsent #1252

merged 4 commits into from
Aug 6, 2022

Conversation

naijun0403
Copy link
Contributor

@naijun0403 naijun0403 commented Aug 1, 2022

fix #1237

Copy link
Contributor

@tonygermano tonygermano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer to not add a new method to ScriptRuntime only to support a version of Android that has itself been unsupported by Google for 4 years.

I think it would be reasonable and have minimal impact to revert/rewrite the other sections to not use the unsupported method.

src/org/mozilla/javascript/Hashtable.java Outdated Show resolved Hide resolved
src/org/mozilla/javascript/JavaMembers.java Show resolved Hide resolved
Instead, the code that originally used the method is changed to work even if it is not used
@gbrail
Copy link
Collaborator

gbrail commented Aug 5, 2022

This looks reasonable to me. putIfAbsent is mainly a useful thing to have in concurrent hash maps. I'll test it out.

@gbrail gbrail merged commit 0497ce6 into mozilla:master Aug 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rhino 1.7.14 is not available under Android SDK 21,java.lang.NoSuchMethodError: java.util.Map.putIfAbsent
3 participants