This is an automated email from the ASF dual-hosted git repository.

jtulach pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-netbeans-html4j.git

commit 62410a4869d273931c51205d946a842b22f01124
Author: Jaroslav Tulach <[email protected]>
AuthorDate: Tue Feb 12 19:36:17 2019 +0100

    Initialize on demand
---
 ko4j/src/main/java/org/netbeans/html/ko4j/Knockout.java | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/ko4j/src/main/java/org/netbeans/html/ko4j/Knockout.java 
b/ko4j/src/main/java/org/netbeans/html/ko4j/Knockout.java
index 7efd4e3..9222296 100644
--- a/ko4j/src/main/java/org/netbeans/html/ko4j/Knockout.java
+++ b/ko4j/src/main/java/org/netbeans/html/ko4j/Knockout.java
@@ -56,6 +56,7 @@ final class Knockout  {
     private PropertyBinding[] props;
     private FunctionBinding[] funcs;
     private Object js;
+    private Object copyFrom;
     private Object strong;
 
     public Knockout(Object model, Object copyFrom, PropertyBinding[] props, 
FunctionBinding[] funcs) {
@@ -68,10 +69,13 @@ final class Knockout  {
         for (int i = 0; i < funcs.length; i++) {
             this.funcs[i] = funcs[i].weak();
         }
-        this.js = initObjs(copyFrom);
+        this.copyFrom = copyFrom;
     }
 
     final Object js() {
+        if (js == null) {
+            this.js = initObjs(copyFrom);
+        }
         return js;
     }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to