File tree Expand file tree Collapse file tree 2 files changed +8
-9
lines changed Expand file tree Collapse file tree 2 files changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -112,10 +112,12 @@ module.exports = {
112112 read_byref : function ( cb ) {
113113 let byref = this . node ( "byref" ) ;
114114 this . next ( ) ;
115- byref = byref ( ) ;
115+ byref = byref ( null ) ;
116116 const result = cb ( ) ;
117- this . ast . swapLocations ( result , byref , result , this ) ;
118- result . byref = true ;
117+ if ( result ) {
118+ this . ast . swapLocations ( result , byref , result , this ) ;
119+ result . byref = true ;
120+ }
119121 return result ;
120122 } ,
121123
Original file line number Diff line number Diff line change 1717const util = require ( 'util' ) ;
1818const parser = require ( "../src/index" ) ;
1919const ast = parser . parseEval ( `
20- $foo = new Foo(
21- 'constructor',
22- 'bar',
23- );
20+ $bar = &$foo;
2421` , {
2522 parser : {
2623 debug : true ,
2724 php73 : true ,
2825 extractDoc : true
2926 } ,
30- /* ast: {
27+ ast : {
3128 withPositions : true ,
3229 withSource : true
33- }*/
30+ }
3431 }
3532) ;
3633console . log (
You can’t perform that action at this time.
0 commit comments