Quellcodebibliothek Statistik Leitseite products/sources/formale Sprachen/C/Firefox/js/src/jit-test/tests/wasm/exceptions/   (Browser von der Mozilla Stiftung Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 966 B image not shown  

Quelle  example.js   Sprache: JAVA

 
// A diagram depicting the control flow graph of the function g below can be
// found in "js/src/wasm/WasmIonCompile.cpp". If you make any changes to this
// test file be sure to adjust the SMDOC documentation there as well.

let g = wasmEvalText(
  `(module
     (tag $exn (param f64))
     (func $f)
     (func (export "g") (param $arg i32) (result f64)
       (local.get $arg)
       try (param i32) (result f64)
         (if (result f64)
           (then
             (f64.const 3))
           (else
             (throw $exn (f64.const 6))))
         (call $f)
         (f64.sub (f64.const 2))  ;; If $arg is 0 we end here, subtracting 3.
       ;; If $arg is not 0 then the else-block throws $exn, caught below.
       catch $exn
         (f64.add (f64.const 4))  ;; Adds 4 to the value in the $exn (6).
       catch_all                  ;; This shouldn't occur.
           (f64.const 5)
       end
     ))`
).exports.g;

assertEq(g(0), 10);
assertEq(g(1), 1);

Messung V0.5
C=90 H=86 G=87

¤ Dauer der Verarbeitung: 0.14 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.