mirror of
https://gitlab.com/freepascal.org/fpc/pas2js.git
synced 2025-04-07 15:47:45 +02:00
* Allow to log message on create, so event handler exceptions can be traced in debugger console
This commit is contained in:
parent
848ea3e0bf
commit
d7d47e1439
@ -64,6 +64,9 @@ type
|
||||
FNodeJSError: TJSError;
|
||||
{$endif}
|
||||
public
|
||||
class var
|
||||
LogMessageOnCreate : Boolean;
|
||||
Public
|
||||
constructor Create(const Msg: String); reintroduce;
|
||||
constructor CreateFmt(const Msg: string; const Args: array of jsvalue);
|
||||
constructor CreateHelp(const Msg: String; AHelpContext: Integer);
|
||||
@ -2107,6 +2110,8 @@ begin
|
||||
{$ifdef nodejs}
|
||||
FNodeJSError:=TJSError.new;
|
||||
{$endif}
|
||||
if LogMessageOnCreate then
|
||||
Writeln('Created exception ',ClassName,' with message: ',Msg);
|
||||
end;
|
||||
|
||||
constructor Exception.CreateFmt(const Msg: string; const Args: array of jsvalue
|
||||
|
Loading…
Reference in New Issue
Block a user