mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-03 14:28:39 +09:00
Issue #2308 & #1240 Follow-up - Replace JSOP_POS in ++/-- with JSOP_TONUMERIC. https://bugzilla.mozilla.org/show_bug.cgi?id=1519135
This commit is contained in:
parent
2b637c564f
commit
209d714434
28 changed files with 251 additions and 77 deletions
|
|
@ -1357,5 +1357,19 @@ CheckIsCallable(JSContext* cx, HandleValue v, CheckIsCallableKind kind)
|
|||
return true;
|
||||
}
|
||||
|
||||
template <bool allowBigInt = false>
|
||||
static bool DoToNumeric(JSContext* cx, HandleValue arg, MutableHandleValue ret)
|
||||
{
|
||||
ret.set(arg);
|
||||
if (allowBigInt) {
|
||||
return ToNumeric(cx, ret);
|
||||
}
|
||||
return ToNumber(cx, ret);
|
||||
}
|
||||
|
||||
typedef bool (*ToNumericFn)(JSContext*, HandleValue, MutableHandleValue);
|
||||
const VMFunction ToNumberInfo = FunctionInfo<ToNumericFn>(DoToNumeric, "ToNumber");
|
||||
const VMFunction ToNumericInfo = FunctionInfo<ToNumericFn>(DoToNumeric<true>, "ToNumeric");
|
||||
|
||||
} // namespace jit
|
||||
} // namespace js
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue