1
0
Fork 0
mirror of https://github.com/jashkenas/coffeescript.git synced 2022-11-09 12:23:24 -05:00

Fix #4544: postfix conditional on first line of implicit object (#4554)

* support postfix conditional on first line of implicit object

* cleanup cleanup

* also fixes #2051, added test
This commit is contained in:
Julian Rosse 2017-05-29 18:29:45 -06:00 committed by Geoffrey Booth
parent d756bd6851
commit 63b109a4f5
5 changed files with 115 additions and 58 deletions

View file

@ -657,14 +657,15 @@
}
tagParameters() {
var i, stack, tok, tokens;
var i, paramEndToken, stack, tok, tokens;
if (this.tag() !== ')') {
return this;
}
stack = [];
({tokens} = this);
i = tokens.length;
tokens[--i][0] = 'PARAM_END';
paramEndToken = tokens[--i];
paramEndToken[0] = 'PARAM_END';
while (tok = tokens[--i]) {
switch (tok[0]) {
case ')':
@ -678,6 +679,7 @@
tok[0] = 'PARAM_START';
return this;
} else {
paramEndToken[0] = 'CALL_END';
return this;
}
}