コード例 #1
0
JSValue JSSVGPathSegList::appendItem(ExecState* exec, const ArgList& args)
{
    ExceptionCode ec = 0;
    SVGPathSeg* newItem = toSVGPathSeg(args.at(0));

    SVGPathSegList* list = impl();
    SVGElement* context = JSSVGContextCache::svgContextForDOMObject(this);

    JSValue result = toJS(exec, globalObject(), WTF::getPtr(list->appendItem(newItem, ec)), context);
    setDOMException(exec, ec);

    JSSVGContextCache::propagateSVGDOMChange(this, list->associatedAttributeName());
    return result;
}
コード例 #2
0
static v8::Handle<v8::Value> appendItemCallback(const v8::Arguments& args)
{
    INC_STATS("DOM.SVGPathSegList.appendItem");
    SVGPathSegList* imp = V8SVGPathSegList::toNative(args.Holder());
    ExceptionCode ec = 0;
    {
    EXCEPTION_BLOCK(SVGPathSeg*, newItem, V8SVGPathSeg::HasInstance(args[0]) ? V8SVGPathSeg::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0);
    RefPtr<SVGPathSeg> result = imp->appendItem(newItem, ec);
    if (UNLIKELY(ec))
        goto fail;
    SVGElement* context = V8Proxy::svgContext(imp);
    V8Proxy::setSVGContext(result.get(), context);
    context->svgAttributeChanged(imp->associatedAttributeName());
    return toV8(result.release());
    }
    fail:
    V8Proxy::setDOMException(ec);
    return v8::Handle<v8::Value>();
}