Comparing version 0.11.0 to 0.11.1
@@ -212,20 +212,22 @@ var xjst = require('../xjst'), | ||
if (ast._extensions && ast._extensions.length) { | ||
if (ast._extensions) { | ||
body.push('exports.registerExtensions = $$registerExtensions;'); | ||
body.push('function $$registerExtensions(ctx) {'); | ||
ast._extensions.forEach(function(ext) { | ||
var fn = 'function $$registerExtensions(ctx) {'; | ||
fn += ast._extensions.map(function(ext) { | ||
if (/^[a-z$_][a-z0-9$_]*$/gi.test(ext)) | ||
body.push(' ctx.' + ext + ' = undefined;'); | ||
return ' ctx.' + ext + ' = undefined;'; | ||
else | ||
body.push(' ctx[' + JSON.stringify(ext) + '] = undefined;'); | ||
}); | ||
body.push('}'); | ||
return ' ctx[' + JSON.stringify(ext) + '] = undefined;'; | ||
}).join(''); | ||
fn += '}'; | ||
body.unshift(fn); | ||
} | ||
if (ast._applyFlags && ast._applyFlags.length) { | ||
body.push('function $$resetApplyNext(ctx) {'); | ||
ast._applyFlags.forEach(function(flag) { | ||
body.push(' ctx.' + flag + ' = undefined;'); | ||
}); | ||
body.push('}'); | ||
if (ast._applyFlags) { | ||
var fn = 'function $$resetApplyNext(ctx) {'; | ||
fn += ast._applyFlags.map(function(ext) { | ||
return ' ctx.' + ext + ' = undefined;'; | ||
}).join(''); | ||
fn += '}'; | ||
body.unshift(fn); | ||
} | ||
@@ -232,0 +234,0 @@ |
{ | ||
"name": "xjst", | ||
"description": "XSLT inspired JavaScript templates (with spices)", | ||
"version": "0.11.0", | ||
"version": "0.11.1", | ||
"homepage": "http://github.com/veged/xjst", | ||
@@ -6,0 +6,0 @@ "author": "Sergey Berezhnoy <veged@mail.ru> (http://github.com/veged)", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2139
117244