@@ -3079,7 +3079,6 @@ describe('semantic', function () {
3079
3079
3080
3080
}` , '__filename' ) ;
3081
3081
} ) . to . throwError ( function ( e ) {
3082
- console . log ( e ) ;
3083
3082
expect ( e ) . to . be . an ( SyntaxError ) ;
3084
3083
expect ( e . message ) . to . be ( 'the property "statusCode" is undefined in model "Error"' ) ;
3085
3084
} ) ;
@@ -4691,7 +4690,6 @@ describe('semantic', function () {
4691
4690
4692
4691
it ( 'used exceptions should ok' , function ( ) {
4693
4692
let ast = readAndParse ( 'fixtures/module_exception_used/main.dara' ) ;
4694
- console . log ( ast . usedExternException ) ;
4695
4693
expect ( ast . usedExternException . get ( 'OSS' ) . has ( 'Err1' ) ) . to . be ( true ) ;
4696
4694
expect ( ast . usedExternException . get ( 'OSS' ) . has ( 'Config' ) ) . to . be ( false ) ;
4697
4695
@@ -7692,8 +7690,48 @@ init() {
7692
7690
} ) ;
7693
7691
7694
7692
it ( 'use tmp variable method call shoule be ok' , function ( ) {
7695
- expect ( function ( ) {
7696
- readAndParse ( 'fixtures/tmp_var_call/main.dara' ) ;
7697
- } ) . to . not . throwException ( ) ;
7693
+ const ast = readAndParse ( 'fixtures/tmp_var_call/main.dara' ) ;
7694
+ let tStrAst = ast . moduleBody . nodes [ 0 ] . initBody . stmts [ 3 ] ;
7695
+ expect ( tStrAst . expr . left . id . elements [ 1 ] . expr . left ) . to . be . eql ( {
7696
+ 'type' : 'static_call' ,
7697
+ 'id' : {
7698
+ 'tag' : 2 ,
7699
+ 'loc' : loc ( 7 , 21 , 7 , 24 ) ,
7700
+ 'lexeme' : 'OSS' ,
7701
+ 'index' : 41 ,
7702
+ 'type' : 'module'
7703
+ } ,
7704
+ 'propertyPath' : [
7705
+ {
7706
+ 'tag' : 2 ,
7707
+ 'loc' : loc ( 7 , 25 , 7 , 36 ) ,
7708
+ 'lexeme' : 'accessKeyId' ,
7709
+ 'index' : 43
7710
+ }
7711
+ ]
7712
+ } ) ;
7713
+
7714
+ expect ( tStrAst . expr . left . id . elements [ 3 ] . expr . left ) . to . be . eql ( {
7715
+ 'type' : 'instance_call' ,
7716
+ 'id' : {
7717
+ 'tag' : 2 ,
7718
+ 'loc' : loc ( 7 , 42 , 7 , 45 ) ,
7719
+ 'lexeme' : 'oss' ,
7720
+ 'index' : 47 ,
7721
+ 'type' : 'variable' ,
7722
+ 'moduleType' : {
7723
+ 'type' : 'module' ,
7724
+ 'name' : 'OSS'
7725
+ }
7726
+ } ,
7727
+ 'propertyPath' : [
7728
+ {
7729
+ 'tag' : 2 ,
7730
+ 'loc' : loc ( 7 , 46 , 7 , 60 ) ,
7731
+ 'lexeme' : 'getAccessKeyId' ,
7732
+ 'index' : 49
7733
+ }
7734
+ ]
7735
+ } ) ;
7698
7736
} ) ;
7699
- } ) ;
7737
+ } ) ;
0 commit comments