Skip to content

Commit

Permalink
correct error message for unclosed tag
Browse files Browse the repository at this point in the history
  • Loading branch information
kbrsh committed Apr 26, 2018
1 parent c621cce commit adde9e4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/compiler/parser.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { error } from "../util/util.js";
import { error } from "../util/util";

const WHITESPACE_RE = /\s/;

Expand Down Expand Up @@ -53,8 +53,9 @@ const parseClosingTag = (index, input, length, stack) => {
}
}

if (type !== stack.pop().type && process.env.MOON_ENV === "development") {
error(`Unclosed tag "${type}"`);
const lastElement = stack.pop();
if (type !== lastElement.type && process.env.MOON_ENV === "development") {
error(`Unclosed tag "${lastElement.type}", expected "${type}"`);
}

return index;
Expand Down

0 comments on commit adde9e4

Please sign in to comment.