Browse Source

pastojs: uses in filename: if not found try pcu

mattias 4 years ago
parent
commit
48b8b21dba
1 changed files with 4 additions and 3 deletions
  1. 4 3
      compiler/packages/pastojs/src/pas2jscompiler.pp

+ 4 - 3
compiler/packages/pastojs/src/pas2jscompiler.pp

@@ -4793,9 +4793,8 @@ begin
   end else begin
     // search Pascal file with InFilename
     FoundPasFilename:=FS.FindUnitFileName(UseUnitname,InFilename,ModuleDir,FoundPasIsForeign);
-    if FoundPasFilename='' then
-      exit; // an in-filename unit source is missing -> stop
-    FoundPasUnitName:=ExtractFilenameOnly(InFilename);
+    if FoundPasFilename<>'' then
+      FoundPasUnitName:=ExtractFilenameOnly(InFilename);
 
     // Note: at the moment if there is a source do not search for pcu
     // Eventually search for both, load pcu and if that fails unload pcu and load source
@@ -4804,7 +4803,9 @@ begin
       // no pas file -> search pcu
       FoundPCUFilename:=PCUSupport.FindPCU(UseUnitName);
       if FoundPCUFilename<>'' then
+      begin
         FoundPCUUnitName:=UseUnitName;
+      end;
     end;
   end;