mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-26 02:17:34 +09:00
Issue #1240 - Part 7 - Handle BigInt values in XPCVariant code. https://bugzilla.mozilla.org/show_bug.cgi?id=1603055
This commit is contained in:
parent
1355043d40
commit
4a3f1b7570
1 changed files with 5 additions and 5 deletions
|
|
@ -179,7 +179,7 @@ XPCArrayHomogenizer::GetTypeForArray(JSContext* cx, HandleObject array,
|
||||||
type = tDbl;
|
type = tDbl;
|
||||||
} else if (val.isBoolean()) {
|
} else if (val.isBoolean()) {
|
||||||
type = tBool;
|
type = tBool;
|
||||||
} else if (val.isUndefined() || val.isSymbol()) {
|
} else if (val.isUndefined() || val.isSymbol() || val.isBigInt()) {
|
||||||
state = tVar;
|
state = tVar;
|
||||||
break;
|
break;
|
||||||
} else if (val.isNull()) {
|
} else if (val.isNull()) {
|
||||||
|
|
@ -187,7 +187,7 @@ XPCArrayHomogenizer::GetTypeForArray(JSContext* cx, HandleObject array,
|
||||||
} else if (val.isString()) {
|
} else if (val.isString()) {
|
||||||
type = tStr;
|
type = tStr;
|
||||||
} else {
|
} else {
|
||||||
MOZ_ASSERT(val.isObject(), "invalid type of jsval!");
|
MOZ_RELEASE_ASSERT(val.isObject(), "invalid type of jsval!");
|
||||||
jsobj = &val.toObject();
|
jsobj = &val.toObject();
|
||||||
|
|
||||||
bool isArray;
|
bool isArray;
|
||||||
|
|
@ -273,8 +273,8 @@ bool XPCVariant::InitializeData(JSContext* cx)
|
||||||
mData.SetFromBool(val.toBoolean());
|
mData.SetFromBool(val.toBoolean());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
// We can't represent symbol on C++ side, so pretend it is void.
|
// We can't represent symbol or BigInt on C++ side, so pretend it is void.
|
||||||
if (val.isUndefined() || val.isSymbol()) {
|
if (val.isUndefined() || val.isSymbol() || val.isBigInt()) {
|
||||||
mData.SetToVoid();
|
mData.SetToVoid();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
@ -302,7 +302,7 @@ bool XPCVariant::InitializeData(JSContext* cx)
|
||||||
}
|
}
|
||||||
|
|
||||||
// leaving only JSObject...
|
// leaving only JSObject...
|
||||||
MOZ_ASSERT(val.isObject(), "invalid type of jsval!");
|
MOZ_RELEASE_ASSERT(val.isObject(), "invalid type of jsval!");
|
||||||
|
|
||||||
RootedObject jsobj(cx, &val.toObject());
|
RootedObject jsobj(cx, &val.toObject());
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue