mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-08-31 11:58:40 +09:00
Issue #1240 - Follow-up: Fix incorrect values in Number() constructor. https://bugzilla.mozilla.org/show_bug.cgi?id=1466893 Our code base was using the return value to create the Number object. However with the BigInt changes, it is no longer stored in rval, use args[0].
This commit is contained in:
parent
b7e487bdf1
commit
df03810723
1 changed files with 3 additions and 1 deletions
|
|
@ -545,7 +545,9 @@ Number(JSContext* cx, unsigned argc, Value* vp)
|
|||
RootedObject proto(cx);
|
||||
if (!GetPrototypeFromConstructor(cx, newTarget, &proto))
|
||||
return false;
|
||||
JSObject* obj = NumberObject::create(cx, args.rval().toNumber(), proto);
|
||||
|
||||
double d = args.length() > 0 ? args[0].toNumber() : 0;
|
||||
JSObject* obj = NumberObject::create(cx, d, proto);
|
||||
if (!obj)
|
||||
return false;
|
||||
args.rval().setObject(*obj);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue