| 1 | /* | 
|---|
| 2 | This file is part of the WebKit open source project. | 
|---|
| 3 | This file has been generated by generate-bindings.pl. DO NOT MODIFY! | 
|---|
| 4 |  | 
|---|
| 5 | This library is free software; you can redistribute it and/or | 
|---|
| 6 | modify it under the terms of the GNU Library General Public | 
|---|
| 7 | License as published by the Free Software Foundation; either | 
|---|
| 8 | version 2 of the License, or (at your option) any later version. | 
|---|
| 9 |  | 
|---|
| 10 | This library is distributed in the hope that it will be useful, | 
|---|
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 
|---|
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU | 
|---|
| 13 | Library General Public License for more details. | 
|---|
| 14 |  | 
|---|
| 15 | You should have received a copy of the GNU Library General Public License | 
|---|
| 16 | along with this library; see the file COPYING.LIB.  If not, write to | 
|---|
| 17 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 
|---|
| 18 | Boston, MA 02110-1301, USA. | 
|---|
| 19 | */ | 
|---|
| 20 |  | 
|---|
| 21 | #include "config.h" | 
|---|
| 22 | #include "JSSVGPointList.h" | 
|---|
| 23 |  | 
|---|
| 24 | #include "JSDOMAttribute.h" | 
|---|
| 25 | #include "JSDOMBinding.h" | 
|---|
| 26 | #include "JSDOMConstructorNotConstructable.h" | 
|---|
| 27 | #include "JSDOMConvertInterface.h" | 
|---|
| 28 | #include "JSDOMConvertNumbers.h" | 
|---|
| 29 | #include "JSDOMExceptionHandling.h" | 
|---|
| 30 | #include "JSDOMGlobalObject.h" | 
|---|
| 31 | #include "JSDOMOperation.h" | 
|---|
| 32 | #include "JSDOMWrapperCache.h" | 
|---|
| 33 | #include "JSSVGPoint.h" | 
|---|
| 34 | #include "ScriptExecutionContext.h" | 
|---|
| 35 | #include <JavaScriptCore/FunctionPrototype.h> | 
|---|
| 36 | #include <JavaScriptCore/HeapSnapshotBuilder.h> | 
|---|
| 37 | #include <JavaScriptCore/JSCInlines.h> | 
|---|
| 38 | #include <wtf/GetPtr.h> | 
|---|
| 39 | #include <wtf/PointerPreparations.h> | 
|---|
| 40 | #include <wtf/URL.h> | 
|---|
| 41 |  | 
|---|
| 42 |  | 
|---|
| 43 | namespace WebCore { | 
|---|
| 44 | using namespace JSC; | 
|---|
| 45 |  | 
|---|
| 46 | // Functions | 
|---|
| 47 |  | 
|---|
| 48 | JSC::EncodedJSValue JSC_HOST_CALL jsSVGPointListPrototypeFunctionClear(JSC::ExecState*); | 
|---|
| 49 | JSC::EncodedJSValue JSC_HOST_CALL jsSVGPointListPrototypeFunctionInitialize(JSC::ExecState*); | 
|---|
| 50 | JSC::EncodedJSValue JSC_HOST_CALL jsSVGPointListPrototypeFunctionGetItem(JSC::ExecState*); | 
|---|
| 51 | JSC::EncodedJSValue JSC_HOST_CALL jsSVGPointListPrototypeFunctionInsertItemBefore(JSC::ExecState*); | 
|---|
| 52 | JSC::EncodedJSValue JSC_HOST_CALL jsSVGPointListPrototypeFunctionReplaceItem(JSC::ExecState*); | 
|---|
| 53 | JSC::EncodedJSValue JSC_HOST_CALL jsSVGPointListPrototypeFunctionRemoveItem(JSC::ExecState*); | 
|---|
| 54 | JSC::EncodedJSValue JSC_HOST_CALL jsSVGPointListPrototypeFunctionAppendItem(JSC::ExecState*); | 
|---|
| 55 |  | 
|---|
| 56 | // Attributes | 
|---|
| 57 |  | 
|---|
| 58 | JSC::EncodedJSValue jsSVGPointListConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); | 
|---|
| 59 | bool setJSSVGPointListConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); | 
|---|
| 60 | JSC::EncodedJSValue jsSVGPointListNumberOfItems(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); | 
|---|
| 61 |  | 
|---|
| 62 | class JSSVGPointListPrototype : public JSC::JSNonFinalObject { | 
|---|
| 63 | public: | 
|---|
| 64 | using Base = JSC::JSNonFinalObject; | 
|---|
| 65 | static JSSVGPointListPrototype* create(JSC::VM& vm, JSDOMGlobalObject* globalObject, JSC::Structure* structure) | 
|---|
| 66 | { | 
|---|
| 67 | JSSVGPointListPrototype* ptr = new (NotNull, JSC::allocateCell<JSSVGPointListPrototype>(vm.heap)) JSSVGPointListPrototype(vm, globalObject, structure); | 
|---|
| 68 | ptr->finishCreation(vm); | 
|---|
| 69 | return ptr; | 
|---|
| 70 | } | 
|---|
| 71 |  | 
|---|
| 72 | DECLARE_INFO; | 
|---|
| 73 | static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype) | 
|---|
| 74 | { | 
|---|
| 75 | return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info()); | 
|---|
| 76 | } | 
|---|
| 77 |  | 
|---|
| 78 | private: | 
|---|
| 79 | JSSVGPointListPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure) | 
|---|
| 80 | : JSC::JSNonFinalObject(vm, structure) | 
|---|
| 81 | { | 
|---|
| 82 | } | 
|---|
| 83 |  | 
|---|
| 84 | void finishCreation(JSC::VM&); | 
|---|
| 85 | }; | 
|---|
| 86 |  | 
|---|
| 87 | using JSSVGPointListConstructor = JSDOMConstructorNotConstructable<JSSVGPointList>; | 
|---|
| 88 |  | 
|---|
| 89 | template<> JSValue JSSVGPointListConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject) | 
|---|
| 90 | { | 
|---|
| 91 | UNUSED_PARAM(vm); | 
|---|
| 92 | return globalObject.functionPrototype(); | 
|---|
| 93 | } | 
|---|
| 94 |  | 
|---|
| 95 | template<> void JSSVGPointListConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject) | 
|---|
| 96 | { | 
|---|
| 97 | putDirect(vm, vm.propertyNames->prototype, JSSVGPointList::prototype(vm, globalObject), JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); | 
|---|
| 98 | putDirect(vm, vm.propertyNames->name, jsNontrivialString(&vm, String( "SVGPointList"_s)), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); | 
|---|
| 99 | putDirect(vm, vm.propertyNames->length, jsNumber(0), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); | 
|---|
| 100 | } | 
|---|
| 101 |  | 
|---|
| 102 | template<> const ClassInfo JSSVGPointListConstructor::s_info = { "SVGPointList", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSSVGPointListConstructor) }; | 
|---|
| 103 |  | 
|---|
| 104 | /* Hash table for prototype */ | 
|---|
| 105 |  | 
|---|
| 106 | static const HashTableValue JSSVGPointListPrototypeTableValues[] = | 
|---|
| 107 | { | 
|---|
| 108 | { "constructor", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPointListConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSSVGPointListConstructor) } }, | 
|---|
| 109 | { "numberOfItems", static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPointListNumberOfItems), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, | 
|---|
| 110 | { "clear", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsSVGPointListPrototypeFunctionClear), (intptr_t) (0) } }, | 
|---|
| 111 | { "initialize", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsSVGPointListPrototypeFunctionInitialize), (intptr_t) (1) } }, | 
|---|
| 112 | { "getItem", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsSVGPointListPrototypeFunctionGetItem), (intptr_t) (1) } }, | 
|---|
| 113 | { "insertItemBefore", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsSVGPointListPrototypeFunctionInsertItemBefore), (intptr_t) (2) } }, | 
|---|
| 114 | { "replaceItem", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsSVGPointListPrototypeFunctionReplaceItem), (intptr_t) (2) } }, | 
|---|
| 115 | { "removeItem", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsSVGPointListPrototypeFunctionRemoveItem), (intptr_t) (1) } }, | 
|---|
| 116 | { "appendItem", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsSVGPointListPrototypeFunctionAppendItem), (intptr_t) (1) } }, | 
|---|
| 117 | }; | 
|---|
| 118 |  | 
|---|
| 119 | const ClassInfo JSSVGPointListPrototype::s_info = { "SVGPointListPrototype", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSSVGPointListPrototype) }; | 
|---|
| 120 |  | 
|---|
| 121 | void JSSVGPointListPrototype::finishCreation(VM& vm) | 
|---|
| 122 | { | 
|---|
| 123 | Base::finishCreation(vm); | 
|---|
| 124 | reifyStaticProperties(vm, JSSVGPointList::info(), JSSVGPointListPrototypeTableValues, *this); | 
|---|
| 125 | } | 
|---|
| 126 |  | 
|---|
| 127 | const ClassInfo JSSVGPointList::s_info = { "SVGPointList", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSSVGPointList) }; | 
|---|
| 128 |  | 
|---|
| 129 | JSSVGPointList::JSSVGPointList(Structure* structure, JSDOMGlobalObject& globalObject, Ref<SVGPointList>&& impl) | 
|---|
| 130 | : JSDOMWrapper<SVGPointList>(structure, globalObject, WTFMove(impl)) | 
|---|
| 131 | { | 
|---|
| 132 | } | 
|---|
| 133 |  | 
|---|
| 134 | void JSSVGPointList::finishCreation(VM& vm) | 
|---|
| 135 | { | 
|---|
| 136 | Base::finishCreation(vm); | 
|---|
| 137 | ASSERT(inherits(vm, info())); | 
|---|
| 138 |  | 
|---|
| 139 | } | 
|---|
| 140 |  | 
|---|
| 141 | JSObject* JSSVGPointList::createPrototype(VM& vm, JSDOMGlobalObject& globalObject) | 
|---|
| 142 | { | 
|---|
| 143 | return JSSVGPointListPrototype::create(vm, &globalObject, JSSVGPointListPrototype::createStructure(vm, &globalObject, globalObject.objectPrototype())); | 
|---|
| 144 | } | 
|---|
| 145 |  | 
|---|
| 146 | JSObject* JSSVGPointList::prototype(VM& vm, JSDOMGlobalObject& globalObject) | 
|---|
| 147 | { | 
|---|
| 148 | return getDOMPrototype<JSSVGPointList>(vm, globalObject); | 
|---|
| 149 | } | 
|---|
| 150 |  | 
|---|
| 151 | JSValue JSSVGPointList::getConstructor(VM& vm, const JSGlobalObject* globalObject) | 
|---|
| 152 | { | 
|---|
| 153 | return getDOMConstructor<JSSVGPointListConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject)); | 
|---|
| 154 | } | 
|---|
| 155 |  | 
|---|
| 156 | void JSSVGPointList::destroy(JSC::JSCell* cell) | 
|---|
| 157 | { | 
|---|
| 158 | JSSVGPointList* thisObject = static_cast<JSSVGPointList*>(cell); | 
|---|
| 159 | thisObject->JSSVGPointList::~JSSVGPointList(); | 
|---|
| 160 | } | 
|---|
| 161 |  | 
|---|
| 162 | template<> inline JSSVGPointList* IDLAttribute<JSSVGPointList>::cast(ExecState& state, EncodedJSValue thisValue) | 
|---|
| 163 | { | 
|---|
| 164 | return jsDynamicCast<JSSVGPointList*>(state.vm(), JSValue::decode(thisValue)); | 
|---|
| 165 | } | 
|---|
| 166 |  | 
|---|
| 167 | template<> inline JSSVGPointList* IDLOperation<JSSVGPointList>::cast(ExecState& state) | 
|---|
| 168 | { | 
|---|
| 169 | return jsDynamicCast<JSSVGPointList*>(state.vm(), state.thisValue()); | 
|---|
| 170 | } | 
|---|
| 171 |  | 
|---|
| 172 | EncodedJSValue jsSVGPointListConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) | 
|---|
| 173 | { | 
|---|
| 174 | VM& vm = state->vm(); | 
|---|
| 175 | auto throwScope = DECLARE_THROW_SCOPE(vm); | 
|---|
| 176 | auto* prototype = jsDynamicCast<JSSVGPointListPrototype*>(vm, JSValue::decode(thisValue)); | 
|---|
| 177 | if (UNLIKELY(!prototype)) | 
|---|
| 178 | return throwVMTypeError(state, throwScope); | 
|---|
| 179 | return JSValue::encode(JSSVGPointList::getConstructor(state->vm(), prototype->globalObject())); | 
|---|
| 180 | } | 
|---|
| 181 |  | 
|---|
| 182 | bool setJSSVGPointListConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) | 
|---|
| 183 | { | 
|---|
| 184 | VM& vm = state->vm(); | 
|---|
| 185 | auto throwScope = DECLARE_THROW_SCOPE(vm); | 
|---|
| 186 | auto* prototype = jsDynamicCast<JSSVGPointListPrototype*>(vm, JSValue::decode(thisValue)); | 
|---|
| 187 | if (UNLIKELY(!prototype)) { | 
|---|
| 188 | throwVMTypeError(state, throwScope); | 
|---|
| 189 | return false; | 
|---|
| 190 | } | 
|---|
| 191 | // Shadowing a built-in constructor | 
|---|
| 192 | return prototype->putDirect(vm, vm.propertyNames->constructor, JSValue::decode(encodedValue)); | 
|---|
| 193 | } | 
|---|
| 194 |  | 
|---|
| 195 | static inline JSValue jsSVGPointListNumberOfItemsGetter(ExecState& state, JSSVGPointList& thisObject, ThrowScope& throwScope) | 
|---|
| 196 | { | 
|---|
| 197 | UNUSED_PARAM(throwScope); | 
|---|
| 198 | UNUSED_PARAM(state); | 
|---|
| 199 | auto& impl = thisObject.wrapped(); | 
|---|
| 200 | JSValue result = toJS<IDLUnsignedLong>(state, throwScope, impl.numberOfItems()); | 
|---|
| 201 | return result; | 
|---|
| 202 | } | 
|---|
| 203 |  | 
|---|
| 204 | EncodedJSValue jsSVGPointListNumberOfItems(ExecState* state, EncodedJSValue thisValue, PropertyName) | 
|---|
| 205 | { | 
|---|
| 206 | return IDLAttribute<JSSVGPointList>::get<jsSVGPointListNumberOfItemsGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "numberOfItems"); | 
|---|
| 207 | } | 
|---|
| 208 |  | 
|---|
| 209 | static inline JSC::EncodedJSValue jsSVGPointListPrototypeFunctionClearBody(JSC::ExecState* state, typename IDLOperation<JSSVGPointList>::ClassParameter castedThis, JSC::ThrowScope& throwScope) | 
|---|
| 210 | { | 
|---|
| 211 | UNUSED_PARAM(state); | 
|---|
| 212 | UNUSED_PARAM(throwScope); | 
|---|
| 213 | auto& impl = castedThis->wrapped(); | 
|---|
| 214 | propagateException(*state, throwScope, impl.clear()); | 
|---|
| 215 | return JSValue::encode(jsUndefined()); | 
|---|
| 216 | } | 
|---|
| 217 |  | 
|---|
| 218 | EncodedJSValue JSC_HOST_CALL jsSVGPointListPrototypeFunctionClear(ExecState* state) | 
|---|
| 219 | { | 
|---|
| 220 | return IDLOperation<JSSVGPointList>::call<jsSVGPointListPrototypeFunctionClearBody>(*state, "clear"); | 
|---|
| 221 | } | 
|---|
| 222 |  | 
|---|
| 223 | static inline JSC::EncodedJSValue jsSVGPointListPrototypeFunctionInitializeBody(JSC::ExecState* state, typename IDLOperation<JSSVGPointList>::ClassParameter castedThis, JSC::ThrowScope& throwScope) | 
|---|
| 224 | { | 
|---|
| 225 | UNUSED_PARAM(state); | 
|---|
| 226 | UNUSED_PARAM(throwScope); | 
|---|
| 227 | auto& impl = castedThis->wrapped(); | 
|---|
| 228 | if (UNLIKELY(state->argumentCount() < 1)) | 
|---|
| 229 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); | 
|---|
| 230 | auto item = convert<IDLInterface<SVGPoint>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "item", "SVGPointList", "initialize", "SVGPoint"); }); | 
|---|
| 231 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); | 
|---|
| 232 | return JSValue::encode(toJS<IDLInterface<SVGPoint>>(*state, *castedThis->globalObject(), throwScope, impl.initialize(*item))); | 
|---|
| 233 | } | 
|---|
| 234 |  | 
|---|
| 235 | EncodedJSValue JSC_HOST_CALL jsSVGPointListPrototypeFunctionInitialize(ExecState* state) | 
|---|
| 236 | { | 
|---|
| 237 | return IDLOperation<JSSVGPointList>::call<jsSVGPointListPrototypeFunctionInitializeBody>(*state, "initialize"); | 
|---|
| 238 | } | 
|---|
| 239 |  | 
|---|
| 240 | static inline JSC::EncodedJSValue jsSVGPointListPrototypeFunctionGetItemBody(JSC::ExecState* state, typename IDLOperation<JSSVGPointList>::ClassParameter castedThis, JSC::ThrowScope& throwScope) | 
|---|
| 241 | { | 
|---|
| 242 | UNUSED_PARAM(state); | 
|---|
| 243 | UNUSED_PARAM(throwScope); | 
|---|
| 244 | auto& impl = castedThis->wrapped(); | 
|---|
| 245 | if (UNLIKELY(state->argumentCount() < 1)) | 
|---|
| 246 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); | 
|---|
| 247 | auto index = convert<IDLUnsignedLong>(*state, state->uncheckedArgument(0)); | 
|---|
| 248 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); | 
|---|
| 249 | return JSValue::encode(toJS<IDLInterface<SVGPoint>>(*state, *castedThis->globalObject(), throwScope, impl.getItem(WTFMove(index)))); | 
|---|
| 250 | } | 
|---|
| 251 |  | 
|---|
| 252 | EncodedJSValue JSC_HOST_CALL jsSVGPointListPrototypeFunctionGetItem(ExecState* state) | 
|---|
| 253 | { | 
|---|
| 254 | return IDLOperation<JSSVGPointList>::call<jsSVGPointListPrototypeFunctionGetItemBody>(*state, "getItem"); | 
|---|
| 255 | } | 
|---|
| 256 |  | 
|---|
| 257 | static inline JSC::EncodedJSValue jsSVGPointListPrototypeFunctionInsertItemBeforeBody(JSC::ExecState* state, typename IDLOperation<JSSVGPointList>::ClassParameter castedThis, JSC::ThrowScope& throwScope) | 
|---|
| 258 | { | 
|---|
| 259 | UNUSED_PARAM(state); | 
|---|
| 260 | UNUSED_PARAM(throwScope); | 
|---|
| 261 | auto& impl = castedThis->wrapped(); | 
|---|
| 262 | if (UNLIKELY(state->argumentCount() < 2)) | 
|---|
| 263 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); | 
|---|
| 264 | auto item = convert<IDLInterface<SVGPoint>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "item", "SVGPointList", "insertItemBefore", "SVGPoint"); }); | 
|---|
| 265 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); | 
|---|
| 266 | auto index = convert<IDLUnsignedLong>(*state, state->uncheckedArgument(1)); | 
|---|
| 267 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); | 
|---|
| 268 | return JSValue::encode(toJS<IDLInterface<SVGPoint>>(*state, *castedThis->globalObject(), throwScope, impl.insertItemBefore(*item, WTFMove(index)))); | 
|---|
| 269 | } | 
|---|
| 270 |  | 
|---|
| 271 | EncodedJSValue JSC_HOST_CALL jsSVGPointListPrototypeFunctionInsertItemBefore(ExecState* state) | 
|---|
| 272 | { | 
|---|
| 273 | return IDLOperation<JSSVGPointList>::call<jsSVGPointListPrototypeFunctionInsertItemBeforeBody>(*state, "insertItemBefore"); | 
|---|
| 274 | } | 
|---|
| 275 |  | 
|---|
| 276 | static inline JSC::EncodedJSValue jsSVGPointListPrototypeFunctionReplaceItemBody(JSC::ExecState* state, typename IDLOperation<JSSVGPointList>::ClassParameter castedThis, JSC::ThrowScope& throwScope) | 
|---|
| 277 | { | 
|---|
| 278 | UNUSED_PARAM(state); | 
|---|
| 279 | UNUSED_PARAM(throwScope); | 
|---|
| 280 | auto& impl = castedThis->wrapped(); | 
|---|
| 281 | if (UNLIKELY(state->argumentCount() < 2)) | 
|---|
| 282 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); | 
|---|
| 283 | auto item = convert<IDLInterface<SVGPoint>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "item", "SVGPointList", "replaceItem", "SVGPoint"); }); | 
|---|
| 284 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); | 
|---|
| 285 | auto index = convert<IDLUnsignedLong>(*state, state->uncheckedArgument(1)); | 
|---|
| 286 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); | 
|---|
| 287 | return JSValue::encode(toJS<IDLInterface<SVGPoint>>(*state, *castedThis->globalObject(), throwScope, impl.replaceItem(*item, WTFMove(index)))); | 
|---|
| 288 | } | 
|---|
| 289 |  | 
|---|
| 290 | EncodedJSValue JSC_HOST_CALL jsSVGPointListPrototypeFunctionReplaceItem(ExecState* state) | 
|---|
| 291 | { | 
|---|
| 292 | return IDLOperation<JSSVGPointList>::call<jsSVGPointListPrototypeFunctionReplaceItemBody>(*state, "replaceItem"); | 
|---|
| 293 | } | 
|---|
| 294 |  | 
|---|
| 295 | static inline JSC::EncodedJSValue jsSVGPointListPrototypeFunctionRemoveItemBody(JSC::ExecState* state, typename IDLOperation<JSSVGPointList>::ClassParameter castedThis, JSC::ThrowScope& throwScope) | 
|---|
| 296 | { | 
|---|
| 297 | UNUSED_PARAM(state); | 
|---|
| 298 | UNUSED_PARAM(throwScope); | 
|---|
| 299 | auto& impl = castedThis->wrapped(); | 
|---|
| 300 | if (UNLIKELY(state->argumentCount() < 1)) | 
|---|
| 301 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); | 
|---|
| 302 | auto index = convert<IDLUnsignedLong>(*state, state->uncheckedArgument(0)); | 
|---|
| 303 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); | 
|---|
| 304 | return JSValue::encode(toJS<IDLInterface<SVGPoint>>(*state, *castedThis->globalObject(), throwScope, impl.removeItem(WTFMove(index)))); | 
|---|
| 305 | } | 
|---|
| 306 |  | 
|---|
| 307 | EncodedJSValue JSC_HOST_CALL jsSVGPointListPrototypeFunctionRemoveItem(ExecState* state) | 
|---|
| 308 | { | 
|---|
| 309 | return IDLOperation<JSSVGPointList>::call<jsSVGPointListPrototypeFunctionRemoveItemBody>(*state, "removeItem"); | 
|---|
| 310 | } | 
|---|
| 311 |  | 
|---|
| 312 | static inline JSC::EncodedJSValue jsSVGPointListPrototypeFunctionAppendItemBody(JSC::ExecState* state, typename IDLOperation<JSSVGPointList>::ClassParameter castedThis, JSC::ThrowScope& throwScope) | 
|---|
| 313 | { | 
|---|
| 314 | UNUSED_PARAM(state); | 
|---|
| 315 | UNUSED_PARAM(throwScope); | 
|---|
| 316 | auto& impl = castedThis->wrapped(); | 
|---|
| 317 | if (UNLIKELY(state->argumentCount() < 1)) | 
|---|
| 318 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); | 
|---|
| 319 | auto item = convert<IDLInterface<SVGPoint>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "item", "SVGPointList", "appendItem", "SVGPoint"); }); | 
|---|
| 320 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); | 
|---|
| 321 | return JSValue::encode(toJS<IDLInterface<SVGPoint>>(*state, *castedThis->globalObject(), throwScope, impl.appendItem(*item))); | 
|---|
| 322 | } | 
|---|
| 323 |  | 
|---|
| 324 | EncodedJSValue JSC_HOST_CALL jsSVGPointListPrototypeFunctionAppendItem(ExecState* state) | 
|---|
| 325 | { | 
|---|
| 326 | return IDLOperation<JSSVGPointList>::call<jsSVGPointListPrototypeFunctionAppendItemBody>(*state, "appendItem"); | 
|---|
| 327 | } | 
|---|
| 328 |  | 
|---|
| 329 | void JSSVGPointList::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) | 
|---|
| 330 | { | 
|---|
| 331 | auto* thisObject = jsCast<JSSVGPointList*>(cell); | 
|---|
| 332 | builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); | 
|---|
| 333 | if (thisObject->scriptExecutionContext()) | 
|---|
| 334 | builder.setLabelForCell(cell, "url "+ thisObject->scriptExecutionContext()->url().string()); | 
|---|
| 335 | Base::heapSnapshot(cell, builder); | 
|---|
| 336 | } | 
|---|
| 337 |  | 
|---|
| 338 | bool JSSVGPointListOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason) | 
|---|
| 339 | { | 
|---|
| 340 | UNUSED_PARAM(handle); | 
|---|
| 341 | UNUSED_PARAM(visitor); | 
|---|
| 342 | UNUSED_PARAM(reason); | 
|---|
| 343 | return false; | 
|---|
| 344 | } | 
|---|
| 345 |  | 
|---|
| 346 | void JSSVGPointListOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context) | 
|---|
| 347 | { | 
|---|
| 348 | auto* jsSVGPointList = static_cast<JSSVGPointList*>(handle.slot()->asCell()); | 
|---|
| 349 | auto& world = *static_cast<DOMWrapperWorld*>(context); | 
|---|
| 350 | uncacheWrapper(world, &jsSVGPointList->wrapped(), jsSVGPointList); | 
|---|
| 351 | } | 
|---|
| 352 |  | 
|---|
| 353 | #if ENABLE(BINDING_INTEGRITY) | 
|---|
| 354 | #if PLATFORM(WIN) | 
|---|
| 355 | #pragma warning(disable: 4483) | 
|---|
| 356 | extern "C"{ extern void (*const __identifier( "??_7SVGPointList@WebCore@@6B@")[])(); } | 
|---|
| 357 | #else | 
|---|
| 358 | extern "C"{ extern void* _ZTVN7WebCore12SVGPointListE[]; } | 
|---|
| 359 | #endif | 
|---|
| 360 | #endif | 
|---|
| 361 |  | 
|---|
| 362 | JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, Ref<SVGPointList>&& impl) | 
|---|
| 363 | { | 
|---|
| 364 |  | 
|---|
| 365 | #if ENABLE(BINDING_INTEGRITY) | 
|---|
| 366 | void* actualVTablePointer = *(reinterpret_cast<void**>(impl.ptr())); | 
|---|
| 367 | #if PLATFORM(WIN) | 
|---|
| 368 | void* expectedVTablePointer = WTF_PREPARE_VTBL_POINTER_FOR_INSPECTION(__identifier( "??_7SVGPointList@WebCore@@6B@")); | 
|---|
| 369 | #else | 
|---|
| 370 | void* expectedVTablePointer = WTF_PREPARE_VTBL_POINTER_FOR_INSPECTION(&_ZTVN7WebCore12SVGPointListE[2]); | 
|---|
| 371 | #endif | 
|---|
| 372 |  | 
|---|
| 373 | // If this fails SVGPointList does not have a vtable, so you need to add the | 
|---|
| 374 | // ImplementationLacksVTable attribute to the interface definition | 
|---|
| 375 | static_assert(std::is_polymorphic<SVGPointList>::value, "SVGPointList is not polymorphic"); | 
|---|
| 376 |  | 
|---|
| 377 | // If you hit this assertion you either have a use after free bug, or | 
|---|
| 378 | // SVGPointList has subclasses. If SVGPointList has subclasses that get passed | 
|---|
| 379 | // to toJS() we currently require SVGPointList you to opt out of binding hardening | 
|---|
| 380 | // by adding the SkipVTableValidation attribute to the interface IDL definition | 
|---|
| 381 | RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer); | 
|---|
| 382 | #endif | 
|---|
| 383 | return createWrapper<SVGPointList>(globalObject, WTFMove(impl)); | 
|---|
| 384 | } | 
|---|
| 385 |  | 
|---|
| 386 | JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, SVGPointList& impl) | 
|---|
| 387 | { | 
|---|
| 388 | return wrap(state, globalObject, impl); | 
|---|
| 389 | } | 
|---|
| 390 |  | 
|---|
| 391 | SVGPointList* JSSVGPointList::toWrapped(JSC::VM& vm, JSC::JSValue value) | 
|---|
| 392 | { | 
|---|
| 393 | if (auto* wrapper = jsDynamicCast<JSSVGPointList*>(vm, value)) | 
|---|
| 394 | return &wrapper->wrapped(); | 
|---|
| 395 | return nullptr; | 
|---|
| 396 | } | 
|---|
| 397 |  | 
|---|
| 398 | } | 
|---|
| 399 |  | 
|---|