Skip to content

Commit

Permalink
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/opal/compiler.rb
Original file line number Diff line number Diff line change
@@ -78,22 +78,22 @@ def compile(source, options = {})
@result = @fragments.map(&:code).join('')
end

def source_map
Opal::SourceMap.new(@fragments, '(file)')
def source_map(source_file = nil)
Opal::SourceMap.new(@fragments, source_file || self.file)
end

# This is called when a parsing/processing error occurs. This
# method simply appends the filename and curent line number onto
# the message and raises it.
def error(msg)
raise SyntaxError, "#{msg} :#{@file}:#{@line}"
raise SyntaxError, "#{msg} :#{file}:#{@line}"
end

# This is called when a parsing/processing warning occurs. This
# method simply appends the filename and curent line number onto
# the message and issues a warning.
def warning(msg)
warn "#{msg} :#{@file}:#{@line}"
warn "#{msg} :#{file}:#{@line}"
end

# Instances of `Scope` can use this to determine the current

0 comments on commit 33d698c

Please sign in to comment.