static v8::Handle<v8::Value> countCallback(const v8::Arguments& args) { INC_STATS("DOM.Console.count"); Console* imp = V8Console::toNative(args.Holder()); OwnPtr<ScriptCallStack> callStack(ScriptCallStack::create(args, 0)); if (!callStack) return v8::Undefined(); imp->count(callStack.get()); return v8::Handle<v8::Value>(); }
JSValue JSC_HOST_CALL jsConsolePrototypeFunctionCount(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args) { UNUSED_PARAM(args); if (!thisValue.inherits(&JSConsole::s_info)) return throwError(exec, TypeError); JSConsole* castedThisObj = static_cast<JSConsole*>(asObject(thisValue)); Console* imp = static_cast<Console*>(castedThisObj->impl()); ScriptCallStack callStack(exec, args, 0); imp->count(&callStack); return jsUndefined(); }
EncodedJSValue JSC_HOST_CALL jsConsolePrototypeFunctionCount(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->count(scriptArguments, callStack); return JSValue::encode(jsUndefined()); }