semicolons : true,
shebang : true,
source_map : null,
+ webkit : false,
width : 80,
wrap_iife : false,
}, true);
return true;
}
+ if (output.option('webkit')) {
+ var p = output.parent();
+ if (p instanceof AST_PropAccess && p.expression === this) {
+ return true;
+ }
+ }
+
if (output.option('wrap_iife')) {
var p = output.parent();
return p instanceof AST_Call && p.expression === this;
}
expect_stdout: "42"
}
+
+no_webkit: {
+ beautify = {
+ webkit: false,
+ }
+ input: {
+ console.log(function() {
+ 1 + 1;
+ }.a = 1);
+ }
+ expect_exact: "console.log(function(){1+1}.a=1);"
+ expect_stdout: "1"
+}
+
+webkit: {
+ beautify = {
+ webkit: true,
+ }
+ input: {
+ console.log(function() {
+ 1 + 1;
+ }.a = 1);
+ }
+ expect_exact: "console.log((function(){1+1}).a=1);"
+ expect_stdout: "1"
+}
});
var args = process.argv.slice(2);
if (!args.length) {
- args.push("-mc");
+ args.push("-mcb", "beautify=false,webkit");
}
args.push("--timings");
var child_process = require("child_process");
try {
require("phantomjs-prebuilt");
} catch(e) {
- child_process.execSync("npm install phantomjs-prebuilt@2.1.14");
+ child_process.execSync("npm install phantomjs-prebuilt@2.1.14 --no-save");
}
var http = require("http");
var server = http.createServer(function(request, response) {
it("Should pass with options " + options, function(done) {
var args = options.split(/ /);
args.unshift("test/jetstream.js");
+ args.push("-b", "beautify=false,webkit");
run(process.argv[0], args, done);
});
});