ladybird/Tests/LibWeb/Text/input/TextDecoder/TextDecoder_decode.html
Ali Mohammad Pur 0e3fb39a0a LibWeb: Make 'optional BufferSource' IDL arguments actually optional
Previously this was compiled to require an object despite the IDL file
specifying 'optional'.
This commit makes IDLGenerator respect this modifier, and fixes the only
affected instance.
2023-05-30 12:50:13 +02:00

12 lines
374 B
HTML

<script src="../include.js"></script>
<script>
test(() => {
try {
let decoder = new TextDecoder("utf-8");
println(`[${decoder.decode(new Uint8Array([0x41, 0x42, 0x43]))}]`); // "ABC"
println(`[${decoder.decode()}]`);
} catch(e) {
println("ERROR: " + e.name + ": " + e.message);
}
});
</script>