mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-24 02:31:13 +08:00
feat: 支持 Infinity 常量
This commit is contained in:
@@ -88,6 +88,7 @@ impl OxideKernel {
|
||||
|
||||
let si_nan = string_forge.intern("NaN").0;
|
||||
let si_undef = string_forge.intern("undefined").0;
|
||||
let si_infinity = string_forge.intern("Infinity").0;
|
||||
|
||||
let nan_shape = shape_forge.make_shape(EMPTY_SHAPE_ID, si_nan);
|
||||
global_obj.set_shape_id(nan_shape);
|
||||
@@ -101,6 +102,12 @@ impl OxideKernel {
|
||||
.ensure_hash_props()
|
||||
.push(Box::new(JsValue::undefined()));
|
||||
|
||||
let inf_shape = shape_forge.make_shape(undef_shape, si_infinity);
|
||||
global_obj.set_shape_id(inf_shape);
|
||||
global_obj
|
||||
.ensure_hash_props()
|
||||
.push(Box::new(JsValue::float(f64::INFINITY)));
|
||||
|
||||
let global_object = P::new(global_obj);
|
||||
|
||||
Self {
|
||||
|
||||
Reference in New Issue
Block a user