Evaluate the JavaScriptResource scripts in a global scope EvalResource
authorJaroslav Tulach <jaroslav.tulach@apidesign.org>
Thu, 28 Apr 2016 05:58:47 +0200
branchEvalResource
changeset 195440b0f05e2545
parent 1953 5e8d764813f3
child 1955 ebda6f4d0336
Evaluate the JavaScriptResource scripts in a global scope
rt/emul/compacttest/src/test/resources/org/apidesign/bck2brwsr/vmtest/impl/htmlannotations.js
rt/vm/src/main/java/org/apidesign/vm4brwsr/VM.java
     1.1 --- a/rt/emul/compacttest/src/test/resources/org/apidesign/bck2brwsr/vmtest/impl/htmlannotations.js	Thu Apr 28 05:54:52 2016 +0200
     1.2 +++ b/rt/emul/compacttest/src/test/resources/org/apidesign/bck2brwsr/vmtest/impl/htmlannotations.js	Thu Apr 28 05:58:47 2016 +0200
     1.3 @@ -18,5 +18,3 @@
     1.4  
     1.5  function mul(x, y) { return x * y; }
     1.6  function all() { return '*/*'; }
     1.7 -window.mul = mul;
     1.8 -window.all = all;
     2.1 --- a/rt/vm/src/main/java/org/apidesign/vm4brwsr/VM.java	Thu Apr 28 05:54:52 2016 +0200
     2.2 +++ b/rt/vm/src/main/java/org/apidesign/vm4brwsr/VM.java	Thu Apr 28 05:58:47 2016 +0200
     2.3 @@ -274,7 +274,7 @@
     2.4          append("\n// resource from ").append(resource).append("\n");
     2.5          append("\n");
     2.6          if (useEval) {
     2.7 -            append("eval(\"");
     2.8 +            append("(0 || eval)(\"");
     2.9          }
    2.10          readResource(useEval, emul, this);
    2.11          if (useEval) {