Skip to content

Commit

Permalink
Revert "Merge pull request janl#643 from raymond-lam/issue617"
Browse files Browse the repository at this point in the history
This reverts commit b283da5, reversing
changes made to 23beb3a.
  • Loading branch information
neocotic committed Nov 14, 2017
1 parent b283da5 commit d517e10
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 33 deletions.
2 changes: 1 addition & 1 deletion mustache.js
Expand Up @@ -447,7 +447,7 @@
var tokens = cache[template];

if (tokens == null)
tokens = cache[template + ':' + (tags || mustache.tags).join(':')] = parseTemplate(template, tags);
tokens = cache[template] = parseTemplate(template, tags);

return tokens;
};
Expand Down
32 changes: 0 additions & 32 deletions test/parse-test.js
Expand Up @@ -103,36 +103,4 @@ describe('Mustache.parse', function () {
});
});

describe('when parsing a template without tags specified followed by the same template with tags specified', function() {
it('returns different tokens for the latter parse', function() {
var template = "{{foo}}[bar]";
var parsedWithBraces = Mustache.parse(template);
var parsedWithBrackets = Mustache.parse(template, ['[', ']']);
assert.notDeepEqual(parsedWithBrackets, parsedWithBraces);
});
});

describe('when parsing a template with tags specified followed by the same template with different tags specified', function() {
it('returns different tokens for the latter parse', function() {
var template = "(foo)[bar]";
var parsedWithParens = Mustache.parse(template, ['(', ')']);
var parsedWithBrackets = Mustache.parse(template, ['[', ']']);
assert.notDeepEqual(parsedWithBrackets, parsedWithParens);
});
});

describe('when parsing a template after already having parsed that template with a different Mustache.tags', function() {
it('returns different tokens for the latter parse', function() {
var template = "{{foo}}[bar]";
var parsedWithBraces = Mustache.parse(template);

var oldTags = Mustache.tags;
Mustache.tags = ['[', ']'];
var parsedWithBrackets = Mustache.parse(template);
Mustache.tags = oldTags;

assert.notDeepEqual(parsedWithBrackets, parsedWithBraces);
});
});

});

0 comments on commit d517e10

Please sign in to comment.