2017-03-17 16:08:36 +01:00
|
|
|
switch (node && node.type) {
|
|
|
|
|
case "Property":
|
|
|
|
|
case "MethodDefinition":
|
|
|
|
|
prop = node.key;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case "MemberExpression":
|
|
|
|
|
prop = node.property;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
// no default
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
switch (foo) {
|
|
|
|
|
case "bar":
|
|
|
|
|
doThing()
|
|
|
|
|
|
|
|
|
|
// no default
|
|
|
|
|
}
|
2017-04-05 20:27:14 -03:00
|
|
|
|
|
|
|
|
switch (foo) {
|
|
|
|
|
case "bar": //comment
|
|
|
|
|
doThing(); //comment
|
|
|
|
|
|
|
|
|
|
case "baz":
|
|
|
|
|
doOtherThing(); //comment
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
switch (foo) {
|
|
|
|
|
case "bar": {
|
|
|
|
|
doThing();
|
|
|
|
|
} //comment
|
|
|
|
|
|
|
|
|
|
case "baz": {
|
|
|
|
|
doThing();
|
|
|
|
|
} //comment
|
|
|
|
|
}
|