closure compiler has bad habbit of rearranging elements to global scope. Need to avoid it by adding yet another wrapping function. closure
authorJaroslav Tulach <jaroslav.tulach@apidesign.org>
Thu, 22 May 2014 22:32:00 +0200
branchclosure
changeset 1588c1b6db1bdd87
parent 1587 bf08bd96d408
child 1589 b66d6e7756bb
closure compiler has bad habbit of rearranging elements to global scope. Need to avoid it by adding yet another wrapping function.
javaquery/api/src/main/java/org/apidesign/bck2brwsr/htmlpage/api/Canvas.java
javaquery/api/src/main/java/org/apidesign/bck2brwsr/htmlpage/api/Element.java
rt/vm/src/main/java/org/apidesign/vm4brwsr/ClosureWrapper.java
     1.1 --- a/javaquery/api/src/main/java/org/apidesign/bck2brwsr/htmlpage/api/Canvas.java	Thu May 22 19:06:44 2014 +0200
     1.2 +++ b/javaquery/api/src/main/java/org/apidesign/bck2brwsr/htmlpage/api/Canvas.java	Thu May 22 22:32:00 2014 +0200
     1.3 @@ -51,7 +51,7 @@
     1.4      @JavaScriptBody(
     1.5              args = {"el"},
     1.6              body = "var e = window.document.getElementById(el._id());\n"
     1.7 -            + "return e.getContext('2d');\n")
     1.8 +            + "return e['getContext']('2d');\n")
     1.9      private native static Object getContextImpl(Canvas el);
    1.10  
    1.11      public GraphicsContext getContext() {
     2.1 --- a/javaquery/api/src/main/java/org/apidesign/bck2brwsr/htmlpage/api/Element.java	Thu May 22 19:06:44 2014 +0200
     2.2 +++ b/javaquery/api/src/main/java/org/apidesign/bck2brwsr/htmlpage/api/Element.java	Thu May 22 22:32:00 2014 +0200
     2.3 @@ -69,7 +69,7 @@
     2.4          body="var e = window.document.getElementById(this._id());\n"
     2.5             + "e[ev._id()] = function(ev) {\n"
     2.6          + "  var d = ev ? ev : null;\n"
     2.7 -        + "  r.onEvent__VLjava_lang_Object_2(d);\n"
     2.8 +        + "  r['onEvent__VLjava_lang_Object_2'](d);\n"
     2.9          + "};\n"
    2.10      )
    2.11      final void on(OnEvent ev, OnHandler r) {
     3.1 --- a/rt/vm/src/main/java/org/apidesign/vm4brwsr/ClosureWrapper.java	Thu May 22 19:06:44 2014 +0200
     3.2 +++ b/rt/vm/src/main/java/org/apidesign/vm4brwsr/ClosureWrapper.java	Thu May 22 22:32:00 2014 +0200
     3.3 @@ -36,6 +36,7 @@
     3.4      private static final String[] ARGS = { 
     3.5          "--compilation_level", 
     3.6          "SIMPLE_OPTIMIZATIONS", 
     3.7 +        "--output_wrapper", "(function() {%output%})(this);",
     3.8          "--js", "bck2brwsr-raw.js" 
     3.9          //, "--debug"
    3.10          //, "--formatting", "PRETTY_PRINT"