mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-26 03:31:12 +08:00
fix: 修复同步调用参数限制与内建语义错误
This commit is contained in:
@@ -126,3 +126,13 @@ fn boolean_primitive_value_of_autoboxes() {
|
||||
let r = eval(&mut vm, "(true).constructor === Boolean").unwrap();
|
||||
assert_eq!(r, JsValue::bool(true));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn boolean_boxes_participate_in_numeric_coercion() {
|
||||
let mut vm = Vm::new();
|
||||
let r = eval(&mut vm, "+new Boolean(true)").unwrap();
|
||||
assert_eq!(r.as_double(), 1.0);
|
||||
|
||||
let r = eval(&mut vm, "new Boolean(false) | 0").unwrap();
|
||||
assert_eq!(r.as_int(), 0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user