-
-
Notifications
You must be signed in to change notification settings - Fork 503
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:oxc-project/oxc into don/07-10-feat…
…_linter_add_fixer_for_jsx-a11y/aria-props
- Loading branch information
Showing
5 changed files
with
51 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
use oxc_cfg::{ControlFlowGraphBuilder, CtxCursor}; | ||
use oxc_syntax::node::AstNodeId; | ||
/// same as but just the skeleton | ||
/// ```js | ||
/// A: { | ||
/// do {} while (a); | ||
/// do {} while (b); | ||
/// break A; | ||
/// } | ||
/// ``` | ||
#[test] | ||
fn labeled_statement_with_multiple_loops_continue_and_break() { | ||
const A: Option<&str> = Some("A"); | ||
|
||
let mut cfg = ControlFlowGraphBuilder::default(); | ||
cfg.attach_error_harness(oxc_cfg::ErrorEdgeKind::Implicit); | ||
|
||
// labeled block start | ||
let labeled = cfg.new_basic_block_normal(); | ||
cfg.ctx(A).default().allow_break().allow_continue(); | ||
|
||
// loop context 1 | ||
let c1 = cfg.new_basic_block_normal(); | ||
cfg.ctx(None).default().allow_break().allow_continue(); | ||
cfg.ctx(None).mark_break(c1).mark_continue(c1).resolve_with_upper_label(); | ||
|
||
// loop context 2 | ||
let c2 = cfg.new_basic_block_normal(); | ||
cfg.ctx(None).default().allow_break().allow_continue(); | ||
cfg.ctx(None).mark_break(c2).mark_continue(c2).resolve_with_upper_label(); | ||
|
||
cfg.append_break(AstNodeId::dummy(), A); | ||
|
||
// labeled block end | ||
cfg.ctx(A).mark_break(labeled).resolve(); | ||
|
||
cfg.build(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters