mozilla / pluotsorbet

[ARCHIVED] PluotSorbet is a J2ME-compatible virtual machine written in JavaScript.
GNU General Public License v2.0
237 stars 46 forks source link

Improper case conversion. #1522

Open mbebenita opened 9 years ago

mbebenita commented 9 years ago

The statement "aśc".equalsIgnoreCase("AŚC") is true on master, as it should be. However, this is technically incorrect in J2ME because equalsIgnoreCase uses DefaultCaseConverter.isLowerCase which returns false for ś, and thus causing equalsIgnoreCase to fail.

Native["java/lang/String.equalsIgnoreCase.(Ljava/lang/String;)Z"] = function(anotherString) {
  return (isString(anotherString) && anotherString.str.toLowerCase() === this.str.toLowerCase()) ? 1 : 0;
};

Should we disable this test case: https://github.com/mozilla/j2me.js/blob/3c6c87115c11e06afa401ef81690ec9edcb59c44/tests/gnu/testlet/vm/StringTest.java#L99

mbebenita commented 9 years ago

/cc @marco-c

marco-c commented 9 years ago

I can try on the Nokia simulator or a Nokia device to see what happens there. Anyway it's probably not important, if you need to modify something that makes the test fail, I'd just remove the test.