diff --git a/compiler/lib/Node.js b/compiler/lib/Node.js index f4bd9a517..9dbc0c9db 100644 --- a/compiler/lib/Node.js +++ b/compiler/lib/Node.js @@ -190,7 +190,7 @@ Node.prototype = { if (escapeXml !== false) { methodCall = 'context.captureString('; } else { - methodCall = 'helpers.c(context, '; + methodCall = '__helpers.c(context, '; } return template.makeExpression({ diff --git a/compiler/lib/TemplateBuilder.js b/compiler/lib/TemplateBuilder.js index 4a7acf7e7..615db9292 100644 --- a/compiler/lib/TemplateBuilder.js +++ b/compiler/lib/TemplateBuilder.js @@ -79,7 +79,7 @@ CodeWriter.prototype = { args = arrayFromArguments(arguments, 1); this.flush(); - this._code.append(this._indent + 'helpers.' + methodName + '(context'); + this._code.append(this._indent + '__helpers.' + methodName + '(context'); if (args.length) { this._code.append(', '); @@ -268,7 +268,7 @@ TemplateBuilder.prototype = { if (added) { return added; } else { - this.addStaticVar(varName, 'helpers.' + propName); + this.addStaticVar(varName, '__helpers.' + propName); this.helperFunctionsAdded[propName] = varName; return varName; } @@ -413,7 +413,7 @@ TemplateBuilder.prototype = { } else { params = ['context']; } - out.append('module.exports = function create(helpers) {\n'); + out.append('module.exports = function create(__helpers) {\n'); //Write out the static variables this.writer.flush(); this._writeVars(this.staticVars, out, INDENT); diff --git a/taglibs/core/DefNode.js b/taglibs/core/DefNode.js index 3e5f16733..f68a1ff6d 100644 --- a/taglibs/core/DefNode.js +++ b/taglibs/core/DefNode.js @@ -54,7 +54,7 @@ DefNode.prototype = { } template.statement('function ' + func + ' {').indent(function () { - template.line('return helpers.c(context, function() {').indent(function () { + template.line('return __helpers.c(context, function() {').indent(function () { this.generateCodeForChildren(template); }, this).line('});'); }, this).line('}'); diff --git a/test/test-project/custom-tag.rhtml.expected.js b/test/test-project/custom-tag.rhtml.expected.js index 52c659a11..8f66e194d 100644 --- a/test/test-project/custom-tag.rhtml.expected.js +++ b/test/test-project/custom-tag.rhtml.expected.js @@ -1,10 +1,10 @@ -module.exports = function create(helpers) { - var empty = helpers.e, - notEmpty = helpers.ne, +module.exports = function create(__helpers) { + var empty = __helpers.e, + notEmpty = __helpers.ne, hello_renderer = require("./hello-renderer"); return function render(data, context) { - helpers.t(context, + __helpers.t(context, hello_renderer, { "name": "World" diff --git a/test/test-project/rhtml-templates/simple.rhtml.js b/test/test-project/rhtml-templates/simple.rhtml.js index 5916d4ccf..61893af3b 100644 --- a/test/test-project/rhtml-templates/simple.rhtml.js +++ b/test/test-project/rhtml-templates/simple.rhtml.js @@ -1,9 +1,9 @@ -module.exports = function create(helpers) { - var empty = helpers.e, - notEmpty = helpers.ne, - escapeXmlAttr = helpers.xa, - escapeXml = helpers.x, - forEach = helpers.f; +module.exports = function create(__helpers) { + var empty = __helpers.e, + notEmpty = __helpers.ne, + escapeXmlAttr = __helpers.xa, + escapeXml = __helpers.x, + forEach = __helpers.f; return function render(data, context) { var rootClass=data.rootClass; diff --git a/test/test-project/rxml-templates/simple.rxml.js b/test/test-project/rxml-templates/simple.rxml.js index 105528774..d030bf5ca 100644 --- a/test/test-project/rxml-templates/simple.rxml.js +++ b/test/test-project/rxml-templates/simple.rxml.js @@ -1,17 +1,17 @@ -module.exports = function create(helpers) { - var empty = helpers.e, - notEmpty = helpers.ne, +module.exports = function create(__helpers) { + var empty = __helpers.e, + notEmpty = __helpers.ne, hello_renderer = require("../hello-renderer"), - escapeXmlAttr = helpers.xa, - escapeXml = helpers.x, - forEach = helpers.f; + escapeXmlAttr = __helpers.xa, + escapeXml = __helpers.x, + forEach = __helpers.f; return function render(data, context) { var rootClass = data.rootClass, colors = data.colors, message = data.message; - helpers.t(context, + __helpers.t(context, hello_renderer, { "name": "World" diff --git a/test/test-project/simple.rhtml.expected.js b/test/test-project/simple.rhtml.expected.js index d8160db56..acd884784 100644 --- a/test/test-project/simple.rhtml.expected.js +++ b/test/test-project/simple.rhtml.expected.js @@ -1,6 +1,6 @@ -module.exports = function create(helpers) { - var empty = helpers.e, - notEmpty = helpers.ne; +module.exports = function create(__helpers) { + var empty = __helpers.e, + notEmpty = __helpers.ne; return function render(data, context) { context.w('Hello John');