feat: ZonedDateTime.from 三分支解析(字符串/对象/property bag + offset/disambiguation 选项)

This commit is contained in:
2026-08-16 22:50:48 +08:00
parent e2d43a8dfb
commit 0e88377ea4
3 changed files with 445 additions and 2 deletions
@@ -148,6 +148,12 @@ pub fn bind_temporal(core: &Arc<KernelCore>, session: &KernelSession, global: &m
.map_or(0, |props| props.len() as u32)
.saturating_sub(1);
zoned_date_time_ctor.set_data_meta(length_pos, PropAttributes::new(false, false, true));
apply_binding_table(
world,
zoned_date_time_ctor,
core,
&[("from", oxide_builtins::temporal::zoned_date_time_from::<crate::vm::Vm> as *const (), 1)],
);
let zoned_date_time_proto_ptr = world.zoned_date_time_proto.as_ptr() as *mut JsObject;
let zoned_date_time_proto = unsafe { &mut *zoned_date_time_proto_ptr };