Map System.getProperty to Util.$getDefine.
J2CL emulates getProperty via native helper, and GWT re-writes
them via pass so there is no observable change in GWT.
Change-Id: Icd46e14e2811cc1f9389331f9318d2c87158c4d2
diff --git a/user/super/com/google/gwt/emul/java/lang/System.java b/user/super/com/google/gwt/emul/java/lang/System.java
index 3400d30..a3b3062 100644
--- a/user/super/com/google/gwt/emul/java/lang/System.java
+++ b/user/super/com/google/gwt/emul/java/lang/System.java
@@ -25,6 +25,8 @@
import javaemul.internal.DateUtil;
import javaemul.internal.HashCodes;
+import jsinterop.annotations.JsMethod;
+
/**
* General-purpose low-level utility methods. GWT only supports a limited subset
* of these methods due to browser limitations. Only the documented methods are
@@ -105,16 +107,14 @@
/**
* The compiler replaces getProperty by the actual value of the property.
*/
- public static String getProperty(String key) {
- throw new AssertionError("System.getProperty should have been replaced by the compiler.");
- }
+ @JsMethod(name = "$getDefine", namespace = "nativebootstrap.Util")
+ public static native String getProperty(String key);
/**
* The compiler replaces getProperty by the actual value of the property.
*/
- public static String getProperty(String key, String def) {
- throw new AssertionError("System.getProperty should have been replaced by the compiler.");
- }
+ @JsMethod(name = "$getDefine", namespace = "nativebootstrap.Util")
+ public static native String getProperty(String key, String def);
public static int identityHashCode(Object o) {
return HashCodes.getIdentityHashCode(o);