mirror of
https://github.com/marko-js/marko.git
synced 2025-12-08 19:26:05 +00:00
Renamed "helpers" arg " __helpers"
This commit is contained in:
parent
1bc823dfd6
commit
b48c2ff030
@ -190,7 +190,7 @@ Node.prototype = {
|
|||||||
if (escapeXml !== false) {
|
if (escapeXml !== false) {
|
||||||
methodCall = 'context.captureString(';
|
methodCall = 'context.captureString(';
|
||||||
} else {
|
} else {
|
||||||
methodCall = 'helpers.c(context, ';
|
methodCall = '__helpers.c(context, ';
|
||||||
}
|
}
|
||||||
|
|
||||||
return template.makeExpression({
|
return template.makeExpression({
|
||||||
|
|||||||
@ -79,7 +79,7 @@ CodeWriter.prototype = {
|
|||||||
args = arrayFromArguments(arguments, 1);
|
args = arrayFromArguments(arguments, 1);
|
||||||
|
|
||||||
this.flush();
|
this.flush();
|
||||||
this._code.append(this._indent + 'helpers.' + methodName + '(context');
|
this._code.append(this._indent + '__helpers.' + methodName + '(context');
|
||||||
|
|
||||||
if (args.length) {
|
if (args.length) {
|
||||||
this._code.append(', ');
|
this._code.append(', ');
|
||||||
@ -268,7 +268,7 @@ TemplateBuilder.prototype = {
|
|||||||
if (added) {
|
if (added) {
|
||||||
return added;
|
return added;
|
||||||
} else {
|
} else {
|
||||||
this.addStaticVar(varName, 'helpers.' + propName);
|
this.addStaticVar(varName, '__helpers.' + propName);
|
||||||
this.helperFunctionsAdded[propName] = varName;
|
this.helperFunctionsAdded[propName] = varName;
|
||||||
return varName;
|
return varName;
|
||||||
}
|
}
|
||||||
@ -413,7 +413,7 @@ TemplateBuilder.prototype = {
|
|||||||
} else {
|
} else {
|
||||||
params = ['context'];
|
params = ['context'];
|
||||||
}
|
}
|
||||||
out.append('module.exports = function create(helpers) {\n');
|
out.append('module.exports = function create(__helpers) {\n');
|
||||||
//Write out the static variables
|
//Write out the static variables
|
||||||
this.writer.flush();
|
this.writer.flush();
|
||||||
this._writeVars(this.staticVars, out, INDENT);
|
this._writeVars(this.staticVars, out, INDENT);
|
||||||
|
|||||||
@ -54,7 +54,7 @@ DefNode.prototype = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
template.statement('function ' + func + ' {').indent(function () {
|
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.generateCodeForChildren(template);
|
||||||
}, this).line('});');
|
}, this).line('});');
|
||||||
}, this).line('}');
|
}, this).line('}');
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
module.exports = function create(helpers) {
|
module.exports = function create(__helpers) {
|
||||||
var empty = helpers.e,
|
var empty = __helpers.e,
|
||||||
notEmpty = helpers.ne,
|
notEmpty = __helpers.ne,
|
||||||
hello_renderer = require("./hello-renderer");
|
hello_renderer = require("./hello-renderer");
|
||||||
|
|
||||||
return function render(data, context) {
|
return function render(data, context) {
|
||||||
helpers.t(context,
|
__helpers.t(context,
|
||||||
hello_renderer,
|
hello_renderer,
|
||||||
{
|
{
|
||||||
"name": "World"
|
"name": "World"
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
module.exports = function create(helpers) {
|
module.exports = function create(__helpers) {
|
||||||
var empty = helpers.e,
|
var empty = __helpers.e,
|
||||||
notEmpty = helpers.ne,
|
notEmpty = __helpers.ne,
|
||||||
escapeXmlAttr = helpers.xa,
|
escapeXmlAttr = __helpers.xa,
|
||||||
escapeXml = helpers.x,
|
escapeXml = __helpers.x,
|
||||||
forEach = helpers.f;
|
forEach = __helpers.f;
|
||||||
|
|
||||||
return function render(data, context) {
|
return function render(data, context) {
|
||||||
var rootClass=data.rootClass;
|
var rootClass=data.rootClass;
|
||||||
|
|||||||
@ -1,17 +1,17 @@
|
|||||||
module.exports = function create(helpers) {
|
module.exports = function create(__helpers) {
|
||||||
var empty = helpers.e,
|
var empty = __helpers.e,
|
||||||
notEmpty = helpers.ne,
|
notEmpty = __helpers.ne,
|
||||||
hello_renderer = require("../hello-renderer"),
|
hello_renderer = require("../hello-renderer"),
|
||||||
escapeXmlAttr = helpers.xa,
|
escapeXmlAttr = __helpers.xa,
|
||||||
escapeXml = helpers.x,
|
escapeXml = __helpers.x,
|
||||||
forEach = helpers.f;
|
forEach = __helpers.f;
|
||||||
|
|
||||||
return function render(data, context) {
|
return function render(data, context) {
|
||||||
var rootClass = data.rootClass,
|
var rootClass = data.rootClass,
|
||||||
colors = data.colors,
|
colors = data.colors,
|
||||||
message = data.message;
|
message = data.message;
|
||||||
|
|
||||||
helpers.t(context,
|
__helpers.t(context,
|
||||||
hello_renderer,
|
hello_renderer,
|
||||||
{
|
{
|
||||||
"name": "World"
|
"name": "World"
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
module.exports = function create(helpers) {
|
module.exports = function create(__helpers) {
|
||||||
var empty = helpers.e,
|
var empty = __helpers.e,
|
||||||
notEmpty = helpers.ne;
|
notEmpty = __helpers.ne;
|
||||||
|
|
||||||
return function render(data, context) {
|
return function render(data, context) {
|
||||||
context.w('Hello John');
|
context.w('Hello John');
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user