{"record":{"id":"523caf27de2070e4","repo":"swc-project/swc","slug":"not-implemented","errorCode":null,"errorMessage":"not implemented","messagePattern":"not implemented","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"info","filePath":"crates/swc_ecma_transforms_module/src/top_level_this.rs","lineNumber":75,"sourceCode":"                ..\n            }) => computed.visit_mut_children_with(self),\n            _ => {}\n        }\n    }\n\n    fn visit_mut_expr(&mut self, n: &mut Expr) {\n        if let Expr::This(ThisExpr { span }) = n {\n            self.found = true;\n\n            let mut this = self.this.clone();\n            match &mut this {\n                // for void 0\n                Expr::Unary(unary_expr) => unary_expr.span = *span,\n                Expr::Ident(ident) => ident.span = *span,\n                Expr::Member(member) => member.span = *span,\n\n                _ => {\n                    unimplemented!();\n                }\n            }\n\n            *n = this;\n        } else {\n            n.visit_mut_children_with(self);\n        }\n    }\n}\n","sourceCodeStart":57,"sourceCodeEnd":85,"githubUrl":"https://github.com/swc-project/swc/blob/d7d74346665e36e692aa07e13d4ee3ee692ee35c/crates/swc_ecma_transforms_module/src/top_level_this.rs#L57-L85","documentation":"Module transforms (CJS/AMD/UMD/SystemJS) rewrite top-level `this` via a crate-private util that clones the replacement expression per occurrence and only adjusts spans for `Unary` (`void 0`), `Ident` and `Member` replacements. Every in-tree caller passes `Expr::undefined(DUMMY_SP)` (`void 0`), so the bare `unimplemented!()` fires only when the util is changed to use a replacement expression of another shape (call, arrow, sequence, ...).","triggerScenarios":"Not reachable through public configuration; only swc contributors adding a new module format or changing the replacement expression (e.g. to `globalThis` written as a non-Member/Ident node) hit it.","commonSituations":"Fork or patch work on swc_ecma_transforms_module introducing a module format whose `this` binding is an arbitrary expression.","solutions":["Use one of the supported replacement shapes: Ident, `void 0`, or a MemberExpr","Extend the match arm to set the span (or wrap in Paren) for the new Expr variant","Report upstream with the replacement expression you need"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Contributors: keep top-level `this` replacements as Ident, `void 0`, or MemberExpr","When adding a module format, extend the span-fixup match arm together with the new replacement expression"],"tags":["internal","module-transforms","top-level-this"],"backgroundTag":null,"analyzedSha":"d7d74346665e36e692aa07e13d4ee3ee692ee35c","analyzedAt":"2026-08-16T12:41:13.160Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}