File tree Expand file tree Collapse file tree 1 file changed +19
-15
lines changed Expand file tree Collapse file tree 1 file changed +19
-15
lines changed Original file line number Diff line number Diff line change @@ -321,20 +321,6 @@ module.exports = {
321
321
continue ;
322
322
}
323
323
324
- // check constant
325
- if ( this . token == this . tok . T_CONST ) {
326
- var node = this . node ( ) ;
327
- var constants = this . read_constant_list ( ) ;
328
- this . expect ( ';' ) . nextWithComments ( ) ;
329
- if ( comment ) {
330
- ( this . locations ? comment [ 3 ] : comment ) . push ( constants ) ;
331
- constants = comment ;
332
- comment = false ;
333
- }
334
- constants = node . apply ( this , constants ) ;
335
- result . constants . push ( constants ) ;
336
- continue ;
337
- }
338
324
339
325
// prepare here position (to avoid bad position on locations)
340
326
if ( this . locations ) {
@@ -348,8 +334,26 @@ module.exports = {
348
334
// read member flags
349
335
var flags = this . read_member_flags ( true ) ;
350
336
337
+ // check constant
338
+ if ( this . token == this . tok . T_CONST ) {
339
+ var constants = this . read_constant_list ( ) ;
340
+ this . expect ( ';' ) . nextWithComments ( ) ;
341
+
342
+ for ( var i = 0 ; i < constants . length ; i ++ ) {
343
+ var constant = constants [ i ] ;
344
+ ( this . locations ? constant [ 3 ] : constant ) . push ( flags ) ;
345
+ if ( comment ) {
346
+ var buffer = comment . slice ( 0 ) ;
347
+ ( this . locations ? buffer [ 3 ] : buffer ) . push ( constant ) ;
348
+ constant = buffer ;
349
+ }
350
+ result . constants . push ( constant ) ;
351
+ }
352
+
353
+ }
354
+
351
355
// reads a function
352
- if ( this . token === this . tok . T_FUNCTION ) {
356
+ else if ( this . token === this . tok . T_FUNCTION ) {
353
357
// reads a function
354
358
var method = this . read_function_declaration ( ) . concat (
355
359
[ flags ]
You can’t perform that action at this time.
0 commit comments