* Merging revisions 422 from trunk:

------------------------------------------------------------------------
    r422 | michael | 2019-04-01 10:49:29 +0200 (Mon, 01 Apr 2019) | 1 line
    
    * Fix some warnings
    ------------------------------------------------------------------------
This commit is contained in:
michael 2019-04-04 18:29:13 +00:00
parent 28d49fe196
commit 3ef1d36194

View File

@ -103,8 +103,8 @@ constructor TWebCompilerDemo.Create(aOwner : TComponent);
begin begin
Inherited; Inherited;
FCompiler:=TPas2JSWebCompiler.Create; FCompiler:=TPas2JSWebCompiler.Create;
FCompiler.Log.OnLog:=@DoLog; Compiler.Log.OnLog:=@DoLog;
FCompiler.WebFS.LoadBaseURL:='sources'; Compiler.WebFS.LoadBaseURL:='sources';
end; end;
function TWebCompilerDemo.RunClick(aEvent: TJSMouseEvent): boolean; function TWebCompilerDemo.RunClick(aEvent: TJSMouseEvent): boolean;
@ -113,7 +113,8 @@ Var
Src : String; Src : String;
begin begin
Src:=FCompiler.WebFS.GetFileContent('main.js'); Result:=True;
Src:=Compiler.WebFS.GetFileContent('main.js');
if Src='' then if Src='' then
begin begin
Window.Alert('No source available'); Window.Alert('No source available');
@ -131,13 +132,13 @@ end;
function TWebCompilerDemo.LoadDefaultsClick(aEvent: TJSMouseEvent): boolean; function TWebCompilerDemo.LoadDefaultsClick(aEvent: TJSMouseEvent): boolean;
begin begin
Result:=False; Result:=False;
FCompiler.WebFS.LoadFiles(['rtl.js','system.pas','sysutils.pas','types.pas','typinfo.pas','classes.pas','rtlconsts.pas','js.pas','web.pas','browserconsole.pas'],@OnUnitLoaded); Compiler.WebFS.LoadFiles(['rtl.js','system.pas','sysutils.pas','types.pas','typinfo.pas','classes.pas','rtlconsts.pas','js.pas','web.pas','browserconsole.pas'],@OnUnitLoaded);
end; end;
function TWebCompilerDemo.LoadSingleUnitClick(aEvent: TJSMouseEvent): boolean; function TWebCompilerDemo.LoadSingleUnitClick(aEvent: TJSMouseEvent): boolean;
begin begin
Result:=False; Result:=False;
FCompiler.WebFS.LoadFile(EUnitName.Value,@OnUnitLoaded); Compiler.WebFS.LoadFile(EUnitName.Value,@OnUnitLoaded);
end; end;
@ -192,7 +193,7 @@ begin
BRun['disabled']:='disabled'; BRun['disabled']:='disabled';
ClearResult; ClearResult;
MLog.Value:=''; MLog.Value:='';
FCompiler.WebFS.SetFileContent('main.pp',MSource.value); Compiler.WebFS.SetFileContent('main.pp',MSource.value);
args:=TStringList.Create; args:=TStringList.Create;
try try
Args.Add('-Tbrowser'); Args.Add('-Tbrowser');
@ -201,8 +202,8 @@ begin
Args.Add('main.pp'); Args.Add('main.pp');
ActivateTab('output'); ActivateTab('output');
RFrame.Src:='run.html'; RFrame.Src:='run.html';
FCompiler.Run('','',Args,True); Compiler.Run('','',Args,True);
Res:=FCompiler.ExitCode=0; Res:=Compiler.ExitCode=0;
ShowResult(Res); ShowResult(Res);
if Res then if Res then
BRun.removeAttribute('disabled'); BRun.removeAttribute('disabled');