Browse Source

pas2js: fixed not existsing default config

git-svn-id: trunk@40484 -
Mattias Gaertner 6 years ago
parent
commit
1b4c201a68

+ 0 - 1
packages/fcl-passrc/src/pparser.pp

@@ -2036,7 +2036,6 @@ begin
       begin
       repeat
         Expr:=DoParseExpression(Params);
-        writeln('AAA1 TPasParser.ParseParams ',CurTokenString,' ',curtoken);
         if not Assigned(Expr) then
           ParseExcSyntaxError;
         Params.AddParam(Expr);

+ 0 - 3
packages/pastojs/src/pas2jscompiler.pp

@@ -1223,8 +1223,6 @@ begin
   Compiler.Terminate(ExitCodeConverterError);
 end;
 
-
-
 procedure TPas2jsCompilerFile.HandleUnknownException(E: Exception);
 begin
   if not (E is ECompilerTerminate) then
@@ -4417,7 +4415,6 @@ begin
   if Assigned(aFile.PCUSupport) then
     begin
     aFile.FileResolver.BaseDirectory:=ExtractFilePath(UnitFilename);
-    writeln('AAA1 TPas2jsCompiler.LoadPasFile ',GetObjName(aFile.PCUSupport));
     aFile.PCUSupport.CreatePCUReader;
     end
   else

+ 5 - 4
packages/pastojs/src/pas2jscompilercfg.pp

@@ -47,7 +47,6 @@ end;
 
 Function TPas2JSFileConfigSupport.FindDefaultConfig : String;
 
-
   function TryConfig(aFilename: string): boolean;
   begin
     Result:=false;
@@ -56,6 +55,7 @@ Function TPas2JSFileConfigSupport.FindDefaultConfig : String;
     if Compiler.ShowDebug or Compiler.ShowTriedUsedFiles then
       Compiler.Log.LogMsgIgnoreFilter(nConfigFileSearch,[aFilename]);
     if not Compiler.FS.FileExists(aFilename) then exit;
+    FindDefaultConfig:=aFilename;
     Result:=true;
   end;
 
@@ -63,13 +63,14 @@ var
   aFilename: String;
 
 begin
+  Result:='';
   // first try HOME directory
   aFilename:=ChompPathDelim(GetEnvironmentVariablePJ('HOME'));
   if aFilename<>'' then
     begin
     aFilename:=aFilename+PathDelim{$IFDEF UNIX}+'.'{$ENDIF}+DefaultConfigFile;
     if TryConfig(aFileName) then
-      exit(aFileName);
+      exit;
     end;
 
   // then try compiler directory
@@ -80,14 +81,14 @@ begin
     begin
       aFilename:=IncludeTrailingPathDelimiter(aFilename)+DefaultConfigFile;
       if TryConfig(aFilename) then
-        exit(aFileName);
+        exit;
     end;
   end;
 
   // finally try global directory
   {$IFDEF Unix}
   if TryConfig('/etc/'+DefaultConfigFile) then
-    exit(aFileName);
+    exit;
   {$ENDIF}
 end;
 

+ 2 - 0
packages/pastojs/src/pas2jslogger.pp

@@ -512,7 +512,9 @@ Function TConsoleFileWriter.DoWrite(Const S : TJSWriterString) : Integer;
 
 begin
   Result:=Length(S);
+  {AllowWriteln}
   Writeln(S);
+  {AllowWriteln-}
 end;
 
 procedure TConsoleFileWriter.FLush;