Skip to content
Showing with 22 additions and 1 deletion.
  1. +22 −1 lib/jade.js
View
23 lib/jade.js
@@ -704,6 +704,17 @@ function interpolate(str){
});
}
+/**
+ * Re-throw the given `err` in context to the
+ * `str` of jade, `filename`, and `lineno`.
+ *
+ * @param {Error} err
+ * @param {String} str
+ * @param {String} filename
+ * @param {String} lineno
+ * @api private
+ */
+
function rethrow(err, str, filename, lineno){
var start = lineno - 3 > 0
? lineno - 3
@@ -720,6 +731,15 @@ function rethrow(err, str, filename, lineno){
throw err;
}
+/**
+ * Parse the given `str` of jade and return a `Function`.
+ *
+ * @param {String} str
+ * @param {Object} options
+ * @return {Function}
+ * @api private
+ */
+
function parse(str, options){
var filename = options.filename;
try {
@@ -762,7 +782,7 @@ exports.render = function(str, options){
options = options || {},
filename = options.filename;
- // Cache templates
+ // Cache support
if (options.cache) {
if (filename) {
if (cache[filename]) {
@@ -777,6 +797,7 @@ exports.render = function(str, options){
fn = parse(str, options);
}
+ // Render the template
try {
options.locals = options.locals || {};
options.locals.sys = sys;

0 comments on commit 79bc2e8

Please sign in to comment.
Something went wrong with that request. Please try again.