-
-
Notifications
You must be signed in to change notification settings - Fork 661
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
[jvm] fix indexOf #11942
base: development
Are you sure you want to change the base?
[jvm] fix indexOf #11942
Conversation
Could you add a test for this? I'm curious how other targets behave. |
I tested some targets ( https://try.haxe.org/#550C781c ) and the result was: Compiling native java code ( https://www.programiz.com/online-compiler/2pgIxccM3YmId ) will return "java.lang.NullPointerException:" |
hxcpp target returns 0. |
This may be something better left unspecified |
Given the different results on each target, I agree. I'm leaving this open as a reminder to add a note to the API docs because that seems to be missing from the specification. |
I think this is a controversial issue and I think it should be discussed. Haxe is very similar to JavaScript and I think it makes sense to return -1 on every target. |
This commit resolves the error if the indexOf parameter is null.
Code
Exception