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