Bug 918170 - Handle StopIteration in CPOWs (r=dvander)
This commit is contained in:
@@ -601,11 +601,14 @@ JavaScriptParent::ipcfail(JSContext *cx)
|
||||
bool
|
||||
JavaScriptParent::ok(JSContext *cx, const ReturnStatus &status)
|
||||
{
|
||||
if (status.ok())
|
||||
if (status.type() == ReturnStatus::TReturnSuccess)
|
||||
return true;
|
||||
|
||||
if (status.type() == ReturnStatus::TReturnStopIteration)
|
||||
return JS_ThrowStopIteration(cx);
|
||||
|
||||
RootedValue exn(cx);
|
||||
if (!toValue(cx, status.exn(), &exn))
|
||||
if (!toValue(cx, status.get_ReturnException().exn(), &exn))
|
||||
return false;
|
||||
|
||||
JS_SetPendingException(cx, exn);
|
||||
@@ -657,7 +660,7 @@ JavaScriptParent::instanceOf(JSObject *obj, const nsID *id, bool *bp)
|
||||
if (!CallInstanceOf(objId, iid, &status, bp))
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
|
||||
if (!status.ok())
|
||||
if (status.type() != ReturnStatus::TReturnSuccess)
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
|
||||
return NS_OK;
|
||||
@@ -678,7 +681,7 @@ JavaScriptParent::domInstanceOf(JSObject *obj, int prototypeID, int depth, bool
|
||||
if (!CallDOMInstanceOf(objId, prototypeID, depth, &status, bp))
|
||||
return false;
|
||||
|
||||
if (!status.ok())
|
||||
if (status.type() != ReturnStatus::TReturnSuccess)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user