Skip to content

Commit

Permalink
throw inside the if
Browse files Browse the repository at this point in the history
  • Loading branch information
mjackson committed Aug 14, 2012
1 parent 2a51eef commit 52c7e43
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions mustache.js
Original file line number Diff line number Diff line change
Expand Up @@ -376,14 +376,14 @@ var Mustache;
}

function escapeTags(tags) {
if (tags.length === 2) {
return [
new RegExp(escapeRe(tags[0]) + "\\s*"),
new RegExp("\\s*" + escapeRe(tags[1]))
];
if (tags.length !== 2) {
throw new Error("Invalid tags: " + tags.join(" "));
}

throw new Error("Invalid tags: " + tags.join(" "));
return [
new RegExp(escapeRe(tags[0]) + "\\s*"),
new RegExp("\\s*" + escapeRe(tags[1]))
];
}

/**
Expand Down

0 comments on commit 52c7e43

Please sign in to comment.