Slight difference between this and thiz may cause fatal errors
authorJaroslav Tulach <jtulach@netbeans.org>
Tue, 09 Dec 2014 11:43:46 +0100
changeset 89818e17d0cd066
parent 897 2e416426cab0
child 901 4d20596b35bc
Slight difference between this and thiz may cause fatal errors
boot/src/main/java/org/netbeans/html/boot/spi/Fn.java
ko4j/src/main/java/org/netbeans/html/ko4j/KOTech.java
ko4j/src/main/java/org/netbeans/html/ko4j/Knockout.java
     1.1 --- a/boot/src/main/java/org/netbeans/html/boot/spi/Fn.java	Tue Dec 09 11:00:52 2014 +0100
     1.2 +++ b/boot/src/main/java/org/netbeans/html/boot/spi/Fn.java	Tue Dec 09 11:43:46 2014 +0100
     1.3 @@ -232,7 +232,7 @@
     1.4       * @since 0.7.6
     1.5       */
     1.6      public void invokeLater(Object thiz, Object... args) throws Exception {
     1.7 -        invoke(this, args);
     1.8 +        invoke(thiz, args);
     1.9      }
    1.10      
    1.11      /** Provides the function implementation access to the presenter provided
     2.1 --- a/ko4j/src/main/java/org/netbeans/html/ko4j/KOTech.java	Tue Dec 09 11:00:52 2014 +0100
     2.2 +++ b/ko4j/src/main/java/org/netbeans/html/ko4j/KOTech.java	Tue Dec 09 11:43:46 2014 +0100
     2.3 @@ -79,7 +79,7 @@
     2.4              funcNames[i] = funcArr[i].getFunctionName();
     2.5          }
     2.6          Object ret = getJSObject();
     2.7 -        Knockout.wrapModel(new Knockout(model, ret, propArr, funcArr),
     2.8 +        new Knockout(model, ret, propArr, funcArr).wrapModel(
     2.9              ret, 
    2.10              propNames, propReadOnly, propValues,
    2.11              funcNames
     3.1 --- a/ko4j/src/main/java/org/netbeans/html/ko4j/Knockout.java	Tue Dec 09 11:00:52 2014 +0100
     3.2 +++ b/ko4j/src/main/java/org/netbeans/html/ko4j/Knockout.java	Tue Dec 09 11:43:46 2014 +0100
     3.3 @@ -148,9 +148,9 @@
     3.4      @JavaScriptBody(
     3.5          javacall = true,
     3.6          wait4js = false,
     3.7 -        args = { "thiz", "ret", "propNames", "propReadOnly", "propValues", "funcNames" },
     3.8 +        args = { "ret", "propNames", "propReadOnly", "propValues", "funcNames" },
     3.9          body = 
    3.10 -          "Object.defineProperty(ret, 'ko4j', { value : thiz });\n"
    3.11 +          "Object.defineProperty(ret, 'ko4j', { value : this });\n"
    3.12          + "function koComputed(index, name, readOnly, value) {\n"
    3.13          + "  var trigger = ko['observable']()['extend']({'notify':'always'});"
    3.14          + "  function realGetter() {\n"
    3.15 @@ -203,8 +203,7 @@
    3.16          + "  koExpose(i, funcNames[i]);\n"
    3.17          + "}\n"
    3.18          )
    3.19 -    static native void wrapModel(
    3.20 -        Knockout self,
    3.21 +    native void wrapModel(
    3.22          Object ret, 
    3.23          String[] propNames, boolean[] propReadOnly, Object propValues,
    3.24          String[] funcNames