From 0d6386198a7e4c488409b57b713fa35ce12e44b2 Mon Sep 17 00:00:00 2001 From: Patrick Steele-Idem Date: Mon, 18 Jan 2016 20:13:56 -0700 Subject: [PATCH] Marko v3: Proper error message for unmatched nested tag --- compiler/ast/CustomTag.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/compiler/ast/CustomTag.js b/compiler/ast/CustomTag.js index a78ca2bb4..e9374f526 100644 --- a/compiler/ast/CustomTag.js +++ b/compiler/ast/CustomTag.js @@ -127,6 +127,10 @@ class CustomTag extends HtmlElement { if (isNestedTag) { let parentTagNode = getNestedTagParentNode(this, parentTagName); + if (!parentTagNode) { + codegen.addError('Invalid usage of the <' + this.tagName + '> nested tag. Tag not nested within a <' + parentTagName + '> tag.'); + return; + } parentTagVar = parentTagNode.data.nestedTagVar; }