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

2.0.0: Optional catch binding support, removed CLI scripts #403

Closed
Closed
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
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
sudo: false
language: node_js
node_js:
- "4"
- "6"
- "8"
- "10"
- "12"
- "stable"
3 changes: 1 addition & 2 deletions benchmark/asts.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
var fs = require('fs'),
path = require('path'),
esprima = require('esprima');
path = require('path');

var FILES_PATH = path.join(__dirname, './asts');

Expand Down
77 changes: 0 additions & 77 deletions bin/escodegen.js

This file was deleted.

64 changes: 0 additions & 64 deletions bin/esgenerate.js

This file was deleted.

20 changes: 12 additions & 8 deletions escodegen.js
Original file line number Diff line number Diff line change
Expand Up @@ -1176,15 +1176,19 @@
withIndent(function () {
var guard;

result = [
'catch' + space + '(',
that.generateExpression(stmt.param, Precedence.Sequence, E_TTT),
')'
];
if (!stmt.param) {
result = ['catch'];
} else {
result = [
'catch' + space + '(',
that.generateExpression(stmt.param, Precedence.Sequence, E_TTT),
')'
];

if (stmt.guard) {
guard = that.generateExpression(stmt.guard, Precedence.Sequence, E_TTT);
result.splice(2, 0, ' if ', guard);
if (stmt.guard) {
guard = that.generateExpression(stmt.guard, Precedence.Sequence, E_TTT);
result.splice(2, 0, ' if ', guard);
}
}
});
result.push(this.maybeBlock(stmt.body, S_TFFF));
Expand Down
18 changes: 11 additions & 7 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,20 +64,24 @@ var ESLINT_OPTION = {
}
};

gulp.task('test', function () {
function test() {
return gulp.src(TEST)
.pipe(mocha({
reporter: 'spec',
timeout: 100000 // 100s
}));
});
}

gulp.task('lint', function () {
return gulp.src(LINT)
function lint() {
return gulp.src(LINT)
.pipe(eslint(ESLINT_OPTION))
.pipe(eslint.formatEach('stylish', process.stderr))
.pipe(eslint.failOnError());
});
}

gulp.task('travis', [ 'lint', 'test' ]);
gulp.task('default', [ 'travis' ]);
var travis = gulp.parallel(lint, test);

exports.test = test;
exports.lint = lint;
exports.travis = travis;
exports.default = travis;
14 changes: 5 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,15 @@
"description": "ECMAScript code generator",
"homepage": "http://github.com/estools/escodegen",
"main": "escodegen.js",
"bin": {
"esgenerate": "./bin/esgenerate.js",
"escodegen": "./bin/escodegen.js"
},
"files": [
"LICENSE.BSD",
"README.md",
"bin",
"escodegen.js",
"package.json"
],
"version": "1.12.1",
"version": "2.0.0",
"engines": {
"node": ">=4.0"
"node": ">=8.0"
},
"maintainers": [
{
Expand All @@ -32,7 +27,6 @@
"dependencies": {
"estraverse": "^4.2.0",
"esutils": "^2.0.2",
"esprima": "^4.0.1",
"optionator": "^0.8.1"
},
"optionalDependencies": {
Expand All @@ -44,7 +38,9 @@
"bower-registry-client": "^1.0.0",
"chai": "^3.5.0",
"commonjs-everywhere": "^0.9.7",
"gulp": "^3.8.10",
"espree": "^6.1.2",
"esprima": "^4.0.1",
"gulp": "^4.0.2",
"gulp-eslint": "^3.0.1",
"gulp-mocha": "^3.0.1",
"semver": "^5.1.0"
Expand Down
Loading