mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-01-14 01:07:55 -05:00
Merge pull request #3968 from lydell/nodes-tokens-errors
Fix `CoffeeScript.nodes(tokens)`; fix the repl
This commit is contained in:
@@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user