Permalink
Browse files

Fixed attrs() in the right file this time

  • Loading branch information...
1 parent ae332f0 commit 300dacbe78330b25706828744696edc1841a6caf @caseywebdev caseywebdev committed Jun 19, 2012
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/runtime.js
View
@@ -28,7 +28,7 @@ if (!Object.keys) {
}
}
return arr;
- }
+ }
}
/**
@@ -111,7 +111,7 @@ exports.attrs = function attrs(obj, escaped){
buf.push(key + "='" + JSON.stringify(val) + "'");
} else if ('class' == key && Array.isArray(val)) {
buf.push(key + '="' + exports.escape(val.join(' ')) + '"');
- } else if (escaped[key]) {
+ } else if (escaped && escaped[key]) {
buf.push(key + '="' + exports.escape(val) + '"');
} else {
buf.push(key + '="' + val + '"');
@@ -155,7 +155,7 @@ exports.rethrow = function rethrow(err, filename, lineno){
, str = require('fs').readFileSync(filename, 'utf8')
, lines = str.split('\n')
, start = Math.max(lineno - context, 0)
- , end = Math.min(lines.length, lineno + context);
+ , end = Math.min(lines.length, lineno + context);
// Error context
var context = lines.slice(start, end).map(function(line, i){
@@ -168,7 +168,7 @@ exports.rethrow = function rethrow(err, filename, lineno){
// Alter exception message
err.path = filename;
- err.message = (filename || 'Jade') + ':' + lineno
+ err.message = (filename || 'Jade') + ':' + lineno
+ '\n' + context + '\n\n' + err.message;
throw err;
};

0 comments on commit 300dacb

Please sign in to comment.