mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-24 18:51:13 +08:00
style: 自动格式化
This commit is contained in:
@@ -280,7 +280,11 @@ impl Vm {
|
||||
parts.push(rhs);
|
||||
for ® in rest {
|
||||
let v = self.regs[reg];
|
||||
let prim = if v.is_object() { self.coerce_primitive_bounded(v, coercion::ToPrimitiveHint::Number)? } else { v };
|
||||
let prim = if v.is_object() {
|
||||
self.coerce_primitive_bounded(v, coercion::ToPrimitiveHint::Number)?
|
||||
} else {
|
||||
v
|
||||
};
|
||||
// 字符串模式对全部操作数做 ToString,Symbol 按 §7.1.17 抛 TypeError。
|
||||
if prim.is_symbol() {
|
||||
self.raise_type_error("Cannot convert a Symbol value to a string")?;
|
||||
|
||||
@@ -74,7 +74,11 @@ impl Vm {
|
||||
return Ok(result);
|
||||
}
|
||||
|
||||
let method_names = if hint.prefer_string() { ["toString", "valueOf"] } else { ["valueOf", "toString"] };
|
||||
let method_names = if hint.prefer_string() {
|
||||
["toString", "valueOf"]
|
||||
} else {
|
||||
["valueOf", "toString"]
|
||||
};
|
||||
|
||||
for method_name in method_names {
|
||||
let method_si = self.kernel_core.perm_interner().intern(method_name).0;
|
||||
|
||||
Reference in New Issue
Block a user