d66cc11c2f
The JS API constructor was renamed to "WebAssembly.Tag" to match the spec: https://github.com/WebAssembly/exception-handling/issues/159 Rename "exception" to "tag" throughout the codebase for consistency with the JS API, and to match the spec terminology (e.g. "tag section"). R=clemensb@chromium.org,nicohartmann@chromium.org Bug: v8:11992 Change-Id: I63f9f3101abfeefd49117461bd59c594ca5dab70 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3053583 Reviewed-by: Clemens Backes <clemensb@chromium.org> Reviewed-by: Nico Hartmann <nicohartmann@chromium.org> Commit-Queue: Clemens Backes <clemensb@chromium.org> Cr-Commit-Position: refs/heads/master@{#75994}
29 lines
791 B
JavaScript
29 lines
791 B
JavaScript
// Copyright 2021 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: --experimental-wasm-eh
|
|
d8.file.execute('test/mjsunit/wasm/wasm-module-builder.js')
|
|
let obj = {};
|
|
let proxy = new Proxy(obj, {});
|
|
let builder = new WasmModuleBuilder();
|
|
builder.addType(kSig_v_v);
|
|
let imports = builder.addImport("m","f", kSig_v_v);
|
|
let exception = builder.addTag(kSig_v_v);
|
|
builder.addFunction("foo", kSig_v_v)
|
|
.addBody([
|
|
kExprTry,
|
|
kWasmVoid,
|
|
kExprCallFunction, imports,
|
|
kExprCatch, exception,
|
|
kExprEnd]
|
|
).exportFunc();
|
|
let inst = builder.instantiate({
|
|
m: {
|
|
f: function () {
|
|
throw proxy;
|
|
}
|
|
}
|
|
});
|
|
assertThrows(inst.exports.foo);
|