edge.js
Advanced tools
Comparing version 3.0.0 to 3.0.1
@@ -88,2 +88,3 @@ "use strict"; | ||
if (extendedNode.children.length && edge_lexer_1.utils.isTag(extendedNode.children[0], 'super')) { | ||
extendedNode.children.shift(); | ||
extendedNode.children = node.children.concat(extendedNode.children); | ||
@@ -90,0 +91,0 @@ } |
@@ -113,2 +113,5 @@ /** | ||
compiler: CompilerContract; | ||
GLOBALS: { | ||
[key: string]: any; | ||
}; | ||
registerTag(tag: TagContract): this; | ||
@@ -115,0 +118,0 @@ registerTemplate(templatePath: string, contents: LoaderTemplate): this; |
@@ -11,3 +11,5 @@ import { Compiler } from '../Compiler'; | ||
*/ | ||
private globals; | ||
GLOBALS: { | ||
[key: string]: any; | ||
}; | ||
/** | ||
@@ -14,0 +16,0 @@ * List of registered tags. Adding new tags will only impact |
@@ -32,3 +32,3 @@ "use strict"; | ||
*/ | ||
this.globals = {}; | ||
this.GLOBALS = {}; | ||
/** | ||
@@ -90,3 +90,3 @@ * List of registered tags. Adding new tags will only impact | ||
global(name, value) { | ||
this.globals[name] = value; | ||
this.GLOBALS[name] = value; | ||
return this; | ||
@@ -154,3 +154,3 @@ } | ||
getRenderer() { | ||
return new Renderer_1.EdgeRenderer(this.compiler, this.globals); | ||
return new Renderer_1.EdgeRenderer(this.compiler, this.GLOBALS); | ||
} | ||
@@ -157,0 +157,0 @@ /** |
@@ -11,2 +11,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const edge_error_1 = require("edge-error"); | ||
/** | ||
@@ -23,6 +24,9 @@ * Super tag is used inside sections to inherit the parent section | ||
tagName: 'super', | ||
compile() { | ||
// The super tag is handled by the compiler itself. I am just a way to | ||
// tell lexer to parse me as an inline node | ||
compile(_, __, token) { | ||
throw new edge_error_1.EdgeError('@super tag must appear as top level tag inside the @section tag', 'E_ORPHAN_SUPER_TAG', { | ||
line: token.loc.start.line, | ||
col: token.loc.start.col, | ||
filename: token.filename, | ||
}); | ||
}, | ||
}; |
{ | ||
"name": "edge.js", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"description": "Template engine", | ||
@@ -5,0 +5,0 @@ "main": "build/index.js", |
106303
2978