Skip to content

Commit

Permalink
Merge pull request #449 from chrisleishman/underscore_underscore
Browse files Browse the repository at this point in the history
Replace internal __ var with __jade
  • Loading branch information
tj committed Dec 23, 2011
2 parents 7d16c73 + 9de38aa commit 3a9602f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions jade.js
Expand Up @@ -173,10 +173,10 @@ Compiler.prototype = {
var debug = this.debug;

if (debug) {
this.buf.push('__.unshift({ lineno: ' + node.line
this.buf.push('__jade.unshift({ lineno: ' + node.line
+ ', filename: ' + (node.filename
? '"' + node.filename + '"'
: '__[0].filename')
: '__jade[0].filename')
+ ' });');
}

Expand All @@ -189,7 +189,7 @@ Compiler.prototype = {

this.visitNode(node);

if (debug) this.buf.push('__.shift();');
if (debug) this.buf.push('__jade.shift();');
},

/**
Expand Down Expand Up @@ -836,11 +836,11 @@ exports.compile = function(str, options){

if (options.compileDebug !== false) {
fn = [
'var __ = [{ lineno: 1, filename: ' + filename + ' }];'
'var __jade = [{ lineno: 1, filename: ' + filename + ' }];'
, 'try {'
, parse(String(str), options || {})
, '} catch (err) {'
, ' rethrow(err, __[0].filename, __[0].lineno);'
, ' rethrow(err, __jade[0].filename, __jade[0].lineno);'
, '}'
].join('\n');
} else {
Expand Down
6 changes: 3 additions & 3 deletions lib/compiler.js
Expand Up @@ -126,10 +126,10 @@ Compiler.prototype = {
var debug = this.debug;

if (debug) {
this.buf.push('__.unshift({ lineno: ' + node.line
this.buf.push('__jade.unshift({ lineno: ' + node.line
+ ', filename: ' + (node.filename
? '"' + node.filename + '"'
: '__[0].filename')
: '__jade[0].filename')
+ ' });');
}

Expand All @@ -142,7 +142,7 @@ Compiler.prototype = {

this.visitNode(node);

if (debug) this.buf.push('__.shift();');
if (debug) this.buf.push('__jade.shift();');
},

/**
Expand Down
6 changes: 3 additions & 3 deletions lib/jade.js
Expand Up @@ -143,11 +143,11 @@ exports.compile = function(str, options){

if (options.compileDebug !== false) {
fn = [
'var __ = [{ lineno: 1, filename: ' + filename + ' }];'
'var __jade = [{ lineno: 1, filename: ' + filename + ' }];'
, 'try {'
, parse(String(str), options || {})
, '} catch (err) {'
, ' rethrow(err, __[0].filename, __[0].lineno);'
, ' rethrow(err, __jade[0].filename, __jade[0].lineno);'
, '}'
].join('\n');
} else {
Expand Down Expand Up @@ -235,4 +235,4 @@ exports.renderFile = function(path, options, fn){
* Express support.
*/

exports.__express = exports.renderFile;
exports.__express = exports.renderFile;

0 comments on commit 3a9602f

Please sign in to comment.