BobHanson / java2script

Java2Script provides an Eclipse Java to JavaScript transpiler, with a nearly complete implementation of the Java Virtual Machine with AWT and Swing in JavaScript, with simple, automated parallel creation of both class files and js files. To date, over 600 applets have been converted.

Home Page:https://chemapps.stolaf.edu/swingjs/examples.htm

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

intern check fails for strings

BobHanson opened this issue · comments

Java2Script does not maintain a String literal pool and, as such, does not have the capability to distinguished String literals from constructed strings. See test.Test_Intern.java

	String a = "uninitialized";

	String b = "Value";

	String c = (a + b).intern();

	// false in Java but true in JavaScript:		

	System.out.println("uninitializedValue" == a + b);

	// true in Java and JavaScript:

	System.out.println("uninitializedValue" == c);