{"record":{"id":"d69041f64c278f0a","repo":"swc-project/swc","slug":"pattern","errorCode":null,"errorMessage":"Pattern {:?}","messagePattern":"Pattern (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/swc_ecma_compat_es2015/src/destructuring.rs","lineNumber":470,"sourceCode":"                    // tmp === void 0 ? def_value : tmp\n                    Some(Box::new(make_cond_expr(tmp_ident, def_value)))\n                } else {\n                    Some(def_value)\n                };\n\n                let var_decl = VarDeclarator {\n                    span,\n                    name: *left,\n                    init,\n                    definite: false,\n                };\n\n                let mut var_decls = vec![var_decl];\n                var_decls.visit_mut_with(self);\n                decls.extend(var_decls);\n            }\n\n            _ => unimplemented!(\"Pattern {:?}\", decl),\n        }\n    }\n}\n\n#[fast_path(DestructuringVisitor)]\nimpl VisitMut for Destructuring {\n    noop_visit_mut_type!(fail);\n\n    impl_for_for_stmt!(visit_mut_for_in_stmt, ForInStmt);\n\n    impl_for_for_stmt!(visit_mut_for_of_stmt, ForOfStmt);\n\n    impl_visit_mut_fn!();\n\n    fn visit_mut_module_items(&mut self, n: &mut Vec<ModuleItem>) {\n        self.visit_mut_stmt_like(n);\n    }\n","sourceCodeStart":452,"sourceCodeEnd":488,"githubUrl":"https://github.com/swc-project/swc/blob/5176682b65416c6b5de6b47379ae1588ea3ecb3f/crates/swc_ecma_compat_es2015/src/destructuring.rs#L452-L488","documentation":"The ES2015 destructuring pass hit a binding pattern in a variable declarator that it cannot expand into ES5 assignments; it panics naming the pattern with {:?}. Raised in visit_mut_var_decl while lowering `var/let/const` declarators, meaning only some pattern shapes (ident/object/array) are implemented.","triggerScenarios":"Thrown at crates/swc_ecma_compat_es2015/src/destructuring.rs:470 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the debug-printed pattern to identify which binding form is unsupported","Add a lowering arm for that pattern kind in the destructuring visitor","Ensure earlier passes normalize the pattern before it reaches visit_mut_var_decl"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5176682b65416c6b5de6b47379ae1588ea3ecb3f","analyzedAt":"2026-08-17T16:16:52.067Z","contentChangedAt":"2026-08-17T16:16:52.067Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}