vendor/lib/visitor/evaluator.js in stylus-source-0.19.5 vs vendor/lib/visitor/evaluator.js in stylus-source-0.19.6
- old
+ new
@@ -304,11 +304,11 @@
this.calling.push(call.name);
// Massive stack
if (this.calling.length > 200) {
- throw new RangeError('Maximum call stack size exceeded');
+ throw new RangeError('Maximum stylus call stack size exceeded');
}
// First node in expression
if ('expression' == fn.nodeName) fn = fn.first;
@@ -675,11 +675,10 @@
var block = new nodes.Block(fn.block.parent);
fn.block.parent = block;
// Clone the function body
// to prevent mutation of subsequent calls
- // inject argument scope
var body = fn.block.clone();
// mixin block
var mixinBlock = this.stack.currentFrame.block;
@@ -1063,16 +1062,19 @@
// name
expr.push(new nodes.String(prop.name));
// replace cyclic call with __CALL__
- val.nodes = val.nodes.map(function(node){
+ function replace(node) {
if ('call' == node.nodeName && name == node.name) {
return new nodes.Literal('__CALL__');
}
+
+ if (node.nodes) node.nodes = node.nodes.map(replace);
return node;
- });
+ }
+ replace(val);
expr.push(val);
return expr;
};
/**