Просмотр исходного кода

Hit a snafu when in the browser.

with-js-extras
Paul J. Davis 16 лет назад
Родитель
Сommit
10adbaf4fe
1 измененных файлов: 5 добавлений и 2 удалений
  1. +5
    -2
      mustache.js

+ 5
- 2
mustache.js Просмотреть файл

@@ -164,8 +164,11 @@ var Mustache = function() {
while(parts.length) { while(parts.length) {
p = parts.shift(); p = parts.shift();
if(ctx[p] === undefined) { if(ctx[p] === undefined) {
src = context.toSource();
src = src.replace(/^\(|\)$/g, "");
if(typeof(context.toSource) == "function") {
src = context.toSource().replace(/^\(|\)$/g, "");
} else {
src = context.toString();
}
throw({message: "'" + name + "' not found in context: " + src}); throw({message: "'" + name + "' not found in context: " + src});
} }
ctx = ctx[p]; ctx = ctx[p];


Загрузка…
Отмена
Сохранить