mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-05-03 03:00:14 -04:00
Merge pull request #2299 from geraldalewis/2213-no-method-is-array
Wraps up #2211 -- addresses invocations within destructured params
This commit is contained in:
@@ -1936,15 +1936,19 @@
|
||||
for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
|
||||
obj = _ref2[_i];
|
||||
if (obj instanceof Assign) {
|
||||
names.push(obj.value.base.value);
|
||||
names.push(obj.value.unwrap().value);
|
||||
} else if (obj instanceof Splat) {
|
||||
names.push(obj.name.unwrap().value);
|
||||
} else if (obj.isArray() || obj.isObject()) {
|
||||
names.push.apply(names, this.names(obj.base));
|
||||
} else if (obj["this"]) {
|
||||
names.push.apply(names, atParam(obj));
|
||||
} else if (obj instanceof Value) {
|
||||
if (obj.isArray() || obj.isObject()) {
|
||||
names.push.apply(names, this.names(obj.base));
|
||||
} else if (obj["this"]) {
|
||||
names.push.apply(names, atParam(obj));
|
||||
} else {
|
||||
names.push(obj.base.value);
|
||||
}
|
||||
} else {
|
||||
names.push(obj.base.value);
|
||||
throw SyntaxError("illegal parameter " + (obj.compile()));
|
||||
}
|
||||
}
|
||||
return names;
|
||||
|
||||
Reference in New Issue
Block a user