예제 #1
0
bool
AutoJSAPI::PeekException(JS::MutableHandle<JS::Value> aVal)
{
  MOZ_ASSERT_IF(mIsMainThread, CxPusherIsStackTop());
  MOZ_ASSERT(HasException());
  MOZ_ASSERT(js::GetContextCompartment(cx()));
  if (!JS_GetPendingException(cx(), aVal)) {
    return false;
  }
  return true;
}
예제 #2
0
bool
AutoJSAPI::StealException(JS::MutableHandle<JS::Value> aVal)
{
    MOZ_ASSERT(CxPusherIsStackTop());
    MOZ_ASSERT(HasException());
    MOZ_ASSERT(js::GetContextCompartment(cx()));
    if (!JS_GetPendingException(cx(), aVal)) {
      return false;
    }
    JS_ClearPendingException(cx());
    return true;
}