fix: 未声明标识符读取抛 ReferenceError(typeof 特判返回 undefined)

This commit is contained in:
2026-08-16 00:10:08 +08:00
parent 69152ad608
commit 75153a909d
9 changed files with 287 additions and 6 deletions
+2
View File
@@ -738,6 +738,8 @@ mod tests {
assert_contract(OpCode::LOAD_VAR, Some(1), &[2], true);
assert_contract(OpCode::STORE_VAR, Some(1), &[2], false);
assert_contract(OpCode::LOAD_CONST, Some(1), &[], true);
assert_contract(OpCode::LOAD_GLOBAL, Some(1), &[], false);
assert_contract(OpCode::LOAD_GLOBAL_TYPEOF, Some(1), &[], false);
assert_contract(OpCode::LOAD_UPVALUE, Some(1), &[], true);
assert_contract(OpCode::CREATE_CLOSURE, Some(1), &[], true);
assert_contract(OpCode::STORE_UPVALUE, None, &[2], false);