Skip to content

Commit

Permalink
printer: add babel 6 nodes (benjamn#298)
Browse files Browse the repository at this point in the history
  • Loading branch information
hzoo authored and benjamn committed Jul 1, 2016
1 parent 5c6bf30 commit 1c9725d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/printer.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ function genericPrintNoParens(path, options, print) {

case "SpreadElement":
case "SpreadElementPattern":
case "RestProperty": // Babel 6 for ObjectPattern
case "SpreadProperty":
case "SpreadPropertyPattern":
case "RestElement":
Expand Down Expand Up @@ -354,6 +355,7 @@ function genericPrintNoParens(path, options, print) {

return concat(parts);

case "ClassMethod": // Babel 6
case "MethodDefinition":
if (n.static) {
parts.push("static ");
Expand Down Expand Up @@ -624,6 +626,8 @@ function genericPrintNoParens(path, options, print) {
path.call(print, "pattern")
]);

case "ObjectProperty": // Babel 6
case "ObjectMethod": // Babel 6
case "Property": // Non-standard AST node type.
if (n.method || n.kind === "get" || n.kind === "set") {
return printMethod(path, options, print);
Expand Down Expand Up @@ -694,6 +698,11 @@ function genericPrintNoParens(path, options, print) {
case "Super":
return fromString("super");

case "BooleanLiteral": // Babel 6 Literal split
case "RegExpLiteral": // Babel 6 Literal split
case "NumericLiteral": // Babel 6 Literal split
case "StringLiteral": // Babel 6 Literal split
case "NullLiteral": // Babel 6 Literal split
case "Literal":
if (typeof n.value !== "string")
return fromString(n.value, options);
Expand Down

0 comments on commit 1c9725d

Please sign in to comment.