Comparing version 0.3.2 to 0.3.3
@@ -5,2 +5,3 @@ var defaults = { | ||
reuseWhitespace: true, | ||
esprima: require("esprima"), | ||
writeback: function(output) { | ||
@@ -25,4 +26,5 @@ process.stdout.write(output); | ||
reuseWhitespace: !!get("reuseWhitespace"), | ||
esprima: get("esprima"), | ||
writeback: get("writeback") | ||
}; | ||
}; |
@@ -17,3 +17,3 @@ var assert = require("assert"), | ||
var pure = require("esprima").parse(lines.toString({ | ||
var pure = options.esprima.parse(lines.toString({ | ||
tabWidth: options.tabWidth, | ||
@@ -20,0 +20,0 @@ reuseWhitespace: false, |
@@ -15,3 +15,3 @@ { | ||
], | ||
"version": "0.3.2", | ||
"version": "0.3.3", | ||
"homepage": "http://github.com/benjamn/recast", | ||
@@ -18,0 +18,0 @@ "repository": { |
@@ -125,1 +125,25 @@ var assert = require("assert"), | ||
}); | ||
exports.testAlternateEsprima = function(t, assert) { | ||
var types = require("../lib/types"); | ||
var b = types.builders; | ||
var esprima = { | ||
parse: function(code) { | ||
var program = b.program([ | ||
b.expressionStatement(b.identifier("surprise")) | ||
]); | ||
program.comments = []; | ||
return program; | ||
} | ||
}; | ||
var parser = new Parser("ignored", { esprima: esprima }); | ||
var ast = parser.getAst(); | ||
var printer = new Printer(parser); | ||
types.namedTypes.File.assert(ast, true); | ||
assert.strictEqual( | ||
printer.printGenerically(ast).toString(), | ||
"surprise;"); | ||
t.finish(); | ||
}; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
358152
10627