mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
352a525eb9
PR-URL: https://github.com/nodejs/node/pull/19989 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matheus Marchini <matheus@sthima.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Myles Borins <myles.borins@gmail.com>
22 lines
671 B
JavaScript
22 lines
671 B
JavaScript
// Copyright 2018 the V8 project authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
// Flags: --expose-wasm --no-stress-opt
|
|
|
|
load('test/mjsunit/mjsunit.js');
|
|
load('test/mjsunit/wasm/wasm-constants.js');
|
|
load('test/mjsunit/wasm/wasm-module-builder.js');
|
|
|
|
var builder = new WasmModuleBuilder();
|
|
builder.setName('test-module');
|
|
builder.addFunction('main', kSig_i_v).addBody([kExprUnreachable]).exportFunc();
|
|
let buffer = builder.toBuffer();
|
|
assertPromiseResult(WebAssembly.instantiate(buffer), pair => {
|
|
try {
|
|
pair.instance.exports.main();
|
|
} catch (e) {
|
|
print(e.stack);
|
|
}
|
|
});
|