mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-25 11:11:11 +08:00
fix: 迭代器原型形状补全(Iterator.prototype/string 中继层/next 原型化)
This commit is contained in:
@@ -323,11 +323,11 @@ pub fn map_size<H: VmHost>(vm: &mut H, args: &[u8]) -> NativeResult {
|
||||
pub fn map_entries<H: VmHost>(vm: &mut H, args: &[u8]) -> NativeResult {
|
||||
let this_val = vm.reg(if args.is_empty() { 0 } else { args[0] });
|
||||
let _inner = native_try!(get_map_inner(vm, this_val));
|
||||
NativeResult::Ok(crate::iterator::make_mode_iterator(
|
||||
NativeResult::Ok(crate::iterator::make_collection_iterator(
|
||||
vm,
|
||||
this_val,
|
||||
JsValue::from_js_object(vm.session().builtin_world().map_iterator_proto.as_ptr() as *mut JsObject),
|
||||
crate::iterator::map_entries_iter_next::<H> as *const (),
|
||||
crate::iterator::MapSetMode::MapEntries,
|
||||
))
|
||||
}
|
||||
|
||||
@@ -335,11 +335,11 @@ pub fn map_entries<H: VmHost>(vm: &mut H, args: &[u8]) -> NativeResult {
|
||||
pub fn map_values<H: VmHost>(vm: &mut H, args: &[u8]) -> NativeResult {
|
||||
let this_val = vm.reg(if args.is_empty() { 0 } else { args[0] });
|
||||
let _inner = native_try!(get_map_inner(vm, this_val));
|
||||
NativeResult::Ok(crate::iterator::make_mode_iterator(
|
||||
NativeResult::Ok(crate::iterator::make_collection_iterator(
|
||||
vm,
|
||||
this_val,
|
||||
JsValue::from_js_object(vm.session().builtin_world().map_iterator_proto.as_ptr() as *mut JsObject),
|
||||
crate::iterator::map_values_iter_next::<H> as *const (),
|
||||
crate::iterator::MapSetMode::MapValues,
|
||||
))
|
||||
}
|
||||
|
||||
@@ -347,10 +347,10 @@ pub fn map_values<H: VmHost>(vm: &mut H, args: &[u8]) -> NativeResult {
|
||||
pub fn map_keys<H: VmHost>(vm: &mut H, args: &[u8]) -> NativeResult {
|
||||
let this_val = vm.reg(if args.is_empty() { 0 } else { args[0] });
|
||||
let _inner = native_try!(get_map_inner(vm, this_val));
|
||||
NativeResult::Ok(crate::iterator::make_mode_iterator(
|
||||
NativeResult::Ok(crate::iterator::make_collection_iterator(
|
||||
vm,
|
||||
this_val,
|
||||
JsValue::from_js_object(vm.session().builtin_world().map_iterator_proto.as_ptr() as *mut JsObject),
|
||||
crate::iterator::map_keys_iter_next::<H> as *const (),
|
||||
crate::iterator::MapSetMode::MapKeys,
|
||||
))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user