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

Replace fnid with loop for legacy testing

pull/731/head
Andrew Leedham 6 лет назад
Родитель
Сommit
259c22bb3f
1 измененных файлов: 8 добавлений и 4 удалений
  1. +8
    -4
      test/parse-test.js

+ 8
- 4
test/parse-test.js Просмотреть файл

@@ -185,10 +185,14 @@ describe('Mustache.parse', function () {
this._cache.push([key, value]); this._cache.push([key, value]);
}, },
get: function get (key) { get: function get (key) {
var entry = this._cache.find(function (item) {
return item[0] === key;
});
return entry && entry[1];
var cacheLength = this._cache.length;
for (var i = 0; i < cacheLength; i++) {
var entry = this._cache[i];
if (entry[0] === key) {
return entry[1];
}
}
return undefined;
}, },
clear: function clear () { clear: function clear () {
this._cache = []; this._cache = [];


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