mirror of
https://github.com/jashkenas/coffeescript.git
synced 2022-11-09 12:23:24 -05:00
started raising syntax errors for parens wrapped around expressions (they used to silently be ignored)
This commit is contained in:
parent
b58102c514
commit
7c132d65dc
4 changed files with 17 additions and 8 deletions
|
@ -125,13 +125,13 @@ Usage:
|
|||
end
|
||||
|
||||
# Compile a single source file to JavaScript.
|
||||
def compile(script, source='')
|
||||
def compile(script, source='error')
|
||||
begin
|
||||
options = {}
|
||||
options[:no_wrap] = true if @options[:no_wrap]
|
||||
CoffeeScript.compile(script, options)
|
||||
rescue CoffeeScript::ParseError => e
|
||||
STDERR.puts e.message(source)
|
||||
rescue CoffeeScript::ParseError, SyntaxError => e
|
||||
STDERR.puts "#{source}: #{e.message}"
|
||||
exit(1) unless @options[:watch]
|
||||
nil
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue