refactor(compiler): remove statement jump count helpers
This commit is contained in:
@@ -218,6 +218,18 @@ fn compile_switch_break() {
|
||||
assert!(!module.bytecode.is_empty());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn compile_try_finally_resolves_finally_offset() {
|
||||
let module = compile_source("try { 1; } finally { 2; }");
|
||||
let try_finally_begin = module
|
||||
.bytecode
|
||||
.iter()
|
||||
.copied()
|
||||
.find(|&instr| opcode::opcode(instr) == OpCode::TRY_FINALLY_BEGIN)
|
||||
.expect("try/finally should emit TRY_FINALLY_BEGIN");
|
||||
assert_ne!(opcode::offset16(try_finally_begin), 0, "finally target offset should be resolved");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn compile_continue_in_switch_errors() {
|
||||
let result = std::panic::catch_unwind(|| {
|
||||
|
||||
Reference in New Issue
Block a user