1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:28:10 +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

@ -94,7 +94,7 @@ LexicalEnvironment* ScriptFunction::create_environment()
variables.set(parameter.name, { js_undefined(), DeclarationKind::Var });
}
if (body().is_scope_node()) {
if (is<ScopeNode>(body())) {
for (auto& declaration : static_cast<const ScopeNode&>(body()).variables()) {
for (auto& declarator : declaration.declarations()) {
variables.set(declarator.id().string(), { js_undefined(), DeclarationKind::Var });