Lines Matching defs:newDecl
423 bool Scope::AddLocal(ArenaAllocator *allocator, Variable *currentVariable, Decl *newDecl,
427 switch (newDecl->Type()) {
430 newDecl->Name(), [](const Variable *v) { return !v->HasFlag(VariableFlags::VAR); });
438 scope->Bindings().insert({newDecl->Name(), allocator->New<GlobalVariable>(newDecl, varFlags)});
440 scope->PropagateBinding<LocalVariable>(allocator, newDecl->Name(), newDecl, varFlags);
447 newDecl->Name(), allocator->New<EnumLiteralVariable>(newDecl, VariableFlags::ENUM_LITERAL));
450 bindings_.insert({newDecl->Name(), allocator->New<LocalVariable>(newDecl, VariableFlags::INTERFACE)});
462 if (HasVarDecl(newDecl->Name())) {
466 bindings_.insert({newDecl->Name(), allocator->New<LocalVariable>(newDecl, flags)});
472 bool ParamScope::AddParam(ArenaAllocator *allocator, Variable *currentVariable, Decl *newDecl, VariableFlags flags)
474 CHECK_NOT_NULL(newDecl);
475 ASSERT(newDecl->IsParameterDecl());
481 auto *param = allocator->New<LocalVariable>(newDecl, flags);
484 bindings_.insert({newDecl->Name(), param});
530 [[maybe_unused]] Variable *currentVariable, [[maybe_unused]] Decl *newDecl,
582 bool FunctionScope::AddBinding(ArenaAllocator *allocator, Variable *currentVariable, Decl *newDecl,
585 switch (newDecl->Type()) {
587 return AddVar<LocalVariable>(allocator, currentVariable, newDecl);
590 return AddFunction<LocalVariable>(allocator, currentVariable, newDecl, extension);
593 return AddClass<LocalVariable>(allocator, currentVariable, newDecl);
596 return AddTSBinding<EnumLiteralVariable>(allocator, newDecl, VariableFlags::ENUM_LITERAL);
599 return AddTSBinding<NamespaceVariable>(allocator, newDecl, VariableFlags::NAMESPACE);
602 return AddTSBinding<ImportEqualsVariable>(allocator, newDecl, VariableFlags::IMPORT_EQUALS);
605 return AddTSBinding<LocalVariable>(allocator, currentVariable, newDecl, VariableFlags::INTERFACE);
608 return AddLexical<LocalVariable>(allocator, currentVariable, newDecl);
665 bool TSEnumScope::AddBinding(ArenaAllocator *allocator, Variable *currentVariable, Decl *newDecl,
668 ASSERT(newDecl->Type() == DeclType::ENUM);
669 return enumMemberBindings_->insert({newDecl->Name(), allocator->New<EnumVariable>(newDecl, false)}).second;
700 bool GlobalScope::AddBinding(ArenaAllocator *allocator, Variable *currentVariable, Decl *newDecl,
703 switch (newDecl->Type()) {
705 return AddVar<GlobalVariable>(allocator, currentVariable, newDecl);
708 return AddFunction<GlobalVariable>(allocator, currentVariable, newDecl, extension);
711 return AddClass<LocalVariable>(allocator, currentVariable, newDecl);
714 return AddTSBinding<EnumLiteralVariable>(allocator, newDecl, VariableFlags::ENUM_LITERAL);
717 return AddTSBinding<NamespaceVariable>(allocator, newDecl, VariableFlags::NAMESPACE);
720 return AddTSBinding<ImportEqualsVariable>(allocator, newDecl, VariableFlags::IMPORT_EQUALS);
723 return AddTSBinding<LocalVariable>(allocator, currentVariable, newDecl, VariableFlags::INTERFACE);
726 return AddLexical<LocalVariable>(allocator, currentVariable, newDecl);
762 bool ModuleScope::AddBinding(ArenaAllocator *allocator, Variable *currentVariable, Decl *newDecl,
765 switch (newDecl->Type()) {
768 newDecl->Name(), [](const Variable *v) { return !v->HasFlag(VariableFlags::VAR); });
773 return newDecl->IsImportOrExportDecl() ?
774 AddVar<ModuleVariable>(allocator, currentVariable, newDecl) :
775 AddVar<LocalVariable>(allocator, currentVariable, newDecl);
784 return newDecl->IsImportOrExportDecl() ?
785 AddFunction<ModuleVariable>(allocator, currentVariable, newDecl, extension) :
786 AddFunction<LocalVariable>(allocator, currentVariable, newDecl, extension);
789 return newDecl->IsImportOrExportDecl() ?
790 AddClass<ModuleVariable>(allocator, currentVariable, newDecl) :
791 AddClass<LocalVariable>(allocator, currentVariable, newDecl);
794 return AddTSBinding<EnumLiteralVariable>(allocator, newDecl, VariableFlags::ENUM_LITERAL);
797 return AddTSBinding<NamespaceVariable>(allocator, newDecl, VariableFlags::NAMESPACE);
800 return AddTSBinding<ImportEqualsVariable>(allocator, newDecl, VariableFlags::IMPORT_EQUALS);
803 return AddTSBinding<LocalVariable>(allocator, currentVariable, newDecl, VariableFlags::INTERFACE);
809 return newDecl->IsImportOrExportDecl() ?
810 AddLexical<ModuleVariable>(allocator, currentVariable, newDecl) :
811 AddLexical<LocalVariable>(allocator, currentVariable, newDecl);
823 bool LocalScope::AddBinding(ArenaAllocator *allocator, Variable *currentVariable, Decl *newDecl,
826 return AddLocal(allocator, currentVariable, newDecl, extension);
843 bool CatchParamScope::AddBinding(ArenaAllocator *allocator, Variable *currentVariable, Decl *newDecl,
846 return AddParam(allocator, currentVariable, newDecl, VariableFlags::INITIALIZED);
849 bool CatchScope::AddBinding(ArenaAllocator *allocator, Variable *currentVariable, Decl *newDecl,
852 if (!newDecl->IsVarDecl() && paramScope_->FindLocal(newDecl->Name())) {
856 return AddLocal(allocator, currentVariable, newDecl, extension);