当前位置: 首页>>代码示例>>C++>>正文


C++ ErrorEvent::filename方法代码示例

本文整理汇总了C++中ErrorEvent::filename方法的典型用法代码示例。如果您正苦于以下问题:C++ ErrorEvent::filename方法的具体用法?C++ ErrorEvent::filename怎么用?C++ ErrorEvent::filename使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ErrorEvent的用法示例。


在下文中一共展示了ErrorEvent::filename方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: jsErrorEventFilename

JSValue jsErrorEventFilename(ExecState* exec, JSValue slotBase, const Identifier&)
{
    JSErrorEvent* castedThis = static_cast<JSErrorEvent*>(asObject(slotBase));
    UNUSED_PARAM(exec);
    ErrorEvent* imp = static_cast<ErrorEvent*>(castedThis->impl());
    JSValue result = jsString(exec, imp->filename());
    return result;
}
开发者ID:Xertz,项目名称:EAWebKit,代码行数:8,代码来源:JSErrorEvent.cpp

示例2: handleEvent

void JSWorkerContextErrorHandler::handleEvent(ScriptExecutionContext* scriptExecutionContext, Event* event)
{
    ASSERT(scriptExecutionContext);
    if (!scriptExecutionContext)
        return;

    JSLock lock(SilenceAssertionsOnly);

    JSObject* jsFunction = this->jsFunction(scriptExecutionContext);
    if (!jsFunction)
        return;

    JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(scriptExecutionContext, isolatedWorld());
    if (!globalObject)
        return;

    ExecState* exec = globalObject->globalExec();

    CallData callData;
    CallType callType = jsFunction->getCallData(callData);

    if (callType != CallTypeNone) {

        ref();

        Event* savedEvent = globalObject->currentEvent();
        globalObject->setCurrentEvent(event);

        ASSERT(event->isErrorEvent());
        ErrorEvent* errorEvent = static_cast<ErrorEvent*>(event);

        MarkedArgumentBuffer args;
        args.append(jsString(exec, errorEvent->message()));
        args.append(jsString(exec, errorEvent->filename()));
        args.append(jsNumber(exec, errorEvent->lineno()));

        JSGlobalData* globalData = globalObject->globalData();
        DynamicGlobalObjectScope globalObjectScope(exec, globalData->dynamicGlobalObject ? globalData->dynamicGlobalObject : globalObject);    

        JSValue thisValue = globalObject->toThisObject(exec);

        globalData->timeoutChecker.start();
        JSValue returnValue = JSC::call(exec, jsFunction, callType, callData, thisValue, args);
        globalData->timeoutChecker.stop();

        globalObject->setCurrentEvent(savedEvent);

        if (exec->hadException())
            reportCurrentException(exec);
        else {
            bool retvalbool;
            if (returnValue.getBoolean(retvalbool) && !retvalbool)
                event->preventDefault();
        }

        deref();
    }
}
开发者ID:azrul2202,项目名称:WebKit-Smartphone,代码行数:58,代码来源:JSWorkerContextErrorHandler.cpp

示例3: handleEvent

void JSErrorHandler::handleEvent(ScriptExecutionContext* scriptExecutionContext, Event* event)
{
    if (!event->hasInterface(eventNames().interfaceForErrorEvent))
        return JSEventListener::handleEvent(scriptExecutionContext, event);

    ASSERT(scriptExecutionContext);
    if (!scriptExecutionContext)
        return;

    ErrorEvent* errorEvent = static_cast<ErrorEvent*>(event);

    JSLock lock(SilenceAssertionsOnly);

    JSObject* jsFunction = this->jsFunction(scriptExecutionContext);
    if (!jsFunction)
        return;

    JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(scriptExecutionContext, isolatedWorld());
    if (!globalObject)
        return;

    ExecState* exec = globalObject->globalExec();

    CallData callData;
    CallType callType = jsFunction->methodTable()->getCallData(jsFunction, callData);

    if (callType != CallTypeNone) {
        RefPtr<JSErrorHandler> protectedctor(this);

        Event* savedEvent = globalObject->currentEvent();
        globalObject->setCurrentEvent(event);

        MarkedArgumentBuffer args;
        args.append(jsString(exec, errorEvent->message()));
        args.append(jsString(exec, errorEvent->filename()));
        args.append(jsNumber(errorEvent->lineno()));

        JSGlobalData& globalData = globalObject->globalData();
        DynamicGlobalObjectScope globalObjectScope(globalData, globalData.dynamicGlobalObject ? globalData.dynamicGlobalObject : globalObject);

        JSValue thisValue = globalObject->methodTable()->toThisObject(globalObject, exec);

        globalData.timeoutChecker.start();
        JSValue returnValue = scriptExecutionContext->isDocument()
            ? JSMainThreadExecState::call(exec, jsFunction, callType, callData, thisValue, args)
            : JSC::call(exec, jsFunction, callType, callData, thisValue, args);
        globalData.timeoutChecker.stop();

        globalObject->setCurrentEvent(savedEvent);

        if (exec->hadException())
            reportCurrentException(exec);
        else {
            if (returnValue.isTrue())
                event->preventDefault();
        }
    }
}
开发者ID:CannedFish,项目名称:deepin-webkit,代码行数:58,代码来源:JSErrorHandler.cpp

