{"record":{"id":"d1f416cb2577d59b","repo":"swc-project/swc","slug":"swc-does-not-support-objectpropval-pattern-pat","errorCode":null,"errorMessage":"swc does not support ObjectPropVal::Pattern({pat:?})","messagePattern":"swc does not support ObjectPropVal::Pattern\\((.+?)\\)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/swc_estree_compat/src/swcify/expr.rs","lineNumber":533,"sourceCode":"                    span: expr.span(),\n                    expr,\n                })\n            }\n        }\n    }\n}\n\nimpl Swcify for ObjectProperty {\n    type Output = KeyValueProp;\n\n    fn swcify(self, ctx: &Context) -> Self::Output {\n        KeyValueProp {\n            key: self.key.swcify(ctx),\n            value: match self.value {\n                ObjectPropVal::Pattern(pat) => match pat {\n                    PatternLike::Id(i) => i.swcify(ctx).into(),\n                    _ => {\n                        panic!(\"swc does not support ObjectPropVal::Pattern({pat:?})\")\n                    }\n                },\n                ObjectPropVal::Expr(e) => e.swcify(ctx),\n            },\n        }\n    }\n}\n\nimpl Swcify for SequenceExpression {\n    type Output = SeqExpr;\n\n    fn swcify(self, ctx: &Context) -> Self::Output {\n        SeqExpr {\n            span: ctx.span(&self.base),\n            exprs: self.expressions.swcify(ctx),\n        }\n    }\n}","sourceCodeStart":515,"sourceCodeEnd":551,"githubUrl":"https://github.com/swc-project/swc/blob/5176682b65416c6b5de6b47379ae1588ea3ecb3f/crates/swc_estree_compat/src/swcify/expr.rs#L515-L551","documentation":"Raised in `Swcify for ObjectProperty` (swcify/expr.rs:533). Babel allows an object property whose value is a Pattern (shorthand/assignment-pattern forms) other than a simple identifier, e.g. `{a = 1} = ...` style defaults or computed destructuring. The code only rewrites PatternLike::Id into a key-value prop; any other pattern shape (AssignmentPattern, RestElement, ObjectPattern, ArrayPattern) has no swc KeyValueProp representation, so it panics. The pattern value that is not a plain identifier is the input at fault.","triggerScenarios":"Thrown at crates/swc_estree_compat/src/swcify/expr.rs:533 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Before swcifying, verify each ObjectProperty with a Pattern value only wraps a plain Identifier; reject others with a descriptive error","Extend the conversion to desugar non-identifier shorthand patterns (e.g. assignment defaults) into equivalent swc nodes if the semantics are representable","Handle the Babel AST stage that produces these pattern-valued properties earlier, so they never reach this conversion"],"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-14T05:17:10.506Z"}