mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-07 08:18:41 +09:00
903389 - Fix uses of ClassMethodIsNative.
This commit is contained in:
parent
ee1e2aba19
commit
2391e18681
8 changed files with 73 additions and 71 deletions
|
|
@ -461,9 +461,13 @@ ToStringForStringFunction(JSContext* cx, HandleValue thisv)
|
|||
RootedObject obj(cx, &thisv.toObject());
|
||||
if (obj->is<StringObject>()) {
|
||||
StringObject* nobj = &obj->as<StringObject>();
|
||||
Rooted<jsid> id(cx, NameToId(cx->names().toString));
|
||||
if (ClassMethodIsNative(cx, nobj, &StringObject::class_, id, str_toString))
|
||||
// We have to make sure that the ToPrimitive call from ToString
|
||||
// would be unobservable.
|
||||
if (HasNoToPrimitiveMethodPure(nobj, cx) &&
|
||||
HasNativeMethodPure(nobj, cx->names().toString, str_toString, cx))
|
||||
{
|
||||
return nobj->unbox();
|
||||
}
|
||||
}
|
||||
} else if (thisv.isNullOrUndefined()) {
|
||||
JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_CANT_CONVERT_TO,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue