Commit 51042e98 by Timothée Peignier

Merge pull request #448 from Alexx-G/fix/js_wrapping_output

Fix for wrapping javascript code.
parents 260b127e 6d915d18
...@@ -97,3 +97,4 @@ or just made Pipeline more awesome. ...@@ -97,3 +97,4 @@ or just made Pipeline more awesome.
* Wictor Olseryd <wictor@olseryd.se> * Wictor Olseryd <wictor@olseryd.se>
* Zachary Kazanski <kazanski.zachary@gmail.com> * Zachary Kazanski <kazanski.zachary@gmail.com>
* Zenobius Jiricek <zenobius.jiricek@gmail.com> * Zenobius Jiricek <zenobius.jiricek@gmail.com>
* Alex Gavrișco <alexandr@gavrisco.com>
...@@ -253,7 +253,9 @@ Wrapped javascript output ...@@ -253,7 +253,9 @@ Wrapped javascript output
All javascript output is wrapped in an anonymous function : :: All javascript output is wrapped in an anonymous function : ::
(function(){ ... })(); (function(){
//JS output...
})();
This safety wrapper, make it difficult to pollute the global namespace by accident and improve performance. This safety wrapper, make it difficult to pollute the global namespace by accident and improve performance.
......
...@@ -60,7 +60,7 @@ class Compressor(object): ...@@ -60,7 +60,7 @@ class Compressor(object):
js = js + self.compile_templates(templates) js = js + self.compile_templates(templates)
if not settings.PIPELINE_DISABLE_WRAPPER: if not settings.PIPELINE_DISABLE_WRAPPER:
js = "(function() { %s }).call(this);" % js js = "(function() {\n%s\n}).call(this);" % js
compressor = self.js_compressor compressor = self.js_compressor
if compressor: if compressor:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment