Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 3 commits
  • 2 files changed
  • 0 comments
  • 2 contributors

Showing 2 changed files with 5 additions and 5 deletions. Show diff stats Hide diff stats

  1. +1 1  Gemfile
  2. +4 4 lib/uglifier.rb
2  Gemfile
... ... @@ -1,7 +1,7 @@
1 1 source "http://rubygems.org"
2 2
3 3 gem "execjs", ">=0.3.0"
4   -gem "multi_json", ">= 1.0.2"
  4 +gem "multi_json", "~> 1.3"
5 5
6 6 # Depend on defined ExecJS runtime
7 7 execjs_runtimes = {
8 lib/uglifier.rb
@@ -61,7 +61,7 @@ def compile(source)
61 61
62 62 js = []
63 63 js << "var result = '';"
64   - js << "var source = #{MultiJson.encode(source)};"
  64 + js << "var source = #{MultiJson.dump(source)};"
65 65 js << "var ast = UglifyJS.parser.parse(source);"
66 66
67 67 if @options[:lift_vars]
@@ -79,18 +79,18 @@ def compile(source)
79 79 end
80 80
81 81 if @options[:mangle]
82   - js << "ast = UglifyJS.uglify.ast_mangle(ast, #{MultiJson.encode(mangle_options)});"
  82 + js << "ast = UglifyJS.uglify.ast_mangle(ast, #{MultiJson.dump(mangle_options)});"
83 83 end
84 84
85 85 if @options[:squeeze]
86   - js << "ast = UglifyJS.uglify.ast_squeeze(ast, #{MultiJson.encode(squeeze_options)});"
  86 + js << "ast = UglifyJS.uglify.ast_squeeze(ast, #{MultiJson.dump(squeeze_options)});"
87 87 end
88 88
89 89 if @options[:unsafe]
90 90 js << "ast = UglifyJS.uglify.ast_squeeze_more(ast);"
91 91 end
92 92
93   - js << "result += UglifyJS.uglify.gen_code(ast, #{MultiJson.encode(gen_code_options)});"
  93 + js << "result += UglifyJS.uglify.gen_code(ast, #{MultiJson.dump(gen_code_options)});"
94 94
95 95 if !@options[:beautify] && @options[:max_line_length]
96 96 js << "result = UglifyJS.uglify.split_lines(result, #{@options[:max_line_length].to_i})"

No commit comments for this range

Something went wrong with that request. Please try again.