Permalink
Browse files

Merge pull request #471 from 3rd-Eden/patch-2

Allow the compiled client to use it's own attribute, escape and rethrow ...
  • Loading branch information...
2 parents 2ca5abf + 5e4e29c commit 548b8e241522dbc8f4006cbbdd315032d978549f @tj tj committed Jun 22, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/jade.js
View
@@ -121,7 +121,7 @@ function parse(str, options){
* Compile a `Function` representation of the given jade `str`.
*
* Options:
- *
+ *
* - `compileDebug` when `false` debugging code is stripped from the compiled template
* - `client` when `true` the helper functions `escape()` etc will reference `jade.escape()`
* for use with the Jade client-side runtime.js
@@ -154,7 +154,7 @@ exports.compile = function(str, options){
}
if (client) {
- fn = 'var attrs = jade.attrs, escape = jade.escape, rethrow = jade.rethrow, merge = jade.merge;\n' + fn;
+ fn = 'attrs = attrs || jade.attrs; escape = escape || jade.escape; rethrow = rethrow || jade.rethrow; merge = merge || jade.merge;\n' + fn;
}
fn = new Function('locals, attrs, escape, rethrow, merge', fn);

0 comments on commit 548b8e2

Please sign in to comment.