Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use esprima-fb from NPM by default. #106

Merged
merged 2 commits into from
Aug 15, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var defaults = {
// If you want to use a different branch of esprima, or any other
// module that supports a .parse function, pass that module object to
// recast.parse as options.esprima.
esprima: require("esprima"),
esprima: require("esprima-fb"),

// Number of spaces the pretty-printer should use per tab for
// indentation. If you do not pass this option explicitly, it will be
Expand Down
2 changes: 1 addition & 1 deletion lib/printer.js
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ function genericPrintNoParens(path, options, print) {
} else if (printed.length > 1 ) {
parts.push(
fromString(",\n").join(printed)
.indentTail("var ".length)
.indentTail(n.kind.length + 1)
);
} else {
parts.push(printed[0]);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"debug": "node ./node_modules/mocha/bin/mocha --debug-brk --reporter spec"
},
"dependencies": {
"esprima": "git+https://github.com/ariya/esprima.git#harmony",
"esprima-fb": "~5001.1.0-dev-harmony-fb",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any particular reason to use ~ over ^ here? I know that ^ will accept different minor versions, but I forget if ~ does as well for versions greater than 1.0.0.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only because ^ isn't understood by older versions of npm (including the one that comes with node v0.8, I believe).

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes, good point.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

who cares about node v0.8 anyways? jajaja, if you're using recast, you're probably living at that edge already :)

"source-map": "0.1.32",
"private": "~0.1.5",
"cls": "~0.1.3",
Expand Down
2 changes: 1 addition & 1 deletion test/parens.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var assert = require("assert");
var esprima = require("esprima");
var esprima = require("esprima-fb");
var parse = require("../lib/parser").parse;
var Printer = require("../lib/printer").Printer;
var NodePath = require("ast-types").NodePath;
Expand Down