static v8::Handle<v8::Value> errorCallback(const v8::Arguments& args)
{
    INC_STATS("DOM.Console.error");
    Console* imp = V8Console::toNative(args.Holder());
    OwnPtr<ScriptCallStack> callStack(ScriptCallStack::create(args, 0));
    if (!callStack)
        return v8::Undefined();
    imp->error(callStack.get());
    return v8::Handle<v8::Value>();
}
Exemple #2
0
EncodedJSValue JSC_HOST_CALL jsConsolePrototypeFunctionError(ExecState* exec)
{
    JSValue thisValue = exec->hostThisValue();
    if (!thisValue.inherits(&JSConsole::s_info))
        return throwVMTypeError(exec);
    JSConsole* castedThis = static_cast<JSConsole*>(asObject(thisValue));
    Console* imp = static_cast<Console*>(castedThis->impl());
    RefPtr<ScriptArguments> scriptArguments(createScriptArguments(exec, 0));
    size_t maxStackSize = imp->shouldCaptureFullStackTrace() ? ScriptCallStack::maxCallStackSizeToCapture : 1;
    RefPtr<ScriptCallStack> callStack(createScriptCallStack(exec, maxStackSize));

    imp->error(scriptArguments, callStack);
    return JSValue::encode(jsUndefined());
}