+15
-13
@@ -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 @@ |
+1
-1
| { | ||
| "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)", |
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 5 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 5 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
2139
0.09%117244
-0.01%