rt/emul/mini/src/main/java/java/lang/Boolean.java
changeset 791 af4001c85438
parent 772 d382dacfd73f
child 1097 8e42a376da73
     1.1 --- a/rt/emul/mini/src/main/java/java/lang/Boolean.java	Tue Feb 26 16:54:16 2013 +0100
     1.2 +++ b/rt/emul/mini/src/main/java/java/lang/Boolean.java	Thu Feb 28 10:39:40 2013 +0100
     1.3 @@ -25,6 +25,8 @@
     1.4  
     1.5  package java.lang;
     1.6  
     1.7 +import org.apidesign.bck2brwsr.core.JavaScriptBody;
     1.8 +
     1.9  /**
    1.10   * The Boolean class wraps a value of the primitive type
    1.11   * {@code boolean} in an object. An object of type
    1.12 @@ -279,4 +281,13 @@
    1.13      private static boolean toBoolean(String name) {
    1.14          return ((name != null) && name.equalsIgnoreCase("true"));
    1.15      }
    1.16 +    static {
    1.17 +        // as last step of initialization, initialize valueOf method
    1.18 +        initValueOf();
    1.19 +    }
    1.20 +    @JavaScriptBody(args = {  }, body = 
    1.21 +        "vm.java_lang_Boolean(false)" +
    1.22 +        ".valueOf = function() { return this._value(); };"
    1.23 +    )
    1.24 +    private native static void initValueOf();
    1.25  }