load_wasm.js (405B)
1 // Copyright 2016 The Chromium Authors 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 function createWasmModule() { 6 return fetch('/wasm/incrementer.wasm') 7 .then(response => { 8 if (!response.ok) throw new Error(response.statusText); 9 return response.arrayBuffer(); 10 }) 11 .then(WebAssembly.compile); 12 }