From e87445cc1aa7ff69446753a844a2fa74e9e75053 Mon Sep 17 00:00:00 2001 From: Don Isaac Date: Tue, 4 Jul 2023 02:52:52 -0400 Subject: [PATCH] hotfix: remove panic! from binding resolution (#512) --- crates/oxc_linter/src/rules/eslint/no_obj_calls.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/oxc_linter/src/rules/eslint/no_obj_calls.rs b/crates/oxc_linter/src/rules/eslint/no_obj_calls.rs index 5aa52c6d7b540..3619ac522a037 100644 --- a/crates/oxc_linter/src/rules/eslint/no_obj_calls.rs +++ b/crates/oxc_linter/src/rules/eslint/no_obj_calls.rs @@ -91,7 +91,9 @@ fn resolve_global_binding<'a, 'b: 'a>( let nodes = ctx.nodes(); let symbols = ctx.symbols(); scope.get_binding(scope_id, &ident.name).map_or_else(|| { - panic!("No binding id found, but this IdentifierReference is not a global"); + // panic!("No binding id found for {}, but this IdentifierReference + // is not a global", &ident.name); + None }, |binding_id| { let decl = nodes.get_node(symbols.get_declaration(binding_id)); let decl_scope = decl.scope_id();