hydrolysis
Advanced tools
Comparing version 1.20.3 to 1.21.0
@@ -185,4 +185,8 @@ /** | ||
* of redundant data. | ||
* @property {string=} resolver `xhr` to use XMLHttpRequest, `fs` to use the | ||
* local filesystem. Default is `fs` in node and `xhr` in the browser. | ||
* @property {string=} resolver. | ||
* `xhr` to use XMLHttpRequest | ||
* `fs` to use the local filesystem. | ||
* `permissive` to use the local filesystem and return empty files when a | ||
* path can't be found. | ||
* Default is `fs` in node and `xhr` in the browser. | ||
* @property {function(string): boolean} filter A predicate function that | ||
@@ -223,2 +227,4 @@ * indicates which files should be ignored by the loader. By default all | ||
PrimaryResolver = require('./loader/xhr-resolver'); | ||
} else if (resolver === 'permissive') { | ||
PrimaryResolver = require('./loader/error-swallowing-fs-resolver'); | ||
} else { | ||
@@ -225,0 +231,0 @@ throw new Error("Resolver must be one of 'fs' or 'xhr'"); |
@@ -19,2 +19,3 @@ /** | ||
var astValue = require('./ast-value.js'); | ||
var declarationPropertyHandlers = require('./declaration-property-handlers'); | ||
@@ -26,17 +27,5 @@ module.exports = function behaviorFinder() { | ||
var currentBehavior = null; | ||
var propertyHandlers = null; | ||
/** | ||
* special-case properties | ||
*/ | ||
var propertyHandlers = { | ||
properties: function(node) { | ||
var props = analyzeProperties(node); | ||
for (var i=0; i < props.length; i++) { | ||
currentBehavior.properties.push(props[i]); | ||
} | ||
} | ||
}; | ||
/** | ||
* merges behavior with preexisting behavior with the same name. | ||
@@ -165,2 +154,3 @@ * here to support multiple @polymerBehavior tags referring | ||
}; | ||
propertyHandlers = declarationPropertyHandlers(currentBehavior); | ||
@@ -172,2 +162,3 @@ docs.annotateBehavior(currentBehavior); | ||
currentBehavior = null; | ||
propertyHandlers = null; | ||
return; | ||
@@ -189,2 +180,3 @@ } | ||
currentBehavior = mergeBehavior(currentBehavior); | ||
propertyHandlers = declarationPropertyHandlers(currentBehavior); | ||
@@ -199,2 +191,3 @@ // Some behaviors are just lists of other behaviors. If this is one then | ||
currentBehavior = null; | ||
propertyHandlers = null; | ||
} | ||
@@ -201,0 +194,0 @@ }, |
@@ -18,2 +18,3 @@ /** | ||
var astValue = require('./ast-value'); | ||
var declarationPropertyHandlers = require('./declaration-property-handlers'); | ||
@@ -29,51 +30,5 @@ var elementFinder = function elementFinder() { | ||
*/ | ||
var element; | ||
var element = null; | ||
var propertyHandlers = null; | ||
/** | ||
* a set of special case properties. these should only be called | ||
* when we know we're inside an element definition. | ||
* @type {Object} | ||
*/ | ||
var propertyHandlers = { | ||
is: function(node) { | ||
if (node.type == 'Literal') { | ||
element.is = node.value; | ||
} | ||
}, | ||
properties: function(node) { | ||
var props = analyzeProperties(node); | ||
for (var i=0; i<props.length; i++) { | ||
element.properties.push(props[i]); | ||
} | ||
}, | ||
behaviors: function(node) { | ||
if (node.type != 'ArrayExpression') { | ||
return; | ||
} | ||
for (var i=0; i<node.elements.length; i++) { | ||
var v = astValue.expressionToValue(node.elements[i]); | ||
if (v === undefined) | ||
v = astValue.CANT_CONVERT; | ||
element.behaviors.push(v); | ||
} | ||
}, | ||
observers: function(node) { | ||
if (node.type != 'ArrayExpression') { | ||
return; | ||
} | ||
for (var i=0; i<node.elements.length; i++) { | ||
var v = astValue.expressionToValue(node.elements[i]); | ||
if (v === undefined) | ||
v = astValue.CANT_CONVERT; | ||
element.observers.push({ | ||
javascriptNode: node.elements[i], | ||
expression: v | ||
}); | ||
} | ||
} | ||
}; | ||
var visitors = { | ||
@@ -92,2 +47,3 @@ enterCallExpression: function enterCallExpression(node, parent) { | ||
}; | ||
propertyHandlers = declarationPropertyHandlers(element); | ||
} | ||
@@ -102,3 +58,4 @@ } | ||
elements.push(element); | ||
element = undefined; | ||
element = null; | ||
propertyHandlers = null; | ||
} | ||
@@ -105,0 +62,0 @@ } |
{ | ||
"name": "hydrolysis", | ||
"version": "1.20.3", | ||
"version": "1.21.0", | ||
"description": "Breaks polymers into monomers", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/Polymer/hydrolysis", |
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
98222
24
2854