LookupWith: retry

This commit is contained in:
2026-04-18 16:44:06 +08:00
parent f372ebcb8e
commit df9664f5c4
3 changed files with 119 additions and 120 deletions
+3 -2
View File
@@ -336,10 +336,11 @@ impl<'a, Ctx: DisassemblerContext> Disassembler<'a, Ctx> {
}
Op::PushWith => ("PushWith", String::new()),
Op::PopWith => ("PopWith", String::new()),
Op::WithLookup => {
Op::PrepareWith => ("PrepareWith", String::new()),
Op::LookupWith => {
let idx = self.read_u32();
let name = self.ctx.resolve_string(idx);
("WithLookup", format!("{:?}", name))
("LookupWith", format!("{:?}", name))
}
Op::LoadBuiltins => ("LoadBuiltins", String::new()),
+4 -2
View File
@@ -79,7 +79,8 @@ pub enum Op {
PushWith,
PopWith,
WithLookup,
LookupWith,
PrepareWith,
LoadBuiltins,
LoadBuiltin,
@@ -625,7 +626,8 @@ impl<'a, Ctx: BytecodeContext> BytecodeEmitter<'a, Ctx> {
self.emit_with(namespace, body, thunks);
}
&Ir::WithLookup(name) => {
self.emit_op(Op::WithLookup);
self.emit_op(Op::PrepareWith);
self.emit_op(Op::LookupWith);
self.emit_str_id(name);
}
}