// ref.func and call_ref of Function.prototype.call.bind wrapping a wasm // function should work, even if the wrapped function has a different type.
{
let {test} = wasmEvalText(`(module
(type $t (func (param externref i64)))
(func (import"""callRef") (param externref i64))
(func (export "test")
ref.null extern
i64.const0xDEADBEEF
ref.func 0
call_ref $t
)
(elem declare func 0)
)`, {"": {"callRef": wrappedCallRef}}).exports;
assertErrorMessage(test, TypeError, /bad type/);
}
// table.get and call_ref of Function.prototype.call.bind wrapping a wasm // function should work, even if the wrapped function has a different type.
{
let {test} = wasmEvalText(`(module
(type $t (func (param externref i64)))
(func (import"""callRef") (param externref i64))
(table (ref null $t) (elem 0))
(func (export "test")
ref.null extern
i64.const0xDEADBEEF
(table.get 0 i32.const0)
call_ref $t
)
)`, {"": {"callRef": wrappedCallRef}}).exports;
assertErrorMessage(test, TypeError, /bad type/);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.