mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-05-03 03:00:14 -04:00
Cleaning up.
This commit is contained in:
@@ -1462,7 +1462,7 @@
|
||||
this.index = _b[1];
|
||||
}
|
||||
this.pattern = this.name instanceof ValueNode;
|
||||
if (this.index instanceof ObjectNode) {
|
||||
if (this.index instanceof ValueNode) {
|
||||
throw new Error('index cannot be a pattern matching expression');
|
||||
}
|
||||
this.children = compact([this.body, this.source, this.filter]);
|
||||
@@ -1520,13 +1520,12 @@
|
||||
svar = scope.free_variable();
|
||||
index_var = null;
|
||||
source_part = ("" + svar + " = " + (this.source.compile(o)) + ";\n" + this.tab);
|
||||
if (name && !this.pattern) {
|
||||
var_part = ("" + body_dent + name + " = " + svar + "[" + ivar + "];\n");
|
||||
}
|
||||
if (this.pattern) {
|
||||
o.indent = this.idt(1);
|
||||
o.top = true;
|
||||
var_part = new AssignNode(this.name, literal(("" + svar + "[" + ivar + "]"))).compile(o) + "\n";
|
||||
} else if (name) {
|
||||
var_part = ("" + body_dent + name + " = " + svar + "[" + ivar + "];\n");
|
||||
}
|
||||
if (!this.object) {
|
||||
lvar = scope.free_variable();
|
||||
|
||||
Reference in New Issue
Block a user