case
statements found JS-0064 73 if (strings) cacheWriteQueue.push({ lang, ns, strings })
74 langResult.set(ns, strings)
75 }
76 default: { 77 log.info('fetching dynamic', ns) 78 const file = databaseFile 79 const strings = await fetchCrowdinDbKey(ns, file, lang) 80 if (strings) cacheWriteQueue.push({ lang, ns, strings }) 81 langResult.set(ns, strings) 82 } 83 }
84 })
85 )
57 }
58 }
59 }
60 default: 61 return t('close') 62 }
63 })()
64
356 break
357 }
358 }
359 default: {360 break361 }362 }
363 return subsections
364 }, attributeCategories)
If the fallthrough is intentional in the code, there is no way to indicate this intent in the language.
It's considered a best practice to always indicate when a fallthrough is intentional using a comment which matches the /falls?\s?through/i
regular expression.
switch(foo) {
case 1: doSomething();
case 2: doSomethingElse();
}
switch(foo) {
case 1:
doSomething();
break;
case 2:
doSomethingElse();
}
function bar(foo) {
switch(foo) {
case 1:
doSomething();
return;
case 2:
doSomething();
}
}
switch(foo) {
case 1:
doSomething();
throw new Error("Boo!");
case 2:
doSomething();
}
switch(foo) {
case 1:
case 2:
doSomething();
}
switch(foo) {
case 1:
doSomething();
// falls through
case 2:
doSomething();
}