summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/wasm/resources/load_wasm.js
blob: 7f280ac032f40a3fad932b1f8d068b225d8165cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
// Copyright 2016 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

function createWasmModule() {
    return fetch('/wasm/incrementer.wasm')
        .then(response => {
            if (!response.ok) throw new Error(response.statusText);
            return response.arrayBuffer();
        })
        .then(WebAssembly.compile);
}