Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

xjst

Package Overview
Dependencies
Maintainers
3
Versions
162
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

xjst - npm Package Compare versions

Comparing version 1.3.8 to 1.4.0

43

lib/xjst/compiler/base.js

@@ -58,2 +58,8 @@ var esprima = require('esprima'),

}
this.globalInit = {};
if (this.options.globalInit) {
Object.keys(this.options.globalInit).forEach(function(name) {
return this.globalInit['$$' + name] = this.options.globalInit[name];
}, this);
}

@@ -903,3 +909,3 @@ this.program = null;

callee: { type: 'Identifier', name: 'applyc' },
arguments: [applyContext, this.ref]
arguments: [{ type: 'Identifier', name: 'ctx' }, this.ref]
}

@@ -925,3 +931,3 @@ }]

},
right: applyContext
right: { type: 'Identifier', name: 'ctx' }
}

@@ -1042,2 +1048,3 @@ }, {

var globals = this.globals;
var globalInit = this.globalInit;
var globalKeys = Object.keys(globals);

@@ -1049,2 +1056,21 @@ if (globalKeys.length !== 0) {

declarations: globalKeys.map(function(name) {
// Initialize globals from the context if asked
if (globalInit[name]) {
apply.body.body.unshift({
type: 'ExpressionStatement',
expression: {
type: 'AssignmentExpression',
operator: '=',
left: { type: 'Identifier', name: name },
right: {
type: 'MemberExpression',
computed: true,
object: { type: 'Identifier', name: 'ctx' },
property: { type: 'Literal', value: globalInit[name] }
}
}
});
}
// Declare globals
return {

@@ -1055,6 +1081,17 @@ type: 'VariableDeclarator',

};
})
}, this)
});
}
// ctx = ctx || this
apply.body.body.unshift({
type: 'ExpressionStatement',
expression: {
type: 'AssignmentExpression',
operator: '=',
left: { type: 'Identifier', name: 'ctx' },
right: applyContext
}
});
/// Apply to the bottom

@@ -1061,0 +1098,0 @@ if (out.apply) applyBody = applyBody.concat(out.apply);

2

package.json
{
"name": "xjst",
"description": "XSLT inspired JavaScript templates (with spices)",
"version": "1.3.8",
"version": "1.4.0",
"homepage": "http://github.com/veged/xjst",

@@ -6,0 +6,0 @@ "author": "Sergey Berezhnoy <veged@mail.ru> (http://github.com/veged)",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc