1.1 --- a/rt/emul/mini/src/main/java/java/lang/Object.java Wed Feb 27 17:31:52 2013 +0100
1.2 +++ b/rt/emul/mini/src/main/java/java/lang/Object.java Thu Aug 29 07:59:21 2013 +0000
1.3 @@ -79,9 +79,17 @@
1.4 * @see Class Literals, section 15.8.2 of
1.5 * <cite>The Java™ Language Specification</cite>.
1.6 */
1.7 - @JavaScriptBody(args={}, body="return this.constructor.$class;")
1.8 - public final native Class<?> getClass();
1.9 + public final Class<?> getClass() {
1.10 + Class<?> c = getClassImpl();
1.11 + return c == null ? Object.class : c;
1.12 + }
1.13
1.14 + @JavaScriptBody(args={}, body=
1.15 + "var c = this.constructor.$class;\n"
1.16 + + "return c ? c : null;\n"
1.17 + )
1.18 + private final native Class<?> getClassImpl();
1.19 +
1.20 /**
1.21 * Returns a hash code value for the object. This method is
1.22 * supported for the benefit of hash tables such as those provided by