1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-15 22:54:57 +00:00

LibJS: Remove hand-rolled type information in JS AST in favor of RTTI

This commit is contained in:
Andreas Kling 2021-01-01 19:34:07 +01:00
parent 07dd73c351
commit db790dda62
5 changed files with 44 additions and 67 deletions

View file

@ -107,7 +107,7 @@ void Interpreter::enter_scope(const ScopeNode& scope_node, ScopeType scope_type,
for (auto& declaration : scope_node.variables()) {
for (auto& declarator : declaration.declarations()) {
if (scope_node.is_program()) {
if (is<Program>(scope_node)) {
global_object.put(declarator.id().string(), js_undefined());
if (exception())
return;
@ -160,7 +160,7 @@ void Interpreter::push_scope(ScopeFrame frame)
Value Interpreter::execute_statement(GlobalObject& global_object, const Statement& statement, ScopeType scope_type)
{
if (!statement.is_scope_node())
if (!is<ScopeNode>(statement))
return statement.execute(*this, global_object);
auto& block = static_cast<const ScopeNode&>(statement);