mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-02-18 03:21:20 -05:00
nodes: Value.unfoldSoak -> If.unfoldSoak
This commit is contained in:
26
lib/nodes.js
26
lib/nodes.js
@@ -435,17 +435,8 @@
|
||||
}
|
||||
return null;
|
||||
};
|
||||
Value.unfoldSoak = function(o, parent, name) {
|
||||
var ifn;
|
||||
if (!(ifn = parent[name].unfoldSoak(o))) {
|
||||
return;
|
||||
}
|
||||
parent[name] = ifn.body;
|
||||
ifn.body = new Value(parent);
|
||||
return ifn;
|
||||
};
|
||||
return Value;
|
||||
}).call(this);
|
||||
})();
|
||||
exports.Comment = (function() {
|
||||
Comment = (function() {
|
||||
function Comment(_arg) {
|
||||
@@ -546,7 +537,7 @@
|
||||
call.variable.base = ifn;
|
||||
}
|
||||
}
|
||||
ifn = Value.unfoldSoak(o, call, 'variable');
|
||||
ifn = If.unfoldSoak(o, call, 'variable');
|
||||
}
|
||||
return ifn;
|
||||
};
|
||||
@@ -1001,7 +992,7 @@
|
||||
if (this.variable.isSplice()) {
|
||||
return this.compileSplice(o);
|
||||
}
|
||||
if (ifn = Value.unfoldSoak(o, this, 'variable')) {
|
||||
if (ifn = If.unfoldSoak(o, this, 'variable')) {
|
||||
delete o.top;
|
||||
return ifn.compile(o);
|
||||
}
|
||||
@@ -1899,8 +1890,17 @@
|
||||
If.prototype.unfoldSoak = function() {
|
||||
return this.soakNode && this;
|
||||
};
|
||||
If.unfoldSoak = function(o, parent, name) {
|
||||
var ifn;
|
||||
if (!(ifn = parent[name].unfoldSoak(o))) {
|
||||
return;
|
||||
}
|
||||
parent[name] = ifn.body;
|
||||
ifn.body = new Value(parent);
|
||||
return ifn;
|
||||
};
|
||||
return If;
|
||||
})();
|
||||
}).call(this);
|
||||
Push = {
|
||||
wrap: function(name, expressions) {
|
||||
if (expressions.empty() || expressions.containsPureStatement()) {
|
||||
|
||||
Reference in New Issue
Block a user