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

{{%IMPLICIT-ITERATOR}} should be a no-op

tags/0.5.0-vsc
thegrandpoobah 16 лет назад
Родитель
Сommit
12ce899b83
2 измененных файлов: 11 добавлений и 2 удалений
  1. +1
    -1
      mustache.js
  2. +10
    -1
      test/unit.js

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

@@ -322,7 +322,7 @@ var Mustache = function() {
return _context;
} else {
var iterator = ".";
if(this.pragmas["IMPLICIT-ITERATOR"]) {
if(this.pragmas["IMPLICIT-ITERATOR"] && this.pragmas["IMPLICIT-ITERATOR"].iterator) {
iterator = this.pragmas["IMPLICIT-ITERATOR"].iterator;
}
var ctx = {};


+ 10
- 1
test/unit.js Просмотреть файл

@@ -389,7 +389,7 @@ test("'!' (Comments)", function() {
});

test("'%' (Pragmas)", function() {
expect(2);
expect(3);
// matches array_of_strings_options.html
equals(
@@ -417,6 +417,15 @@ test("'%' (Pragmas)", function() {
} catch (e) {
equals(e.message, 'This implementation of mustache doesn\'t understand the \'I-HAVE-THE-GREATEST-MUSTACHE\' pragma');
}
equals(
Mustache.to_html(
'{{%IMPLICIT-ITERATOR}}{{#dataSet}}{{.}}:{{/dataSet}}',
{ dataSet: [ 'Object 1', 'Object 2', 'Object 3' ] },
{}
),
"Object 1:Object 2:Object 3:"
);
});

test("Empty", function() {


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