@@ -37,7 +37,7 @@ use rolldown_common::{
3737 StmtInfoIdx , StmtInfoMeta , StmtInfos , SymbolRef , SymbolRefDbForModule , SymbolRefFlags ,
3838 TaggedSymbolRef , ThisExprReplaceKind , generate_replace_this_expr_map,
3939} ;
40- use rolldown_ecmascript_utils:: { BindingIdentifierExt , BindingPatternExt , FunctionExt } ;
40+ use rolldown_ecmascript_utils:: { BindingPatternExt , FunctionExt } ;
4141use rolldown_error:: { BuildDiagnostic , BuildResult , CjsExportSpan } ;
4242use rolldown_std_utils:: PathExt ;
4343use rolldown_utils:: concat_string;
@@ -728,7 +728,7 @@ impl<'me, 'ast: 'me> AstScanner<'me, 'ast> {
728728 ast:: Declaration :: VariableDeclaration ( var_decl) => {
729729 var_decl. declarations . iter ( ) . for_each ( |decl| {
730730 decl. id . binding_identifiers ( ) . into_iter ( ) . for_each ( |id| {
731- self . add_local_export ( & id. name , id. expect_symbol_id ( ) , id. span ) ;
731+ self . add_local_export ( & id. name , id. symbol_id ( ) , id. span ) ;
732732 } ) ;
733733 if let BindingPattern :: BindingIdentifier ( ref binding) = decl. id {
734734 let symbol_id = binding. symbol_id ( ) ;
@@ -764,7 +764,7 @@ impl<'me, 'ast: 'me> AstScanner<'me, 'ast> {
764764 }
765765 ast:: Declaration :: FunctionDeclaration ( fn_decl) => {
766766 let binding_id = fn_decl. id . as_ref ( ) . unwrap ( ) ;
767- let symbol_id = binding_id. expect_symbol_id ( ) ;
767+ let symbol_id = binding_id. symbol_id ( ) ;
768768 self . add_local_export ( binding_id. name . as_str ( ) , symbol_id, binding_id. span ) ;
769769 if fn_decl. is_side_effect_free ( ) || fn_decl. pure {
770770 self . result . ecma_view_meta . insert ( EcmaViewMeta :: TopExportedSideEffectsFreeFunction ) ;
@@ -779,7 +779,7 @@ impl<'me, 'ast: 'me> AstScanner<'me, 'ast> {
779779 }
780780 ast:: Declaration :: ClassDeclaration ( cls_decl) => {
781781 let id = cls_decl. id . as_ref ( ) . unwrap ( ) ;
782- self . add_local_export ( id. name . as_str ( ) , id. expect_symbol_id ( ) , id. span ) ;
782+ self . add_local_export ( id. name . as_str ( ) , id. symbol_id ( ) , id. span ) ;
783783 }
784784 _ => {
785785 self . untranspiled_syntax |= UntranspiledSyntax :: TypeScript ;
@@ -838,14 +838,14 @@ impl<'me, 'ast: 'me> AstScanner<'me, 'ast> {
838838 . insert ( SymbolRefFlags :: SideEffectsFreeFunction ) ;
839839 }
840840 fn_decl. id . as_ref ( ) . map ( |id| {
841- let symbol_id = rolldown_ecmascript_utils :: BindingIdentifierExt :: expect_symbol_id ( id ) ;
841+ let symbol_id = id . symbol_id ( ) ;
842842 self . result . default_export_ref . symbol = symbol_id;
843843 ( symbol_id, id. span )
844844 } )
845845 }
846846 ast:: ExportDefaultDeclarationKind :: ClassDeclaration ( cls_decl) => {
847847 cls_decl. id . as_ref ( ) . map ( |id| {
848- let symbol_id = rolldown_ecmascript_utils :: BindingIdentifierExt :: expect_symbol_id ( id ) ;
848+ let symbol_id = id . symbol_id ( ) ;
849849 self . result . default_export_ref . symbol = symbol_id;
850850 ( symbol_id, id. span )
851851 } )
@@ -891,15 +891,15 @@ impl<'me, 'ast: 'me> AstScanner<'me, 'ast> {
891891 let Some ( specifiers) = & decl. specifiers else { return } ;
892892 specifiers. iter ( ) . for_each ( |spec| match spec {
893893 ast:: ImportDeclarationSpecifier :: ImportSpecifier ( spec) => {
894- let sym = spec. local . expect_symbol_id ( ) ;
894+ let sym = spec. local . symbol_id ( ) ;
895895 let imported = spec. imported . name ( ) ;
896896 self . add_named_import ( sym, imported. as_str ( ) , rec_id, spec. imported . span ( ) ) ;
897897 }
898898 ast:: ImportDeclarationSpecifier :: ImportDefaultSpecifier ( spec) => {
899- self . add_named_import ( spec. local . expect_symbol_id ( ) , "default" , rec_id, spec. span ) ;
899+ self . add_named_import ( spec. local . symbol_id ( ) , "default" , rec_id, spec. span ) ;
900900 }
901901 ast:: ImportDeclarationSpecifier :: ImportNamespaceSpecifier ( spec) => {
902- let symbol_id = spec. local . expect_symbol_id ( ) ;
902+ let symbol_id = spec. local . symbol_id ( ) ;
903903 self . add_star_import ( symbol_id, rec_id, spec. local . span ( ) ) ;
904904 }
905905 } ) ;
0 commit comments