Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Updated to latest MultiJson API and avoid deprecation warnings.

  • Loading branch information...
commit 4ca24b225b7da0a6f8c2b144bebeddca825b89d0 1 parent 3a351ce
@inukshuk authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/uglifier.rb
View
8 lib/uglifier.rb
@@ -61,7 +61,7 @@ def compile(source)
js = []
js << "var result = '';"
- js << "var source = #{MultiJson.encode(source)};"
+ js << "var source = #{MultiJson.dump(source)};"
js << "var ast = UglifyJS.parser.parse(source);"
if @options[:lift_vars]
@@ -79,18 +79,18 @@ def compile(source)
end
if @options[:mangle]
- js << "ast = UglifyJS.uglify.ast_mangle(ast, #{MultiJson.encode(mangle_options)});"
+ js << "ast = UglifyJS.uglify.ast_mangle(ast, #{MultiJson.dump(mangle_options)});"
end
if @options[:squeeze]
- js << "ast = UglifyJS.uglify.ast_squeeze(ast, #{MultiJson.encode(squeeze_options)});"
+ js << "ast = UglifyJS.uglify.ast_squeeze(ast, #{MultiJson.dump(squeeze_options)});"
end
if @options[:unsafe]
js << "ast = UglifyJS.uglify.ast_squeeze_more(ast);"
end
- js << "result += UglifyJS.uglify.gen_code(ast, #{MultiJson.encode(gen_code_options)});"
+ js << "result += UglifyJS.uglify.gen_code(ast, #{MultiJson.dump(gen_code_options)});"
if !@options[:beautify] && @options[:max_line_length]
js << "result = UglifyJS.uglify.split_lines(result, #{@options[:max_line_length].to_i})"
Please sign in to comment.
Something went wrong with that request. Please try again.