Skip to content
Browse files

Merge pull request #65 from gavacho/fix-ie8-and-9

Avoid triggering IE's "conditional compilation" feature with sourceURLs
  • Loading branch information...
2 parents fd8d838 + 4e447d3 commit c7c018af04a1b7be42fd447eebf23746e0f63855 @hjr3 hjr3 committed Apr 15, 2013
Showing with 3 additions and 3 deletions.
  1. +1 −1 lib/rake-pipeline-web-filters/minispade_filter.rb
  2. +2 −2 spec/minispade_filter_spec.rb
View
2 lib/rake-pipeline-web-filters/minispade_filter.rb
@@ -51,7 +51,7 @@ def generate_output(inputs, output)
module_id = @module_id_generator.call(input)
if @string_module
- contents = %{(function() {#{code}\n})();\n//@ sourceURL=#{module_id}}.to_json
+ contents = %{(function() {#{code}\n})();\n/*@if (@_jscript) @else @*/\n//@ sourceURL=#{module_id}\n/*@end@*/}.to_json
else
contents = "function() {#{code}\n}"
end
View
4 spec/minispade_filter_spec.rb
@@ -47,7 +47,7 @@ def make_filter(input_file, *args)
it "compiles a string if asked" do
filter = make_filter(input_file, :string => true)
output_file.body.should ==
- %{minispade.register('/path/to/input/foo.js', "(function() {var foo = 'bar'; // last-line comment\\n})();\\n//@ sourceURL=/path/to/input/foo.js");}
+ %{minispade.register('/path/to/input/foo.js', "(function() {var foo = 'bar'; // last-line comment\\n})();\\n/*@if (@_jscript) @else @*/\\n//@ sourceURL=/path/to/input/foo.js\\n/*@end@*/");}
end
it "takes a proc to name the module" do
@@ -67,7 +67,7 @@ def make_filter(input_file, *args)
output_file.body.should ==
"minispade.register('/path/to/input/foo.js', function() {minispade.require('octopus');\n});"
end
-
+
it "rewrites requireAll if asked" do
filter = make_filter(input_file("requireAll('octopus');"), :rewrite_requires => true)
output_file.body.should ==

0 comments on commit c7c018a

Please sign in to comment.
Something went wrong with that request. Please try again.