Files
ladybird/Tests/LibWeb/Crash/JS/console-table-proxy-wrapped-array.html
Tim Ledbetter 17ea7b5f86 LibJS: Handle proxy-wrapped arrays in console.table()
Previously, we would crash if `console.table()` was called with a
proxy-wrapped array. This is because `Value::is_array()` returns true
for proxy-wrapped arrays but `as_array()` simply casts to an Array
object. We now treat these objects as array-like and access elements
generically through the Object interface, which correctly dispatches
through Proxy traps.
2026-03-29 13:45:38 +02:00

7 lines
189 B
HTML

<!DOCTYPE html>
<script>
console.table({ a: new Proxy([1, 2, 3], {}) });
console.table(new Proxy([1, 2, 3], {}));
console.table({ a: 1, b: 2 }, new Proxy(["a"], {}));
</script>