mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
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.
21 lines
329 B
JavaScript
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 {}
|