From d60d82ddc5a8a41095927e9c42aeba0c3ca3d7d2 Mon Sep 17 00:00:00 2001 From: Patrick Steele-Idem Date: Sat, 6 Feb 2016 18:17:27 -0700 Subject: [PATCH] Marko v3: Expose convenience method for getting a reference to the escapeXmlAttr helper --- compiler/CodeGenerator.js | 4 ++++ compiler/CompileContext.js | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/compiler/CodeGenerator.js b/compiler/CodeGenerator.js index eeaaa0e7e..330cbc66c 100644 --- a/compiler/CodeGenerator.js +++ b/compiler/CodeGenerator.js @@ -146,6 +146,10 @@ class Generator { this.context.addStaticCode(code); } + getEscapeXmlAttrVar() { + return this.context.getEscapeXmlAttrVar(); + } + importModule(varName, path) { return this.context.importModule(varName, path); } diff --git a/compiler/CompileContext.js b/compiler/CompileContext.js index 54ac92b33..b345c2e1b 100644 --- a/compiler/CompileContext.js +++ b/compiler/CompileContext.js @@ -168,6 +168,10 @@ class CompileContext { return this._staticCode; } + getEscapeXmlAttrVar() { + return this.addStaticVar('escapeXmlAttr', '__helpers.xa'); + } + getTagDef(tagName) { var taglibLookup = this.taglibLookup;