mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
Previously, the function only handled a single level of member access, producing strings like "<object>.isWall" for chained expressions like "graphSet[j][k].isWall". Now it recurses through nested member expressions, identifiers, string/numeric literals, and `this`.
18 lines
363 B
JavaScript
18 lines
363 B
JavaScript
// Test that chained member access produces readable expression strings
|
|
// in Call instructions (e.g., "a[b][c].foo" not "<object>.foo").
|
|
|
|
function chained_computed_call(a, j, k) {
|
|
return a[j][k].foo();
|
|
}
|
|
|
|
function chained_dot_call(a) {
|
|
return a.b.c.bar();
|
|
}
|
|
|
|
try {
|
|
chained_computed_call(0, 0, 0);
|
|
} catch {}
|
|
try {
|
|
chained_dot_call(0);
|
|
} catch {}
|