-
Notifications
You must be signed in to change notification settings - Fork 858
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
String comparing problem #1283
Comments
Most likely due to how you've configured Rhino, see #247 (comment) |
Thanks for replying. |
How are you getting your Java String instances then? |
By call lambda, but it is not important. Problem in comparing wrapped strings String('name') === String('name') // false |
Well, depending on the setJavaPrimitiveWrap setting they ought to be wrapped as Native JavaScript strings or not. When they are JavaScript strings, String('name') === String('name') should yield true, but if they are Java String instances it's imho expected that String('name') === String('name') yields false, as it would in Java because you're comparing instances. |
I tested setJavaPrimitiveWrap with true and false. As i understand switch operator use === to compare in cases.
no one case will work. |
Without having some sample code that reproduces the issue, there's no telling whether this is expected behavior, a bug or whether you're doing something wrong |
Tried This code shows that:
So afaics all works as expected. As no sample code has been provided that reproduces the issue, I'm closing this issue Feel free to reopen with a testcode reproducing the issue |
'name' === 'name' // true
String('name') === String('name') // false
Why wrapped strings not equals ?
And how it possible to use switch operator with java string?
The text was updated successfully, but these errors were encountered: