Comparing version 1.5.1 to 1.5.2
var util = require('util'); | ||
var estraverse = require('estraverse'); | ||
var entities = require('./'); | ||
var utils = require('../../utils'); | ||
var Predicate = entities.Predicate; | ||
function GenericBody(compiler) { | ||
@@ -266,7 +267,15 @@ this.id = null; | ||
var prop = keys.reduce(function(left, right, i, l) { | ||
var isName = utils.isName(right), | ||
computed = false, | ||
property = { type: 'Identifier', name: right }; | ||
if (!isName) { | ||
computed = true; | ||
property = { type: 'Literal', value: right } | ||
} | ||
var sub = { | ||
type: 'MemberExpression', | ||
computed: true, | ||
computed: computed, | ||
object: left, | ||
property: { type: 'Literal', value: right } | ||
property: property | ||
}; | ||
@@ -273,0 +282,0 @@ |
@@ -275,1 +275,6 @@ var utils = exports; | ||
}; | ||
utils.isName = function isName(s) { | ||
var re = /^[a-z$_][a-z0-9$_]*$/i; | ||
return re.test(s); | ||
}; |
{ | ||
"name": "xjst", | ||
"description": "XSLT inspired JavaScript templates (with spices)", | ||
"version": "1.5.1", | ||
"version": "1.5.2", | ||
"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
112570
2617