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

Quelle  import-source-wasm.js

  Sprache: JAVA
 

// |jit-test| module; skip-if: !getBuildConfiguration("source-phase-imports") || !wasmIsSupported() || getBuildConfiguration("release_or_beta"); --enable-source-phase-imports; --enable-wasm-esm-integration

import source mod from "empty.wasm";
import source exportsFun from "exports-fun.wasm";

assertEq(mod instanceof WebAssembly.Module, true);

const AbstractModuleSource = getAbstractModuleSource();
assertEq(mod instanceof AbstractModuleSource, true);

assertEq(exportsFun instanceof WebAssembly.Module, true);
const instance = new WebAssembly.Instance(exportsFun);
assertEq(typeof instance.exports.fun, "function");
assertEq(instance.exports.fun(34), 7);

// Importing the same module as evaluation phase after source phase
// is safe, but throws a SyntaxError because we haven't implemented
// evaluation phase yet.
let error = null;
try {
  await import("empty.wasm");
catch (e) {
  error = e;
}
assertEq(error instanceof SyntaxError, true);

let compileError = null;
try {
  await import.source("invalid.wasm");
catch (e) {
  compileError = e;
}
assertEq(compileError instanceof WebAssembly.CompileError, true);
assertEq(compileError.fileName.endsWith("invalid.wasm"), true);

import.source("empty.wasm").then(mod => assertEq(mod instanceof WebAssembly.Module, true), e => assertEq(truefalse));

// Import source is not currently supported for JavaScript modules
compileError = null;
try {
  await import.source("empty.js");
catch (e) {
  compileError = e;
}
assertEq(compileError instanceof SyntaxError, true);
assertEq(compileError.message , "Source phase imports not supported for this module type");

Messung V0.5 in Prozent
C=90 H=100 G=95

¤ Dauer der Verarbeitung: 0.12 Sekunden  (vorverarbeitet am  2026-08-25) ¤

*© 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.