Comparing version 2.0.7 to 2.0.8
@@ -22,2 +22,10 @@ /* | ||
function inheritProps(sub, sup) { | ||
forEachEntry(sup, function (k, v) { | ||
if (!sub[k]) { | ||
sub[k] = v; | ||
} | ||
}); | ||
} | ||
function Taglib(id) { | ||
@@ -89,4 +97,4 @@ ok(id, '"id" expected'); | ||
this.transformers = {}; | ||
this.nestedVariables = {}; | ||
this.importedVariables = {}; | ||
this.nestedVariables = null; | ||
this.importedVariables = null; | ||
this.patternAttributes = []; | ||
@@ -105,9 +113,2 @@ this.bodyFunction = null; | ||
}); | ||
function inheritProps(sub, sup) { | ||
forEachEntry(sup, function (k, v) { | ||
if (!sub[k]) { | ||
sub[k] = v; | ||
} | ||
}); | ||
} | ||
[ | ||
@@ -117,3 +118,4 @@ 'attributes', | ||
'nestedVariables', | ||
'importedVariables' | ||
'importedVariables', | ||
'bodyFunction' | ||
].forEach(function (propName) { | ||
@@ -125,7 +127,13 @@ inheritProps(subTag[propName], superTag[propName]); | ||
forEachVariable: function (callback, thisObj) { | ||
forEachEntry(this.nestedVariables, function (key, variable) { | ||
callback.call(thisObj, variable); | ||
}); | ||
if (!this.nestedVariables) { | ||
return; | ||
} | ||
this.nestedVariables.vars.forEach(callback, thisObj); | ||
}, | ||
forEachImportedVariable: function (callback, thisObj) { | ||
if (!this.importedVariables) { | ||
return; | ||
} | ||
forEachEntry(this.importedVariables, function (key, importedVariable) { | ||
@@ -180,6 +188,15 @@ callback.call(thisObj, importedVariable); | ||
addNestedVariable: function (nestedVariable) { | ||
var key = nestedVariable.nameFromAttribute ? 'attr:' + nestedVariable.nameFromAttribute : nestedVariable.name; | ||
this.nestedVariables[key] = nestedVariable; | ||
if (!this.nestedVariables) { | ||
this.nestedVariables = { | ||
__noMerge: true, | ||
vars: [] | ||
}; | ||
} | ||
this.nestedVariables.vars.push(nestedVariable); | ||
}, | ||
addImportedVariable: function (importedVariable) { | ||
if (!this.importedVariables) { | ||
this.importedVariables = {}; | ||
} | ||
var key = importedVariable.targetProperty; | ||
@@ -195,3 +212,2 @@ this.importedVariables[key] = importedVariable; | ||
this.bodyFunction = { | ||
__noMerge: true, | ||
name: name, | ||
@@ -198,0 +214,0 @@ params: params |
@@ -61,3 +61,3 @@ { | ||
}, | ||
"version": "2.0.7" | ||
"version": "2.0.8" | ||
} |
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
469864
8587
13
22
7
95