mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-23 18:21:13 +08:00
style: rustfmt 折行同步
This commit is contained in:
@@ -1455,10 +1455,8 @@ fn get_iterator<H: VmHost>(vm: &mut H, value: JsValue) -> Result<Option<(JsValue
|
||||
// 内建集合标记:仅当 @@iterator 经原型链读到的仍是内建默认迭代器函数
|
||||
// 时才走快速路径;用户覆盖(自身属性或原型链改写/删除)走通用协议
|
||||
// 调用用户函数。
|
||||
let builtin_value = is_array_value(value)
|
||||
|| is_typed_array_value(value)
|
||||
|| is_map_value(value)
|
||||
|| is_set_value(value);
|
||||
let builtin_value =
|
||||
is_array_value(value) || is_typed_array_value(value) || is_map_value(value) || is_set_value(value);
|
||||
|
||||
// 非字符串 primitive(boolean/number/symbol/bigint):GetIterator 先 ToObject,
|
||||
// 再走迭代协议(如 `yield* true` 委托 Boolean.prototype[Symbol.iterator])。
|
||||
|
||||
@@ -2332,7 +2332,11 @@ pub fn zoned_date_time_with<H: VmHost>(vm: &mut H, args: &[u8]) -> NativeResult
|
||||
merged.microsecond,
|
||||
merged.nanosecond,
|
||||
];
|
||||
if values.iter().zip(limits.iter()).any(|(value, limit)| *value < 0.0 || *value > *limit) {
|
||||
if values
|
||||
.iter()
|
||||
.zip(limits.iter())
|
||||
.any(|(value, limit)| *value < 0.0 || *value > *limit)
|
||||
{
|
||||
return NativeResult::Err(crate::error::create_range_error(vm, "invalid time component"));
|
||||
}
|
||||
(values[0], values[1], values[2], values[3], values[4], values[5])
|
||||
@@ -4762,7 +4766,10 @@ pub fn plain_time_with<H: VmHost>(vm: &mut H, args: &[u8]) -> NativeResult {
|
||||
let minute = native_try!(read(vm, "minute"));
|
||||
let nanosecond = native_try!(read(vm, "nanosecond"));
|
||||
let second = native_try!(read(vm, "second"));
|
||||
if [hour, microsecond, millisecond, minute, nanosecond, second].iter().all(|c| c.is_none()) {
|
||||
if [hour, microsecond, millisecond, minute, nanosecond, second]
|
||||
.iter()
|
||||
.all(|c| c.is_none())
|
||||
{
|
||||
return NativeResult::Err(crate::error::create_type_error(vm, "no properties present"));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user