Skip to content

Commit cffc2d1

Browse files
committedOct 30, 2013
Use Compiler#source_map() for generating source maps
1 parent 1d694c6 commit cffc2d1

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed
 

‎lib/opal/sprockets/processor.rb

+2-4
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,8 @@ def evaluate(context, locals, &block)
6969
:arity_check => self.class.arity_check_enabled,
7070
:const_missing => self.class.const_missing_enabled,
7171
:dynamic_require_severity => self.class.dynamic_require_severity,
72-
:source_map_enabled => self.class.source_map_enabled,
7372
:irb => self.class.irb_enabled,
7473
:file => context.logical_path,
75-
:source_file => context.pathname.to_s
7674
}
7775

7876
compiler = Opal::Compiler.new
@@ -84,8 +82,8 @@ def evaluate(context, locals, &block)
8482
context.require_asset path
8583
end
8684

87-
if options[:source_map_enabled]
88-
$OPAL_SOURCE_MAPS[context.pathname] = Opal::SourceMap.new(compiler.fragments, source_file_url(context)).to_s
85+
if self.class.source_map_enabled
86+
$OPAL_SOURCE_MAPS[context.pathname] = compiler.source_map(source_file_url(context)).to_s
8987
"#{result}\n//@ sourceMappingURL=#{source_map_url(context)}\n"
9088
else
9189
result

0 commit comments

Comments
 (0)
Please sign in to comment.