コード例 #1
0
JSValue* JSXMLHttpRequestException::getValueProperty(ExecState* exec, int token) const
{
    switch (token) {
    case CodeAttrNum: {
        XMLHttpRequestException* imp = static_cast<XMLHttpRequestException*>(impl());
        return jsNumber(exec, imp->code());
    }
    case NameAttrNum: {
        XMLHttpRequestException* imp = static_cast<XMLHttpRequestException*>(impl());
        return jsString(exec, imp->name());
    }
    case MessageAttrNum: {
        XMLHttpRequestException* imp = static_cast<XMLHttpRequestException*>(impl());
        return jsString(exec, imp->message());
    }
    case ConstructorAttrNum:
        return getConstructor(exec);
    }
    return 0;
}
static v8::Handle<v8::Value> codeAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
    XMLHttpRequestException* imp = V8XMLHttpRequestException::toNative(info.Holder());
    return v8Integer(imp->code(), info.GetIsolate());
}