Files
ladybird/Tests/LibJS/Bytecode/input/this-base-identifier.js
Andreas Kling 2dca137d9e LibJS: Handle ThisExpression in expression_identifier()
Add ThisExpression handling to the expression_identifier() helper used
for base_identifier in bytecode instructions. This makes PutById and
GetById emit base_identifier:this when the base is a this expression.
2026-02-15 23:21:46 +01:00

21 lines
329 B
JavaScript

// Test that GetById and PutById emit base_identifier:this
// when the base is a this expression.
function get_from_this() {
return this.foo;
}
function set_on_this() {
this.bar = 1;
}
function chained_this_access() {
return this.a.b;
}
get_from_this();
set_on_this();
try {
chained_this_access();
} catch {}