Skip to content

Commit

Permalink
throw error if no closing delimiter for template is given
Browse files Browse the repository at this point in the history
  • Loading branch information
kbrsh committed Apr 3, 2017
1 parent 612527a commit 530e142
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
16 changes: 16 additions & 0 deletions dist/moon.js
Original file line number Diff line number Diff line change
Expand Up @@ -817,16 +817,32 @@
var template = state.template;
var length = template.length;
while (state.current < length) {
// Match Text Between Templates
var value = scanTemplateStateUntil(state, openRE);

if (value) {
state.output += value;
}

// If we've reached the end, there are no more templates
if (state.current === length) {
break;
}

// Exit The Opening Tag
state.current += 2;

// Get the name of the opening tag
var name = scanTemplateStateUntil(state, closeRE);

// If we've reached the end, the tag was unclosed
if (state.current === length) {
if ("development" !== "production") {
error('Expected closing delimiter "}}" after "' + name + '"');
}
break;
}

if (name) {
var modifiers = "";
var modifierIndex = null;
Expand Down
Loading

0 comments on commit 530e142

Please sign in to comment.