Skip to content

Commit

Permalink
Fixed attrs() in the right file this time
Browse files Browse the repository at this point in the history
  • Loading branch information
caseywebdev committed Jun 19, 2012
1 parent ae332f0 commit 300dacb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/runtime.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ if (!Object.keys) {
} }
} }
return arr; return arr;
} }
} }


/** /**
Expand Down Expand Up @@ -111,7 +111,7 @@ exports.attrs = function attrs(obj, escaped){
buf.push(key + "='" + JSON.stringify(val) + "'"); buf.push(key + "='" + JSON.stringify(val) + "'");
} else if ('class' == key && Array.isArray(val)) { } else if ('class' == key && Array.isArray(val)) {
buf.push(key + '="' + exports.escape(val.join(' ')) + '"'); buf.push(key + '="' + exports.escape(val.join(' ')) + '"');
} else if (escaped[key]) { } else if (escaped && escaped[key]) {
buf.push(key + '="' + exports.escape(val) + '"'); buf.push(key + '="' + exports.escape(val) + '"');
} else { } else {
buf.push(key + '="' + val + '"'); buf.push(key + '="' + val + '"');
Expand Down Expand Up @@ -155,7 +155,7 @@ exports.rethrow = function rethrow(err, filename, lineno){
, str = require('fs').readFileSync(filename, 'utf8') , str = require('fs').readFileSync(filename, 'utf8')
, lines = str.split('\n') , lines = str.split('\n')
, start = Math.max(lineno - context, 0) , start = Math.max(lineno - context, 0)
, end = Math.min(lines.length, lineno + context); , end = Math.min(lines.length, lineno + context);


// Error context // Error context
var context = lines.slice(start, end).map(function(line, i){ var context = lines.slice(start, end).map(function(line, i){
Expand All @@ -168,7 +168,7 @@ exports.rethrow = function rethrow(err, filename, lineno){


// Alter exception message // Alter exception message
err.path = filename; err.path = filename;
err.message = (filename || 'Jade') + ':' + lineno err.message = (filename || 'Jade') + ':' + lineno
+ '\n' + context + '\n\n' + err.message; + '\n' + context + '\n\n' + err.message;
throw err; throw err;
}; };

0 comments on commit 300dacb

Please sign in to comment.