Lines Matching defs:declNode

2380 void ParserImpl::AddExportDefaultEntryItem(const ir::AstNode *declNode)
2386 ASSERT(declNode != nullptr);
2387 if (declNode->IsTSInterfaceDeclaration() ||
2388 (declNode->IsFunctionDeclaration() && declNode->AsFunctionDeclaration()->Function()->IsOverload())) {
2396 if (declNode->IsFunctionDeclaration() || declNode->IsClassDeclaration()) {
2397 localName = declNode->IsFunctionDeclaration() ? declNode->AsFunctionDeclaration()->Function()->GetName() :
2398 declNode->AsClassDeclaration()->Definition()->GetName();
2405 ThrowSyntaxError("Duplicate export name of '" + exportName.Mutf8() + "'", declNode->Start());
2409 void ParserImpl::AddExportLocalEntryItem(const ir::Statement *declNode, bool isTsModule)
2411 ASSERT(declNode != nullptr);
2419 if (declNode->IsVariableDeclaration()) {
2420 auto declarators = declNode->AsVariableDeclaration()->Declarators();
2437 if (declNode->IsFunctionDeclaration() || declNode->IsClassDeclaration()) {
2438 auto name = declNode->IsFunctionDeclaration() ?
2439 declNode->AsFunctionDeclaration()->Function()->Id() :
2440 declNode->AsClassDeclaration()->Definition()->Ident();
2443 declNode->Start());
2445 if (declNode->IsFunctionDeclaration() && declNode->AsFunctionDeclaration()->Function()->IsOverload()) {
2458 AddTsTypeExportLocalEntryItem(declNode, isTsModule, tsModuleScope);
2461 void ParserImpl::AddTsTypeExportLocalEntryItem(const ir::Statement *declNode, bool isTsModule,
2464 if (!declNode->IsTSInterfaceDeclaration() && !declNode->IsTSTypeAliasDeclaration()) {
2467 auto name = declNode->IsTSInterfaceDeclaration() ?
2468 declNode->AsTSInterfaceDeclaration()->Id() : declNode->AsTSTypeAliasDeclaration()->Id();
2485 ir::AstNode *declNode = nullptr;
2494 declNode = ParseFunctionDeclaration(true, ParserStatus::EXPORT_REACHED);
2496 declNode = ParseClassDeclaration(false, std::move(decorators), std::move(annotations), false, false, true);
2499 declNode = ParseFunctionDeclaration(false, ParserStatus::ASYNC_FUNCTION | ParserStatus::EXPORT_REACHED);
2502 declNode = ParseTsInterfaceDeclaration(false);
2514 declNode = ParseClassDeclaration(false, std::move(decorators), std::move(annotations), false, true, true);
2516 declNode = ParseExpression();
2517 Binder()->AddDecl<binder::LetDecl>(declNode->Start(), binder::DeclarationFlags::EXPORT,
2524 AddExportDefaultEntryItem(declNode);
2527 lexer::SourcePosition endLoc = declNode->End();
2528 auto *exportDeclaration = AllocNode<ir::ExportDefaultDeclaration>(declNode, isExportEquals);