Skip to content
This repository was archived by the owner on Jun 5, 2020. It is now read-only.

Commit 2bfb33b

Browse files
committed
What is it...
1 parent 5e3e969 commit 2bfb33b

File tree

3 files changed

+33
-17
lines changed

3 files changed

+33
-17
lines changed

ClosureCompiler.js

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -247,17 +247,24 @@
247247
});
248248
}
249249

250-
// Try global java first
251-
ClosureCompiler.testJava(ClosureCompiler.getGlobalJava(), function(ok) {
250+
// Try just `java`
251+
ClosureCompiler.testJava("java", function(ok) {
252252
if (ok) {
253-
run(ClosureCompiler.getGlobalJava(), args);
253+
run("java", args);
254254
} else {
255-
// If there is no global java, try the bundled one
256-
ClosureCompiler.testJava(ClosureCompiler.getBundledJava(), function(ok) {
255+
// Try any other global java
256+
ClosureCompiler.testJava(ClosureCompiler.getGlobalJava(), function(ok) {
257257
if (ok) {
258-
run(ClosureCompiler.getBundledJava(), args);
258+
run(ClosureCompiler.getGlobalJava(), args);
259259
} else {
260-
throw(new Error("Java is not available, neither the bundled nor a global one."));
260+
// If there is no global java, try the bundled one
261+
ClosureCompiler.testJava(ClosureCompiler.getBundledJava(), function(ok) {
262+
if (ok) {
263+
run(ClosureCompiler.getBundledJava(), args);
264+
} else {
265+
throw(new Error("Java is not available, neither the bundled nor a global one."));
266+
}
267+
});
261268
}
262269
});
263270
}

ClosureCompiler.min.js

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/test.js

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
module.exports = {
2-
3-
"Gruntfile.min.js": function(test) {
4-
var fs = require("fs");
5-
test.doesNotThrow(function() {
6-
var source = fs.readFileSync(__dirname+"/../Gruntfile.min.js");
7-
});
8-
test.done();
1+
var ClosureCompiler = require(__dirname+"/../ClosureCompiler.min.js");
2+
3+
ClosureCompiler.compile(__filename, {}, function(error, result) {
4+
if (error) {
5+
throw(error);
96
}
10-
11-
};
7+
console.log("--- SUCCESS ---\n"+result);
8+
process.exit(0);
9+
});

0 commit comments

Comments
 (0)