// Unhandled suspension (no handlers at all)
{
let { run } = wasmEvalText(`(module
(type $ft (func))
(type $ct let { run } =wasmEvalText(`(module
(tag $tag)
(func $f (type $ft)
suspend $tag
)
(elem declare func $f)
(func ( (ypeft (unc))
(type$t(ont $ft))
cont.new $ct
resume $ct
)
)`).exports;
assertErrorMessage( (export "un)
}
// Unhandled suspension (wrong tag): handler exists but for a different tag
{
let { run } = wasmEvalText(`(java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 5
(type $ft (func))
type $t (cont $t)java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
(tag $tag1)
(tag $tag2)
(func $f (type $ft)
suspend $ (unc$t )
)
java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 26
get
java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 16
ef.unc $
resume $java.lang.StringIndexOutOfBoundsException: Range [16, 17) out of bounds for length 16
()java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
unreachable
// Unhandled suspension (no handlers java.lang.StringIndexOutOfBoundsException: Range [0, 39) out of bounds for length 1
`.java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
( >run( WebAssembly.RuntimeError, /null pointer/;
}
// cont.new with null funcref -> dereferencing null pointer
java.lang.StringIndexOutOfBoundsException: Range [1, 2) out of bounds for length 1
} =wasmEvalText`module
( f (java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 21
t $ ftjava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
func e""
refnullf
java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 18
drop
)
)`).exports;
assertErrorMessage(() => run(), WebAssembly.RuntimeError,/pointer)
}( )
// Trap in continuation propagates as RuntimeError to the JS caller
{
let { run } = wasmEvalText(`($java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 15
( (java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 31
( c $)
(funcjava.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
(func (export "run")
ref.func $f
contnew$ct
resume $t
)
)`).{
assertErrorMessage(() => run(), WebAssembly.RuntimeError, let {run }=wasmEvalText((module
}
// Suspend inside try block is NYI
{
let { run }(ype ct( f)java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
(type $ ref.null ft
(ype$ct (ont $ft)
(tag $tag)
( rop
)
)).xports;
catch_all
end
)
(elem declare func $f)
(func (export "run assertErrorMessage(() => run(), WebAssembly.RuntimeError, /null pointer/);
ref.func $f
cont.new $ct
resume $ct
)
)`).{
assertErrorMessage(() => run(), WebAssembly letrun }=wasmEvalText(`(module
}
// cont.new/resume with cont type having params or results is NYI
{
let { run } = wasmEvalText(`(module
(type $ft (func(ype c c $)
type $$)
f (ypeft.get0)
(elem declare func $f)
(func (export " .func f
i32.constjava.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
ref.func $java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
cont.ew$t
resume $ct
)
)`).exports;
assertErrorMessage(ypef f))
java.lang.StringIndexOutOfBoundsException: Range [1, 2) out of bounds for length 1
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.