mirror of
https://github.com/swc-project/swc.git
synced 2024-10-04 12:18:08 +03:00
fix(es/es2015): Remove needless unreachable!
(#9021)
**Related issue:** - Closes #9020
This commit is contained in:
parent
e3dfa8707a
commit
555e71cfd5
19
crates/swc/tests/fixture/issues-9xxx/9020/input/.swcrc
Normal file
19
crates/swc/tests/fixture/issues-9xxx/9020/input/.swcrc
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
"jsc": {
|
||||||
|
"parser": {
|
||||||
|
"syntax": "ecmascript",
|
||||||
|
"jsx": false
|
||||||
|
},
|
||||||
|
"target": "es5",
|
||||||
|
"loose": false,
|
||||||
|
"minify": {
|
||||||
|
"compress": false,
|
||||||
|
"mangle": false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"module": {
|
||||||
|
"type": "es6"
|
||||||
|
},
|
||||||
|
"minify": false,
|
||||||
|
"isModule": true
|
||||||
|
}
|
4
crates/swc/tests/fixture/issues-9xxx/9020/input/1.js
Normal file
4
crates/swc/tests/fixture/issues-9xxx/9020/input/1.js
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
const student = {
|
||||||
|
name: "Tom",
|
||||||
|
age = 12
|
||||||
|
};
|
4
crates/swc/tests/fixture/issues-9xxx/9020/output/1.js
Normal file
4
crates/swc/tests/fixture/issues-9xxx/9020/output/1.js
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
var student = {
|
||||||
|
name: "Tom",
|
||||||
|
age=12
|
||||||
|
};
|
@ -64,7 +64,7 @@ impl VisitMut for PropFolder {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Prop::Assign(..) => unreachable!("assign property in object literal is invalid"),
|
Prop::Assign(..) => {}
|
||||||
|
|
||||||
Prop::Getter(..) => prop.visit_mut_children_with(&mut PropNameFolder {
|
Prop::Getter(..) => prop.visit_mut_children_with(&mut PropNameFolder {
|
||||||
props: &mut self.getter_props,
|
props: &mut self.getter_props,
|
||||||
|
Loading…
Reference in New Issue
Block a user