Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to optimize CasperJS project using Google Closure?
    primarykey
    data
    text
    <p>I'm trying to optimize the CasperJS tests run.js code(https://github.com/n1k0/casperjs/blob/master/tests/run.js), so that I could understand how I can use it further to optimize further the tests that I've written. Here's the sample run.js of the CasperJS project that I was trying to optimize using ADVANCED_OPTIMIZATIONS flag to the compiler. (https://github.com/n1k0/casperjs/blob/master/tests/run.js) But the optimized code is as below:</p> <pre><code>phantom.d || (console.log("This script must be invoked using the casperjs executable"), phantom.c(1)); var a = require("fs"), c = require("utils").h, d = require("casper").create({g:!1}); d.options.n = d.a.get("direct") || !1; d.options.i = d.a.get("log-level") || "error"; d.m("open.location", function(b) { return!/^http/.test(b) ? c("file://%s/%s", phantom.e, b) : b }); var e = []; d.a.b.length ? e = d.a.b.filter(function(b) { return a.isFile(b) || a.isDirectory(b) }) : (d.f("No test path passed, exiting.", "RED_BAR", 80), d.c(1)); d.test.j("tests.complete", function() { this.k(true, void 0, d.a.get("xunit") || void 0) }); d.test.l.apply(d.test, e); </code></pre> <p>Obviously, this is failing as being told by the compiler (Ex: JSC_INEXISTENT_PROPERTY: Property casperLoaded never defined on phantom at line 2 character 5 if (!phantom.casperLoaded) )</p> <p>Can you please guide me as to how to use the Closure Compiler, to optimize all of the JS files in the project with their dependencies, thus avoiding these errors and proceed further.</p> <p>I went through the documentation for the Closure, but I wasn't able to figure out the approach needed in this case.</p> <p>FYI: I was using the Closure compiler.jar</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload