lib/uglifier.rb in uglifier-2.1.0 vs lib/uglifier.rb in uglifier-2.1.1

- old
+ new

@@ -54,10 +54,11 @@ :screw_ie8 => false # Dotted member access for reserved words } SourcePath = File.expand_path("../uglify.js", __FILE__) ES5FallbackPath = File.expand_path("../es5.js", __FILE__) + SplitFallbackPath = File.expand_path("../split.js", __FILE__) # Minifies JavaScript code using implicit context. # # source should be a String or IO object containing valid JavaScript. # options contain optional overrides to Uglifier::DEFAULTS @@ -83,10 +84,12 @@ def initialize(options = {}) (options.keys - DEFAULTS.keys - [:comments, :squeeze, :copyright])[0..1].each do |missing| raise ArgumentError.new("Invalid option: #{missing}") end @options = options - @context = ExecJS.compile(File.open(ES5FallbackPath, "r:UTF-8").read + File.open(SourcePath, "r:UTF-8").read) + @context = ExecJS.compile(File.open(ES5FallbackPath, "r:UTF-8").read + + File.open(SplitFallbackPath, "r:UTF-8").read + + File.open(SourcePath, "r:UTF-8").read) end # Minifies JavaScript code # # source should be a String or IO object containing valid JavaScript.