Joseph Frazier 2017-05-24 18:57:05 -04:00 committed by Christopher Chedeau
parent a6068c0532
commit 7344a37b5c
4 changed files with 7 additions and 3 deletions

View File

@ -8,6 +8,7 @@ module.exports = {
extends: ["eslint:recommended"],
plugins: ["prettier"],
rules: {
curly: "error",
"no-console": "off",
"no-inner-declarations": "off",
"no-var": "error",

View File

@ -27,8 +27,9 @@ FastPath.from = function(obj) {
// lightweight FastPath [..., name, value] stacks.
const copy = Object.create(FastPath.prototype);
const stack = [obj.value];
for (let pp; (pp = obj.parentPath); obj = pp)
for (let pp; (pp = obj.parentPath); obj = pp) {
stack.push(obj.name, pp.value);
}
copy.stack = stack.reverse();
return copy;
}

View File

@ -1369,9 +1369,10 @@ function genericPrintNoParens(path, options, print, args) {
case "CatchClause":
parts.push("catch (", path.call(print, "param"));
if (n.guard)
if (n.guard) {
// Note: esprima does not recognize conditional catch clauses.
parts.push(" if ", path.call(print, "guard"));
}
parts.push(") ", path.call(print, "body"));

View File

@ -1,7 +1,7 @@
"use strict";
function isExportDeclaration(node) {
if (node)
if (node) {
switch (node.type) {
case "ExportDeclaration":
case "ExportDefaultDeclaration":
@ -11,6 +11,7 @@ function isExportDeclaration(node) {
case "ExportAllDeclaration":
return true;
}
}
return false;
}