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 = {
222222 let wasVariadic = false ;
223223 this . expect ( "(" ) && this . next ( ) ;
224224 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+ }
230235 }
231- if ( argument . kind === "variadic" ) {
232- wasVariadic = true ;
233- }
234- }
235- return argument ;
236- } . bind ( this ) , ',' ) ;
236+ return argument ;
237+ } . bind ( this ) ,
238+ ","
239+ ) ;
237240 }
238241 this . expect ( ")" ) && this . next ( ) ;
239242 return result ;
Original file line number Diff line number Diff line change @@ -25,24 +25,24 @@ module.exports = {
2525
2626 /**
2727 * https://wiki.php.net/rfc/trailing-comma-function-calls
28- * @param {* } item
29- * @param {* } separator
28+ * @param {* } item
29+ * @param {* } separator
3030 */
3131 read_function_list : function ( item , separator ) {
3232 const result = [ ] ;
3333 do {
3434 if ( this . token == separator && this . php73 && result . length > 0 ) {
35- result . push ( this . node ( ' noop' ) ( ) ) ;
35+ result . push ( this . node ( " noop" ) ( ) ) ;
3636 break ;
3737 }
3838 result . push ( item . apply ( this , [ ] ) ) ;
3939 if ( this . token != separator ) {
4040 break ;
4141 }
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" ) ( ) ) ;
4444 break ;
45- }
45+ }
4646 } while ( this . token != this . EOF ) ;
4747 return result ;
4848 } ,
You can’t perform that action at this time.
0 commit comments