示例4: handleEvent

void JSErrorHandler::handleEvent(ScriptExecutionContext* scriptExecutionContext, Event* event)
{

    if (event->eventInterface() != ErrorEventInterfaceType)
        return JSEventListener::handleEvent(scriptExecutionContext, event);

    ASSERT(scriptExecutionContext);
    if (!scriptExecutionContext)
        return;

    ErrorEvent* errorEvent = toErrorEvent(event);

    JSLockHolder lock(scriptExecutionContext->vm());

    JSObject* jsFunction = this->jsFunction(scriptExecutionContext);
    if (!jsFunction)
        return;

    JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(scriptExecutionContext, isolatedWorld());
    if (!globalObject)
        return;

    ExecState* exec = globalObject->globalExec();

    CallData callData;
    CallType callType = jsFunction->methodTable()->getCallData(jsFunction, callData);

    if (callType != CallTypeNone) {
        Ref<JSErrorHandler> protectedctor(*this);

        Event* savedEvent = globalObject->currentEvent();
        globalObject->setCurrentEvent(event);

        MarkedArgumentBuffer args;
        args.append(jsStringWithCache(exec, errorEvent->message()));
        args.append(jsStringWithCache(exec, errorEvent->filename()));
        args.append(jsNumber(errorEvent->lineno()));
        args.append(jsNumber(errorEvent->colno()));

        VM& vm = globalObject->vm();
        VMEntryScope entryScope(vm, vm.entryScope ? vm.entryScope->globalObject() : globalObject);

        JSValue returnValue = scriptExecutionContext->isDocument()
            ? JSMainThreadExecState::call(exec, jsFunction, callType, callData, globalObject, args)
            : JSC::call(exec, jsFunction, callType, callData, globalObject, args);

        globalObject->setCurrentEvent(savedEvent);

        if (exec->hadException())
            reportCurrentException(exec);
        else {
            if (returnValue.isTrue())
                event->preventDefault();
        }
    }
}
开发者ID:MYSHLIFE,项目名称:webkit,代码行数:56,代码来源:JSErrorHandler.cpp

示例5: tryCatch

