Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change default ie8 support to false #141

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/uglifier.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class Error < StandardError; end
:define => {}, # Define values for symbol replacement
:keep_fnames => false, # Generate code safe for the poor souls relying on Function.prototype.name at run-time. Sets both compress and mangle keep_fanems to true.
:toplevel => false,
:ie8 => true, # Generate safe code for IE8
:ie8 => false, # Generate safe code for IE8
:source_map => false, # Generate source map
:harmony => false # Enable ES6/Harmony mode (experimental). Disabling mangling and compressing is recommended with Harmony mode.
}
Expand Down
10 changes: 7 additions & 3 deletions spec/uglifier_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,12 @@
describe "ie8 option" do
let(:code) { "function something() { return g.switch; }" }

it "defaults to IE8-safe output" do
expect(Uglifier.compile(code)).to match("\"switch\"")
it "defaults to non-IE8-safe output" do
expect(Uglifier.compile(code)).to match(/g\.switch/)
end

it "handles IE8-safe output" do
expect(Uglifier.compile(code, :ie8 => true)).to match("\"switch\"")
end

it "forwards ie8 option to UglifyJS" do
Expand Down Expand Up @@ -324,7 +328,7 @@

it "quotes unsafe keys by default" do
code = 'var code = {"class": "", "\u200c":"A"}'
expect(Uglifier.compile(code)).to include('"class"')
expect(Uglifier.compile(code)).to include('class')
expect(Uglifier.compile(code)).to include('"\u200c"')

uglifier = Uglifier.new(:output => { :ascii_only => false, :quote_keys => false })
Expand Down