File tree Expand file tree Collapse file tree 4 files changed +20
-4
lines changed 
loaders/cs_loader/netcore/source 
tests/metacall_node_port_test Expand file tree Collapse file tree 4 files changed +20
-4
lines changed Original file line number Diff line number Diff line change @@ -18,12 +18,10 @@ namespace CSLoader
1818    public  static   class  MetacallEntryPoint 
1919    { 
2020        private  static   LoaderBase  loader  =  null ; 
21+         private  static   ConsoleLog  log  =  new  ConsoleLog ( ) ; 
2122
2223        static   MetacallEntryPoint ( ) 
2324        { 
24- 
25-             var  log  =  new  ConsoleLog ( ) ; 
26- 
2725            log . Info ( "CSLoader static initialization" ) ; 
2826
2927            #if NETCOREAPP1_0  ||  NETCOREAPP1_1  ||  NETCOREAPP1_2 
@@ -45,7 +43,13 @@ public static bool Load(string source)
4543
4644        public  static   bool  Load ( string [ ]  files ) 
4745        { 
48-             return  loader . LoadFromSourceFunctions ( files . Select ( x =>  System . IO . File . ReadAllText ( x ) ) . ToArray ( ) ) ; 
46+             try  { 
47+                 return  loader . LoadFromSourceFunctions ( files . Select ( x =>  System . IO . File . ReadAllText ( x ) ) . ToArray ( ) ) ; 
48+             }  catch  ( FileNotFoundException  ex )  { 
49+                 // TODO: Implement error handling 
50+                 log . Info ( ex . Message ) ; 
51+                 return  false ; 
52+             } 
4953        } 
5054
5155        public  static   ReflectFunction [ ]  GetFunctionsInternal ( ) 
Original file line number Diff line number Diff line change @@ -195,10 +195,15 @@ mod.prototype.require = function (name) {
195195		/* NodeJS Loader */ 
196196		js : 'node' , 
197197		node : 'node' , 
198+ 
199+ 		/* TODO: TypeScript Loader is not supported to run with NodeJS Loader at the same time yet */ 
200+ 
198201		/* TypeScript Loader */ 
202+ 		/* 
199203		ts: 'ts', 
200204		jsx: 'ts', 
201205		tsx: 'ts', 
206+ 		*/ 
202207
203208		/* Note: By default js extension uses NodeJS loader instead of JavaScript V8 */ 
204209		/* Probably in the future we can differenciate between them, but it is not trivial */ 
Original file line number Diff line number Diff line change @@ -42,6 +42,12 @@ describe('metacall', () => {
4242		} ) ; 
4343	} ) ; 
4444
45+ 	describe ( 'fail' ,  ( )  =>  { 
46+ 		it ( 'require' ,  ( )  =>  { 
47+ 			assert . strictEqual ( require ( './asd.invalid' ) ,  undefined ) ; 
48+ 		} ) ; 
49+ 	} ) ; 
50+ 
4551	describe ( 'load' ,  ( )  =>  { 
4652		it ( 'metacall_load_from_file (py)' ,  ( )  =>  { 
4753			assert . strictEqual ( metacall_load_from_file ( 'py' ,  [  'helloworld.py'  ]  ) ,  undefined ) ; 
Original file line number Diff line number Diff line change @@ -135,6 +135,7 @@ if(OPTION_BUILD_LOADERS_COB)
135135endif ()
136136
137137add_dependencies (${target} 
138+ 	node_port
138139	node_loader
139140	mock_loader
140141	py_loader
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments