Ver código fonte

* Merging revisions 422 from trunk:
------------------------------------------------------------------------
r422 | michael | 2019-04-01 10:49:29 +0200 (Mon, 01 Apr 2019) | 1 line

* Fix some warnings
------------------------------------------------------------------------

michael 6 anos atrás
pai
commit
3ef1d36194
1 arquivos alterados com 9 adições e 8 exclusões
  1. 9 8
      demo/webcompiler/demowebcompiler.lpr

+ 9 - 8
demo/webcompiler/demowebcompiler.lpr

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