瀏覽代碼

globals helpers

pull/776/head
Mejia1994 5 年之前
父節點
當前提交
3da8cc4205
共有 1 個檔案被更改,包括 3 行新增3 行删除
  1. +3
    -3
      mustache.js

+ 3
- 3
mustache.js 查看文件

@@ -703,7 +703,7 @@ Writer.prototype.invokeGlobalHelper = function invokeGlobalHelper (token, contex
return view = view[arg[0]];
}(argsHelper.split(/\.+/g).reverse());

return mustache.escape(mustache.helpers.get(helperName)(value));
return mustache.escape(mustache.helpers[helperName](value));
};

Writer.prototype.getConfigTags = function getConfigTags (config) {
@@ -728,7 +728,7 @@ Writer.prototype.getConfigEscape = function getConfigEscape (config) {
};

var mustache = {
helpers: new Map(),
helpers: {},
name: 'mustache.js',
version: '4.2.0',
tags: [ '{{', '}}' ],
@@ -786,7 +786,7 @@ mustache.globalHelper = function globalHelper (name, helper) {
return false;
}

mustache.helpers.set(name, helper);
mustache.helpers[name] = helper;
};

/**


Loading…
取消
儲存