{"record":{"id":"a7ba780daf1ba208","repo":"swc-project/swc","slug":"computed-spread-property","errorCode":null,"errorMessage":"computed spread property","messagePattern":"computed spread property","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/swc_ecma_compat_es2015/src/computed_props.rs","lineNumber":225,"sourceCode":"                                }\n                                .into(),\n                            );\n\n                            continue;\n                            // unimplemented!(\"getter /setter property\")\n                        }\n                        Prop::Method(MethodProp { key, function }) => (\n                            prop_name_to_expr(key, self.c.loose),\n                            FnExpr {\n                                ident: None,\n                                function,\n                            }\n                            .into(),\n                        ),\n                        #[cfg(swc_ast_unknown)]\n                        _ => panic!(\"unable to access unknown nodes\"),\n                    },\n                    PropOrSpread::Spread(..) => unimplemented!(\"computed spread property\"),\n                    #[cfg(swc_ast_unknown)]\n                    _ => panic!(\"unable to access unknown nodes\"),\n                };\n\n                if !self.c.loose && props_cnt == 1 {\n                    single_cnt_prop = Some(\n                        CallExpr {\n                            span,\n                            callee: helper!(define_property),\n                            args: vec![exprs.pop().unwrap().as_arg(), key.as_arg(), value.as_arg()],\n                            ..Default::default()\n                        }\n                        .into(),\n                    );\n                    break;\n                }\n                exprs.push(if self.c.loose {\n                    let left = if is_compute {","sourceCodeStart":207,"sourceCodeEnd":243,"githubUrl":"https://github.com/swc-project/swc/blob/5176682b65416c6b5de6b47379ae1588ea3ecb3f/crates/swc_ecma_compat_es2015/src/computed_props.rs#L207-L243","documentation":"The ES2015 computed-properties transform encounters an object spread element whose key is computed, a combination the pass has no ES5 lowering for, and aborts via unimplemented! inside visit_mut_expr. It means the input uses a spread property with a computed key that this pass cannot transpile, not that the code is invalid JavaScript.","triggerScenarios":"Thrown at crates/swc_ecma_compat_es2015/src/computed_props.rs:225 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Run the object spread / rest-spread lowering pass before the computed-props pass so this shape never arrives","Restructure the source to avoid a computed key on a spread property","Guard the Prop variant in visit_mut_expr and handle the spread case explicitly"],"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"}