Ejemplo n.º 1
0
 /**
 * @brief Copy Constructor
 */
 TestException(const TestException &te)
 {
   m_Message = (&te)->getMessage();
   m_FileName = te.getFileName();
   m_LineNumber = te.getLineNumber();
   updateWhat();
 }
Ejemplo n.º 2
0
static void readonlyStringAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) {
  v8::Local<v8::Object> holder = info.Holder();

  TestException* impl = V8TestException::toImpl(holder);

  v8SetReturnValueString(info, impl->readonlyStringAttribute(), info.GetIsolate());
}
Ejemplo n.º 3
0
 /** Try to instantiate a derived class.
  */
 void testDerivedClass()
 {
     TestException t;
     shouldEqual(strncmp(t.what(), "qwerty", 6), 0);
     TestExceptionWithOverload to;
     shouldEqual(strncmp(to.what(), "qwerty", 6), 0);
 }
Ejemplo n.º 4
0
JSValue jsTestExceptionName(ExecState* exec, JSValue slotBase, PropertyName)
{
    JSTestException* castedThis = jsCast<JSTestException*>(asObject(slotBase));
    UNUSED_PARAM(exec);
    TestException* impl = static_cast<TestException*>(castedThis->impl());
    JSValue result = jsString(exec, impl->name());
    return result;
}
Ejemplo n.º 5
0
// returns 0 if all tests pass
int main()
{
   TestException a;
   try {
      a.funcie();
   } catch (gpstk::Exception& e) {
      cout << "main " << e;
   }
}
Ejemplo n.º 6
0
static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info) {
  ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ConstructionContext, "TestException");

  if (UNLIKELY(info.Length() < 1)) {
    exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
    return;
  }

  unsigned argument;
  argument = toUInt16(info.GetIsolate(), info[0], NormalConversion, exceptionState);
  if (exceptionState.hadException())
    return;

  TestException* impl = TestException::create(argument);
  v8::Local<v8::Object> wrapper = info.Holder();
  wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestException::wrapperTypeInfo, wrapper);
  v8SetReturnValue(info, wrapper);
}
Ejemplo n.º 7
0
static v8::Handle<v8::Value> nameAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
    TestException* imp = V8TestException::toNative(info.Holder());
    return v8String(imp->name(), info.GetIsolate(), ReturnUnsafeHandle);
}
Ejemplo n.º 8
0
static void toStringMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
    TestException* impl = V8TestException::toNative(info.Holder());
    v8SetReturnValueString(info, impl->toString(), info.GetIsolate());
}
Ejemplo n.º 9
0
static void readonlyStringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
{
    v8::Handle<v8::Object> holder = info.Holder();
    TestException* impl = V8TestException::toNative(holder);
    v8SetReturnValueString(info, impl->readonlyStringAttribute(), info.GetIsolate());
}
Ejemplo n.º 10
0
static void readonlyUnsignedShortAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info)
{
    v8::Local<v8::Object> holder = info.Holder();
    TestException* impl = V8TestException::toImpl(holder);
    v8SetReturnValueUnsigned(info, impl->readonlyUnsignedShortAttribute());
}
Ejemplo n.º 11
0
static v8::Handle<v8::Value> nameAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
    INC_STATS("DOM.TestException.name._get");
    TestException* imp = V8TestException::toNative(info.Holder());
    return v8String(imp->name(), info.GetIsolate());
}
Ejemplo n.º 12
0
static void nameAttributeGetter(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
{
    TestException* imp = V8TestException::toNative(info.Holder());
    v8SetReturnValueString(info, imp->name(), info.GetIsolate());
    return;
}