Browse Source

+ introduced twasmtryexceptnode.pass_generate_code_no_exceptions,
.pass_generate_code_js_exceptions and .pass_generate_code_native_exceptions

Nikolay Nikolov 3 years ago
parent
commit
c992566201
1 changed files with 27 additions and 1 deletions
  1. 27 1
      compiler/wasm32/nwasmflw.pas

+ 27 - 1
compiler/wasm32/nwasmflw.pas

@@ -59,6 +59,10 @@ interface
       { twasmtryexceptnode }
 
       twasmtryexceptnode = class(tcgtryexceptnode)
+      private
+        procedure pass_generate_code_no_exceptions;
+        procedure pass_generate_code_js_exceptions;
+        procedure pass_generate_code_native_exceptions;
       public
         procedure pass_generate_code;override;
       end;
@@ -278,7 +282,7 @@ implementation
                              twasmtryexceptnode
 *****************************************************************************}
 
-    procedure twasmtryexceptnode.pass_generate_code;
+    procedure twasmtryexceptnode.pass_generate_code_no_exceptions;
       begin
         location_reset(location,LOC_VOID,OS_NO);
 
@@ -291,6 +295,28 @@ implementation
         current_asmdata.CurrAsmList.concat(tai_comment.Create(strpnew('TODO: try..except, end')));
       end;
 
+    procedure twasmtryexceptnode.pass_generate_code_js_exceptions;
+      begin
+        internalerror(2021091706);
+      end;
+
+    procedure twasmtryexceptnode.pass_generate_code_native_exceptions;
+      begin
+        internalerror(2021091707);
+      end;
+
+    procedure twasmtryexceptnode.pass_generate_code;
+      begin
+        if ts_wasm_no_exceptions in current_settings.targetswitches then
+          pass_generate_code_no_exceptions
+        else if ts_wasm_js_exceptions in current_settings.targetswitches then
+          pass_generate_code_js_exceptions
+        else if ts_wasm_native_exceptions in current_settings.targetswitches then
+          pass_generate_code_native_exceptions
+        else
+          internalerror(2021091705);
+      end;
+
 {*****************************************************************************
                              twasmtryfinallynode
 *****************************************************************************}