mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-24 02:31:13 +08:00
fix: 修复编译空语句残留上一句返回值问题
This commit is contained in:
@@ -153,8 +153,9 @@ impl Compiler {
|
||||
|
||||
let mut last_result: Option<u8> = None;
|
||||
for stmt in &program.body {
|
||||
if let Some(r) = self.emit_statement(stmt, &mut ctx)? {
|
||||
last_result = Some(r);
|
||||
match self.emit_statement(stmt, &mut ctx)? {
|
||||
Some(r) => last_result = Some(r),
|
||||
None => last_result = None,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user