Khan / Khan/live-editor

Yoko Oh Noes complains about a missing unreachable break statement.

Open
#539 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
776
Forks
180
PR merge metrics
No merged PRs in 30d

Description

Yoko Oh Noes complains that case 42 is unacceptable, yet case 43 is fine.

/*
- Yoko Oh Noes asks
- "Did you forget a 'break' statement before 'case'?"
- No, I did not.
_/
var x = function(i, j) {
var i;
switch (i) {
case 42:
if (j > 0) {
return (true);
} else {
return (false);
}
/_ break is not reachable here */
case 43:
return ("maybe");
case 44:
return ("could be");
}
};

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the reported switch statement in the browser-based live coding environment and observe the warning for case 42 versus case 43. Trace the diagnostic that reports a missing break, then verify that the unreachable break is not required while valid fall-through cases retain their expected behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.