mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-05-03 03:00:14 -04:00
Fix #3935: Implicit calls + obj key interpolation
Allow implicit calls when the first key of an implicit object has interpolation.
This commit is contained in:
@@ -1311,7 +1311,7 @@
|
||||
indent += TAB;
|
||||
}
|
||||
if (prop instanceof Assign && prop.variable instanceof Value && prop.variable.hasProperties()) {
|
||||
prop.variable.error('Invalid object key');
|
||||
prop.variable.error('invalid object key');
|
||||
}
|
||||
if (prop instanceof Value && prop["this"]) {
|
||||
prop = new Assign(prop.properties[0].name, prop, 'object');
|
||||
|
||||
@@ -284,7 +284,7 @@
|
||||
startImplicitCall(i + 1);
|
||||
return forward(2);
|
||||
}
|
||||
if (indexOf.call(IMPLICIT_FUNC, tag) >= 0 && this.indexOfTag(i + 1, 'INDENT', null, ':') > -1 && !this.findTagsBackwards(i, ['CLASS', 'EXTENDS', 'IF', 'CATCH', 'SWITCH', 'LEADING_WHEN', 'FOR', 'WHILE', 'UNTIL'])) {
|
||||
if (indexOf.call(IMPLICIT_FUNC, tag) >= 0 && this.indexOfTag(i + 1, 'INDENT') > -1 && this.looksObjectish(i + 2) && !this.findTagsBackwards(i, ['CLASS', 'EXTENDS', 'IF', 'CATCH', 'SWITCH', 'LEADING_WHEN', 'FOR', 'WHILE', 'UNTIL'])) {
|
||||
startImplicitCall(i + 1);
|
||||
stack.push(['INDENT', i + 2]);
|
||||
return forward(3);
|
||||
|
||||
Reference in New Issue
Block a user