diff --git a/lib/6to5/generation/generator.js b/lib/6to5/generation/generator.js index b12f235b55..1b830b6a30 100644 --- a/lib/6to5/generation/generator.js +++ b/lib/6to5/generation/generator.js @@ -115,6 +115,7 @@ CodeGenerator.prototype.print = function (node, parent, opts) { if (!node) return ""; var self = this; + opts = opts || {}; var newline = function (leading) { @@ -170,7 +171,7 @@ CodeGenerator.prototype.print = function (node, parent, opts) { this.printTrailingComments(node, parent); } else { - throw new ReferenceError("unknown node " + node.type); + throw new ReferenceError("unknown node of type " + JSON.stringify(node.type) + " with constructor " + JSON.stringify(node && node.constructor.name)); } };