Deeply nested structures passed to JSON.stringify or structuredClone would cause a lot of recursion, eventually causing a crash. We now throw an InternalError instead, same as other browser engines.
19 lines
436 B
HTML
19 lines
436 B
HTML
<!DOCTYPE html>
|
|
<script src="../include.js"></script>
|
|
<script>
|
|
test(() => {
|
|
const deep = [];
|
|
let current = deep;
|
|
for (let i = 0; i < 100_000; i++) {
|
|
current[0] = [];
|
|
current = current[0];
|
|
}
|
|
|
|
try {
|
|
structuredClone(deep);
|
|
println("FAILED");
|
|
} catch (e) {
|
|
println(`ERROR: ${e.name}: ${e.message}`);
|
|
}
|
|
});
|
|
</script>
|