Beispiel #1
0
 static v8::Handle<v8::Value> copyTextCallback(const v8::Arguments& args) {
   INC_STATS("DOM.InspectorFrontendHost.copyText");
   InspectorFrontendHost* imp = V8InspectorFrontendHost::toNative(args.Holder());
   V8Parameter<> text = args[0];
   imp->copyText(text);
   return v8::Handle<v8::Value>();
 }
static v8::Handle<v8::Value> copyTextCallback(const v8::Arguments& args)
{
    if (args.Length() < 1)
        return throwNotEnoughArgumentsError(args.GetIsolate());
    InspectorFrontendHost* imp = V8InspectorFrontendHost::toNative(args.Holder());
    V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, text, MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined));
    imp->copyText(text);
    return v8Undefined();
}
JSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionCopyText(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
{
    UNUSED_PARAM(args);
    if (!thisValue.inherits(&JSInspectorFrontendHost::s_info))
        return throwError(exec, TypeError);
    JSInspectorFrontendHost* castedThisObj = static_cast<JSInspectorFrontendHost*>(asObject(thisValue));
    InspectorFrontendHost* imp = static_cast<InspectorFrontendHost*>(castedThisObj->impl());
    const UString& text = args.at(0).toString(exec);

    imp->copyText(text);
    return jsUndefined();
}