mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-25 03:01:12 +08:00
fix: 修复全局边界安全与内存稳定性问题
This commit is contained in:
@@ -31,6 +31,14 @@ fn compile_simple_expr() {
|
||||
assert_eq!(last, OpCode::HALT);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_constant_pool_overflow_range_error() {
|
||||
let expr = (0..70_000).map(|i| i.to_string()).collect::<Vec<_>>().join(",");
|
||||
let source = format!("var a=[{expr}]; a");
|
||||
let err = compile_source_err(&source);
|
||||
assert!(err.contains("too many constants"), "unexpected error: {err}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn compile_logical_assignment_vars() {
|
||||
compile_source("let x = 0; x ||= 1;");
|
||||
|
||||
Reference in New Issue
Block a user