2019-03-15 18:35:06 +05:30
|
|
|
// Copyright 2019 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.
|
|
|
|
|
2022-11-22 09:57:37 -05:00
|
|
|
// Flags: --wasm-test-streaming
|
2019-03-15 18:35:06 +05:30
|
|
|
|
2021-08-29 14:20:49 +02:00
|
|
|
d8.file.execute("test/mjsunit/wasm/wasm-module-builder.js");
|
2019-03-15 18:35:06 +05:30
|
|
|
|
2021-09-17 14:34:02 +02:00
|
|
|
(function TestAsyncCompileTagSection() {
|
2019-03-15 18:35:06 +05:30
|
|
|
print(arguments.callee.name);
|
|
|
|
let builder = new WasmModuleBuilder();
|
2021-09-17 14:34:02 +02:00
|
|
|
let except = builder.addTag(kSig_v_v);
|
2019-03-15 18:35:06 +05:30
|
|
|
builder.addFunction("thrw", kSig_v_v)
|
|
|
|
.addBody([
|
|
|
|
kExprThrow, except,
|
|
|
|
]).exportFunc();
|
|
|
|
function step1(buffer) {
|
|
|
|
assertPromiseResult(WebAssembly.compile(buffer), module => step2(module));
|
|
|
|
}
|
|
|
|
function step2(module) {
|
|
|
|
assertPromiseResult(WebAssembly.instantiate(module), inst => step3(inst));
|
|
|
|
}
|
|
|
|
function step3(instance) {
|
2021-09-17 14:34:02 +02:00
|
|
|
assertThrows(() => instance.exports.thrw(), WebAssembly.Exception);
|
2019-03-15 18:35:06 +05:30
|
|
|
}
|
|
|
|
step1(builder.toBuffer());
|
|
|
|
})();
|