diff --git a/lib/6to5/util.js b/lib/6to5/util.js index 93d1337f90..18d0d92019 100644 --- a/lib/6to5/util.js +++ b/lib/6to5/util.js @@ -36,6 +36,13 @@ exports.parse = function (code, opts) { } }; +exports.errorWithNode = function (node, msg) { + var err = new Error(msg); + err.lineNumber = node.loc.start.line; + err.column = node.loc.start.column; + return err; +}; + exports.canCompile = function (filename) { return path.extname(filename) === ".js"; };