1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 11:05:09 +00:00

LibJS: Parse "this" as ThisExpression

This commit is contained in:
Stephan Unverwerth 2020-04-13 00:42:14 +02:00 committed by Andreas Kling
parent 110ca6b0b6
commit f8f65053bd
6 changed files with 37 additions and 17 deletions

View file

@ -158,10 +158,6 @@ void Interpreter::set_variable(const FlyString& name, Value value, bool first_as
Optional<Value> Interpreter::get_variable(const FlyString& name)
{
static FlyString this_name = "this";
if (name == this_name)
return this_value();
for (ssize_t i = m_scope_stack.size() - 1; i >= 0; --i) {
auto& scope = m_scope_stack.at(i);
auto value = scope.variables.get(name);