We shouldn't need to create a Vector<RefPtr<Node>> just so that the binding code can generate the right code.
Created attachment 261703 [details] Fixes the bug
Comment on attachment 261703 [details] Fixes the bug View in context: https://bugs.webkit.org/attachment.cgi?id=261703&action=review > Source/WebCore/bindings/js/JSDOMBinding.h:467 > +template<typename T> > +inline JSC::JSValue jsArray(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, const Vector<T>* vector) > +{ > + JSC::MarkedArgumentBuffer list; > + if (vector) { > + for (auto& element : *vector) > + list.append(JSValueTraits<T>::arrayJSValue(exec, globalObject, element)); > + } > + return JSC::constructArray(exec, nullptr, globalObject, list); > +} I suggest writing this instead: template<typename T, size_t inlineCapacity> inline JSC::JSValue jsArray(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, const Vector<T, inlineCapacity>* vector) { if (!vector) return JSC::constructEmptyArray(exec); return jsArray(exec, globalObject, *vector); }
Committed r190093: <http://trac.webkit.org/changeset/190093>