Merge pull request #3968 from lydell/nodes-tokens-errors

Fix `CoffeeScript.nodes(tokens)`; fix the repl
This commit is contained in:
Michael Ficarra
2015-05-01 07:51:17 -07:00
2 changed files with 4 additions and 0 deletions

View File

@@ -34,6 +34,9 @@
return fn.call(this, code, options);
} catch (_error) {
err = _error;
if (typeof code !== 'string') {
throw err;
}
throw helpers.updateSyntaxError(err, code, options.filename);
}
};

View File

@@ -26,6 +26,7 @@ withPrettyErrors = (fn) ->
try
fn.call @, code, options
catch err
throw err if typeof code isnt 'string' # Support `CoffeeScript.nodes(tokens)`.
throw helpers.updateSyntaxError err, code, options.filename
# Compile CoffeeScript code to JavaScript, using the Coffee/Jison compiler.