Browse Source

pastojs: less hints

git-svn-id: trunk@40209 -
Mattias Gaertner 6 years ago
parent
commit
767938dac7
1 changed files with 4 additions and 1 deletions
  1. 4 1
      packages/pastojs/src/pas2jslogger.pp

+ 4 - 1
packages/pastojs/src/pas2jslogger.pp

@@ -419,7 +419,7 @@ begin
     jstNull: Result:='null';
     jstNull: Result:='null';
     jstBoolean: Result:=BoolToStr(Element.AsBoolean,'true','false');
     jstBoolean: Result:=BoolToStr(Element.AsBoolean,'true','false');
     jstNumber: str(Element.AsNumber,Result);
     jstNumber: str(Element.AsNumber,Result);
-    jstString: Result:=QuoteStr(Element.AsString{%H-},'''');
+    jstString: Result:=QuoteStr(String(Element.AsString),'''');
     jstObject: Result:='{:OBJECT:}';
     jstObject: Result:='{:OBJECT:}';
     jstReference: Result:='{:REFERENCE:}';
     jstReference: Result:='{:REFERENCE:}';
     JSTCompletion: Result:='{:COMPLETION:}';
     JSTCompletion: Result:='{:COMPLETION:}';
@@ -924,7 +924,9 @@ procedure TPas2jsLogger.LogExceptionBackTrace(E: Exception);
 begin
 begin
   {$IFDEF NodeJS}
   {$IFDEF NodeJS}
   if (E<>nil) and (E.NodeJSError<>nil) then
   if (E<>nil) and (E.NodeJSError<>nil) then
+    {AllowWriteln}
     writeln(E.NodeJSError.Stack);
     writeln(E.NodeJSError.Stack);
+    {AllowWriteln-}
   {$ENDIF}
   {$ENDIF}
 end;
 end;
 {$ELSE}
 {$ELSE}
@@ -940,6 +942,7 @@ begin
   Log(mtDebug,BackTraceStrFunc(lErrorAddr));
   Log(mtDebug,BackTraceStrFunc(lErrorAddr));
   for FrameNumber := 0 to FrameCount-1 do
   for FrameNumber := 0 to FrameCount-1 do
     Log(mtDebug,BackTraceStrFunc(Frames[FrameNumber]));
     Log(mtDebug,BackTraceStrFunc(Frames[FrameNumber]));
+  if E=nil then ;
 end;
 end;
 {$ENDIF}
 {$ENDIF}