Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/js/src/jit-test/tests/wasm/regress/   (Firefox Browser Version 153.0.1©)  Datei vom 27.6.2026 mit Größe 1 kB image not shown  

Quelle  bug2013165.js

  Sprache: JAVA
 

let { callRef } = wasmEvalText(`(module
    (type $t (func))
    (func (export "callRef") (param externref (ref $t))
      (call_ref $t local.get 1)
    )
)`).exports;
let wrappedCallRef = Function.prototype.call.bind(callRef);

// ref.func and call_ref of Function.prototype.call.bind wrapping a wasm
// function should work, even if the wrapped function has a different type.
{
    let {test} = wasmEvalText(`(module
        (type $t (func (param externref i64)))
        (func (import "" "callRef") (param externref i64))
        (func (export "test")
            ref.null extern
            i64.const 0xDEADBEEF
            ref.func 0
            call_ref $t
        )
        (elem declare func 0)
    )`, {"": {"callRef": wrappedCallRef}}).exports;
    assertErrorMessage(test, TypeError, /bad type/);
}

// table.get and call_ref of Function.prototype.call.bind wrapping a wasm
// function should work, even if the wrapped function has a different type.
{
    let {test} = wasmEvalText(`(module
        (type $t (func (param externref i64)))
        (func (import "" "callRef") (param externref i64))
        (table (ref null $t) (elem 0))
        (func (export "test")
            ref.null extern
            i64.const 0xDEADBEEF
            (table.get 0 i32.const 0)
            call_ref $t
        )
    )`, {"": {"callRef": wrappedCallRef}}).exports;
    assertErrorMessage(test, TypeError, /bad type/);
}

Messung V0.5 in Prozent
C=87 H=96 G=91

¤ Dauer der Verarbeitung: 0.3 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

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.