Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 


Quelle  test_webassembly_compile_worker.js   Sprache: JAVA

 
const sampleURL = "test_webassembly_compile_sample.wasm";
const sampleExportName = "run";
const sampleResult = 1275;

/* eslint-disable no-throw-literal */

function checkSampleModule(m) {
  if (!(m instanceof WebAssembly.Module)) {
    throw "not a module";
  }
  var i = new WebAssembly.Instance(m);
  if (!(i instanceof WebAssembly.Instance)) {
    throw "not an instance";
  }
  if (i.exports[sampleExportName]() !== sampleResult) {
    throw "wrong result";
  }
}

function checkSampleInstance(i) {
  if (!(i instanceof WebAssembly.Instance)) {
    throw "not an instance";
  }
  if (i.exports[sampleExportName]() !== sampleResult) {
    throw "wrong result";
  }
}

const initObj = { headers: { "Content-Type""application/wasm" } };

onmessage = e => {
  WebAssembly.compile(e.data)
    .then(m => checkSampleModule(m))
    .then(() => WebAssembly.instantiate(e.data))
    .then(({ module, instance }) => {
      checkSampleModule(module);
      checkSampleInstance(instance);
    })
    .then(() => WebAssembly.compileStreaming(new Response(e.data, initObj)))
    .then(m => checkSampleModule(m))
    .then(() => WebAssembly.instantiateStreaming(new Response(e.data, initObj)))
    .then(({ module, instance }) => {
      checkSampleModule(module);
      checkSampleInstance(instance);
    })
    .then(() => WebAssembly.compileStreaming(fetch(sampleURL)))
    .then(m => checkSampleModule(m))
    .then(() => WebAssembly.instantiateStreaming(fetch(sampleURL)))
    .then(({ module, instance }) => {
      checkSampleModule(module);
      checkSampleInstance(instance);
    })
    .then(() => postMessage("ok"))
    .catch(err => postMessage("fail: " + err));
};

Messung V0.5
C=92 H=93 G=92

¤ Dauer der Verarbeitung: 0.2 Sekunden  ¤

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






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Produkte
     Quellcodebibliothek

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Monitoring

Montastic status badge