mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-01 04:47:31 +09:00
Issue #2308 - Fix JSON BigInt regressions. https://bugzilla.mozilla.org/show_bug.cgi?id=1522433
This commit is contained in:
parent
470af6ba50
commit
e9202b0b0f
1 changed files with 8 additions and 3 deletions
|
|
@ -277,10 +277,15 @@ PreprocessValue(JSContext* cx, HandleObject holder, KeyType key, MutableHandleVa
|
||||||
|
|
||||||
RootedString keyStr(cx);
|
RootedString keyStr(cx);
|
||||||
|
|
||||||
/* Step 2. */
|
// Step 2. Modified by BigInt spec 6.1 to check for a toJSON method on the
|
||||||
if (vp.isObject()) {
|
// BigInt prototype when the value is a BigInt.
|
||||||
|
if (vp.isObject() || vp.isBigInt()) {
|
||||||
RootedValue toJSON(cx);
|
RootedValue toJSON(cx);
|
||||||
RootedObject obj(cx, &vp.toObject());
|
RootedObject obj(cx, JS::ToObject(cx, vp));
|
||||||
|
if (!obj) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (!GetProperty(cx, obj, obj, cx->names().toJSON, &toJSON))
|
if (!GetProperty(cx, obj, obj, cx->names().toJSON, &toJSON))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue