File tree Expand file tree Collapse file tree 2 files changed +4
-10
lines changed
crates/biome_js_type_info/src Expand file tree Collapse file tree 2 files changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,6 @@ pub static GLOBAL_RESOLVER: LazyLock<Arc<GlobalsResolver>> =
2929 LazyLock :: new ( || Arc :: new ( GlobalsResolver :: default ( ) ) ) ;
3030
3131pub static GLOBAL_TYPE_MEMBERS : LazyLock < Vec < TypeMember > > = LazyLock :: new ( || {
32- // use crate::globals_ids::*;
3332 ( 0 ..NUM_PREDEFINED_TYPES )
3433 . map ( TypeId :: new)
3534 . map ( |id| {
Original file line number Diff line number Diff line change @@ -22,12 +22,12 @@ impl GlobalsResolverBuilder {
2222 /// Fill a previously reserved type slot with actual type data.
2323 pub fn set_type_data ( & mut self , id : TypeId , data : TypeData ) {
2424 let index = id. index ( ) ;
25- assert ! (
25+ debug_assert ! (
2626 index < self . types. len( ) ,
2727 "TypeId {index} out of bounds (len: {})" ,
2828 self . types. len( )
2929 ) ;
30- assert ! (
30+ debug_assert ! (
3131 self . types[ index] . is_none( ) ,
3232 "Type at index {index} already set"
3333 ) ;
@@ -39,13 +39,8 @@ impl GlobalsResolverBuilder {
3939 let types: Vec < Arc < TypeData > > = self
4040 . types
4141 . into_iter ( )
42- . enumerate ( )
43- . map ( |( i, opt) | {
44- Arc :: new ( opt. unwrap_or_else ( || {
45- // Make sure we only reserve just enough for what we need
46- panic ! ( "Type at index {i} was reserved but never filled" )
47- } ) )
48- } )
42+ . map ( |opt| Arc :: new (
43+ opt. unwrap_or ( TypeData :: Unknown ) ) )
4944 . collect ( ) ;
5045
5146 GlobalsResolver {
You can’t perform that action at this time.
0 commit comments