{"record":{"id":"612fd4bbc8cc9034","repo":"swc-project/swc","slug":"failed-to-convert-assignmentexpression-of-babel","errorCode":null,"errorMessage":"failed to convert `AssignmentExpression` of babel: Unknown assignment operator {}","messagePattern":"failed to convert `AssignmentExpression` of babel: Unknown assignment operator (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/swc_estree_compat/src/swcify/expr.rs","lineNumber":107,"sourceCode":"impl Swcify for ArrayExpression {\n    type Output = ArrayLit;\n\n    fn swcify(self, ctx: &Context) -> Self::Output {\n        ArrayLit {\n            span: ctx.span(&self.base),\n            elems: self.elements.swcify(ctx),\n        }\n    }\n}\n\nimpl Swcify for AssignmentExpression {\n    type Output = AssignExpr;\n\n    fn swcify(self, ctx: &Context) -> Self::Output {\n        AssignExpr {\n            span: ctx.span(&self.base),\n            op: self.operator.parse().unwrap_or_else(|_| {\n                panic!(\n                    \"failed to convert `AssignmentExpression` of babel: Unknown assignment \\\n                     operator {}\",\n                    self.operator,\n                )\n            }),\n            left: self.left.swcify(ctx).try_into().unwrap(),\n            right: self.right.swcify(ctx),\n        }\n    }\n}\n\nimpl Swcify for BinaryExpression {\n    type Output = BinExpr;\n\n    fn swcify(self, ctx: &Context) -> Self::Output {\n        BinExpr {\n            span: ctx.span(&self.base),\n            op: self.operator.swcify(ctx),","sourceCodeStart":89,"sourceCodeEnd":125,"githubUrl":"https://github.com/swc-project/swc/blob/5176682b65416c6b5de6b47379ae1588ea3ecb3f/crates/swc_estree_compat/src/swcify/expr.rs#L89-L125","documentation":"Raised in `Swcify for AssignmentExpression` (swcify/expr.rs:107). The Babel AST stores the assignment operator as a string; the code parses it into swc's AssignOp. If the operator string is not one that swc_ecma_ast recognizes (a malformed, exotic, or future operator token), the parse fails and the closure panics. The operator string itself is the faulty input.","triggerScenarios":"Thrown at crates/swc_estree_compat/src/swcify/expr.rs:107 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the failing operator string (include it in the panic message) and either extend the parse mapping in swc to accept it or normalize it before swcify","Validate the Babel AST before conversion: verify each AssignmentExpression.operator is a known operator","Fall back to a plain `=` assignment or reject the file with a proper error instead of panicking"],"exampleFix":null,"handlingStrategy":"fallback","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"}