File tree Expand file tree Collapse file tree 2 files changed +20
-17
lines changed Expand file tree Collapse file tree 2 files changed +20
-17
lines changed Original file line number Diff line number Diff line change @@ -222,18 +222,21 @@ module.exports = {
222
222
let wasVariadic = false ;
223
223
this . expect ( "(" ) && this . next ( ) ;
224
224
if ( this . token !== ")" ) {
225
- result = this . read_function_list ( function ( ) {
226
- const argument = this . read_argument_list ( ) ;
227
- if ( argument ) {
228
- if ( wasVariadic ) {
229
- this . raiseError ( "Unexpected argument after a variadic argument" ) ;
225
+ result = this . read_function_list (
226
+ function ( ) {
227
+ const argument = this . read_argument_list ( ) ;
228
+ if ( argument ) {
229
+ if ( wasVariadic ) {
230
+ this . raiseError ( "Unexpected argument after a variadic argument" ) ;
231
+ }
232
+ if ( argument . kind === "variadic" ) {
233
+ wasVariadic = true ;
234
+ }
230
235
}
231
- if ( argument . kind === "variadic" ) {
232
- wasVariadic = true ;
233
- }
234
- }
235
- return argument ;
236
- } . bind ( this ) , ',' ) ;
236
+ return argument ;
237
+ } . bind ( this ) ,
238
+ ","
239
+ ) ;
237
240
}
238
241
this . expect ( ")" ) && this . next ( ) ;
239
242
return result ;
Original file line number Diff line number Diff line change @@ -25,24 +25,24 @@ module.exports = {
25
25
26
26
/**
27
27
* https://wiki.php.net/rfc/trailing-comma-function-calls
28
- * @param {* } item
29
- * @param {* } separator
28
+ * @param {* } item
29
+ * @param {* } separator
30
30
*/
31
31
read_function_list : function ( item , separator ) {
32
32
const result = [ ] ;
33
33
do {
34
34
if ( this . token == separator && this . php73 && result . length > 0 ) {
35
- result . push ( this . node ( ' noop' ) ( ) ) ;
35
+ result . push ( this . node ( " noop" ) ( ) ) ;
36
36
break ;
37
37
}
38
38
result . push ( item . apply ( this , [ ] ) ) ;
39
39
if ( this . token != separator ) {
40
40
break ;
41
41
}
42
- if ( this . next ( ) . token == ')' && this . php73 ) {
43
- result . push ( this . node ( ' noop' ) ( ) ) ;
42
+ if ( this . next ( ) . token == ")" && this . php73 ) {
43
+ result . push ( this . node ( " noop" ) ( ) ) ;
44
44
break ;
45
- }
45
+ }
46
46
} while ( this . token != this . EOF ) ;
47
47
return result ;
48
48
} ,
You can’t perform that action at this time.
0 commit comments