mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Make check for valid resumption value a bit more legible.
This commit is contained in:
parent
fd054f5c39
commit
041108b07b
@ -392,13 +392,19 @@ Debug::parseResumptionValue(AutoCompartment &ac, bool ok, const Value &rv, Value
|
||||
const Shape *shape;
|
||||
jsid returnId = ATOM_TO_JSID(cx->runtime->atomState.returnAtom);
|
||||
jsid throwId = ATOM_TO_JSID(cx->runtime->atomState.throwAtom);
|
||||
if (!rv.isObject() ||
|
||||
!(obj = &rv.toObject())->isObject() ||
|
||||
!(shape = obj->lastProperty())->previous() ||
|
||||
shape->previous()->previous() ||
|
||||
(shape->propid != returnId && shape->propid != throwId) ||
|
||||
!shape->isDataDescriptor())
|
||||
{
|
||||
bool okResumption = rv.isObject();
|
||||
if (okResumption) {
|
||||
obj = &rv.toObject();
|
||||
okResumption = obj->isObject();
|
||||
}
|
||||
if (okResumption) {
|
||||
shape = obj->lastProperty();
|
||||
okResumption = shape->previous() &&
|
||||
!shape->previous()->previous() &&
|
||||
(shape->propid == returnId || shape->propid == throwId) &&
|
||||
shape->isDataDescriptor();
|
||||
}
|
||||
if (!okResumption) {
|
||||
JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL, JSMSG_DEBUG_BAD_RESUMPTION);
|
||||
return handleUncaughtException(ac, vp, callHook);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user