File tree 1 file changed +31
-0
lines changed
1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -188,5 +188,36 @@ describe('Test variables', function() {
188
188
ast . children [ 0 ] . left . kind . should . be . exactly ( 'variable' ) ;
189
189
ast . children [ 0 ] . left . name . should . be . exactly ( '?' ) ;
190
190
} ) ;
191
+
192
+ it ( 'should fail on double static lookup' , function ( ) {
193
+ var astErr = parser . parseEval ( [
194
+ 'this->foo::bar::baz;'
195
+ ] . join ( '\n' ) , {
196
+ parser : {
197
+ suppressErrors : true
198
+ }
199
+ } ) ;
200
+
201
+ var msg = 'Parse Error : syntax error, unexpected \'::\' (T_DOUBLE_COLON) on line 1' ;
202
+ astErr . errors . length . should . be . exactly ( 1 ) ;
203
+ astErr . errors [ 0 ] . line . should . be . exactly ( 1 ) ;
204
+ astErr . errors [ 0 ] . message . should . be . exactly ( msg ) ;
205
+ } ) ;
206
+
207
+ it ( 'should fail on property lookup on static lookup' , function ( ) {
208
+ var astErr = parser . parseEval ( [
209
+ 'this->foo::bar->baz;'
210
+ ] . join ( '\n' ) , {
211
+ parser : {
212
+ suppressErrors : true
213
+ }
214
+ } ) ;
215
+
216
+ var msg = 'Parse Error : syntax error, unexpected \'->\' (T_OBJECT_OPERATOR) on line 1' ;
217
+ astErr . errors . length . should . be . exactly ( 1 ) ;
218
+ astErr . errors [ 0 ] . line . should . be . exactly ( 1 ) ;
219
+ astErr . errors [ 0 ] . message . should . be . exactly ( msg ) ;
220
+ } ) ;
221
+
191
222
} ) ;
192
223
} ) ;
You can’t perform that action at this time.
0 commit comments