v8::Local<v8::Value> V8ErrorHandler::callListenerFunction(
    ScriptState* scriptState,
    v8::Local<v8::Value> jsEvent,
    Event* event) {
  ASSERT(!jsEvent.IsEmpty());
  if (!event->hasInterface(EventNames::ErrorEvent))
    return V8EventListener::callListenerFunction(scriptState, jsEvent, event);

  ErrorEvent* errorEvent = static_cast<ErrorEvent*>(event);
  if (errorEvent->world() && errorEvent->world() != &world())
    return v8::Null(isolate());

  v8::Local<v8::Object> listener =
      getListenerObject(scriptState->getExecutionContext());
  if (listener.IsEmpty() || !listener->IsFunction())
    return v8::Null(isolate());

  v8::Local<v8::Function> callFunction =
      v8::Local<v8::Function>::Cast(listener);
  v8::Local<v8::Object> thisValue = scriptState->context()->Global();

  v8::Local<v8::Object> eventObject;
  if (!jsEvent->ToObject(scriptState->context()).ToLocal(&eventObject))
    return v8::Null(isolate());
  auto privateError = V8PrivateProperty::getErrorEventError(isolate());
  v8::Local<v8::Value> error =
      privateError.getOrUndefined(scriptState->context(), eventObject);
  if (error->IsUndefined())
    error = v8::Null(isolate());

  v8::Local<v8::Value> parameters[5] = {
      v8String(isolate(), errorEvent->message()),
      v8String(isolate(), errorEvent->filename()),
      v8::Integer::New(isolate(), errorEvent->lineno()),
      v8::Integer::New(isolate(), errorEvent->colno()), error};
  v8::TryCatch tryCatch(isolate());
  tryCatch.SetVerbose(true);
  v8::MaybeLocal<v8::Value> result;
  if (scriptState->getExecutionContext()->isWorkerGlobalScope()) {
    result = V8ScriptRunner::callFunction(
        callFunction, scriptState->getExecutionContext(), thisValue,
        WTF_ARRAY_LENGTH(parameters), parameters, isolate());
  } else {
    result = V8ScriptRunner::callFunction(
        callFunction, scriptState->getExecutionContext(), thisValue,
        WTF_ARRAY_LENGTH(parameters), parameters, isolate());
  }
  v8::Local<v8::Value> returnValue;
  if (!result.ToLocal(&returnValue))
    return v8::Null(isolate());

  return returnValue;
}
开发者ID:mirror,项目名称:chromium,代码行数:53,代码来源:V8ErrorHandler.cpp

示例6: getListenerObject

v8::Local<v8::Value> V8ErrorHandler::callListenerFunction(v8::Handle<v8::Value> jsEvent, Event* event)
{
    if (!event->hasInterface(EventNames::ErrorEvent))
        return V8EventListener::callListenerFunction(jsEvent, event);

    ErrorEvent* errorEvent = static_cast<ErrorEvent*>(event);

    if (errorEvent->world() && errorEvent->world() != &world())
        return v8::Null(isolate());

    v8::Local<v8::Object> listener = getListenerObject(scriptState()->executionContext());
    v8::Local<v8::Value> returnValue;
    if (!listener.IsEmpty() && listener->IsFunction()) {
        v8::Local<v8::Function> callFunction = v8::Local<v8::Function>::Cast(listener);
        v8::Local<v8::Object> thisValue = scriptState()->context()->Global();

        v8::Local<v8::Value> error = V8HiddenValue::getHiddenValue(isolate(), jsEvent->ToObject(), V8HiddenValue::error(isolate()));
        if (error.IsEmpty())
            error = v8::Null(isolate());

        v8::Handle<v8::Value> parameters[5] = { v8String(isolate(), errorEvent->message()), v8String(isolate(), errorEvent->filename()), v8::Integer::New(isolate(), errorEvent->lineno()), v8::Integer::New(isolate(), errorEvent->colno()), error };
        v8::TryCatch tryCatch;
        tryCatch.SetVerbose(true);
        returnValue = ScriptController::callFunction(scriptState()->executionContext(), callFunction, thisValue, WTF_ARRAY_LENGTH(parameters), parameters, isolate());
    }
    return returnValue;
}
开发者ID:dalecurtis,项目名称:mojo,代码行数:27,代码来源:V8ErrorHandler.cpp

示例7: ASSERT

v8::Local<v8::Value> V8WorkerContextErrorHandler::callListenerFunction(ScriptExecutionContext* context, v8::Handle<v8::Value> jsEvent, Event* event)
{
    ASSERT(event->isErrorEvent());
    v8::Local<v8::Object> listener = getListenerObject(context);
    v8::Local<v8::Value> returnValue;
    if (!listener.IsEmpty() && listener->IsFunction()) {
        ErrorEvent* errorEvent = static_cast<ErrorEvent*>(event);
        v8::Local<v8::Function> callFunction = v8::Local<v8::Function>::Cast(listener);
        v8::Local<v8::Object> thisValue = v8::Context::GetCurrent()->Global();
        v8::Handle<v8::Value> parameters[3] = { v8String(errorEvent->message()), v8String(errorEvent->filename()), v8::Integer::New(errorEvent->lineno()) };
        returnValue = callFunction->Call(thisValue, 3, parameters);
    }
    return returnValue;
}
开发者ID:vizcount,项目名称:work,代码行数:14,代码来源:V8WorkerContextErrorHandler.cpp


注:本文中的ErrorEvent::filename方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。