/* This file is part of the WebKit open source project. This file has been generated by generate-bindings.pl. DO NOT MODIFY! This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" #include "JSOffscreenCanvasRenderingContext2D.h" #include "OffscreenCanvasRenderingContext2D.h" #include "ActiveDOMObject.h" #include "ExtendedDOMClientIsoSubspaces.h" #include "ExtendedDOMIsoSubspaces.h" #include "IDLTypes.h" // #include "JSCSSStyleImageValue.h" #include "JSCanvasDirection.h" #include "JSCanvasFillRule.h" #include "JSCanvasGradient.h" #include "JSCanvasLineCap.h" #include "JSCanvasLineJoin.h" #include "JSCanvasPattern.h" #include "JSCanvasTextAlign.h" #include "JSCanvasTextBaseline.h" #include "JSDOMAttribute.h" #include "JSDOMBinding.h" #include "JSDOMConstructorNotConstructable.h" #include "JSDOMConvertBase.h" #include "JSDOMConvertBoolean.h" #include "JSDOMConvertDictionary.h" #include "JSDOMConvertEnumeration.h" #include "JSDOMConvertInterface.h" #include "JSDOMConvertNullable.h" #include "JSDOMConvertNumbers.h" #include "JSDOMConvertSequences.h" #include "JSDOMConvertStrings.h" #include "JSDOMConvertUnion.h" #include "JSDOMExceptionHandling.h" #include "JSDOMGlobalObject.h" #include "JSDOMGlobalObjectInlines.h" // #include "JSDOMMatrix.h" #include "JSDOMMatrix2DInit.h" #include "JSDOMOperation.h" #include "JSDOMPointInit.h" #include "JSDOMWrapperCache.h" // #include "JSHTMLCanvasElement.h" // #include "JSHTMLImageElement.h" // #include "JSHTMLVideoElement.h" // #include "JSImageBitmap.h" #include "JSImageData.h" // #include "JSImageDataSettings.h" #include "JSImageSmoothingQuality.h" #include "JSOffscreenCanvas.h" #include "JSPath2D.h" #include "JSTextMetrics.h" // #include "RuntimeEnabledFeatures.h" #include "ScriptExecutionContext.h" #include "WebCoreJSClientData.h" #include #include #include #include #include #include #include #include #include #include #include #include namespace WebCore { using namespace JSC; // Functions static JSC_DECLARE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_commit); static JSC_DECLARE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_drawImage); static JSC_DECLARE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_beginPath); static JSC_DECLARE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_fill); static JSC_DECLARE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_stroke); static JSC_DECLARE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_clip); static JSC_DECLARE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_isPointInPath); static JSC_DECLARE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_isPointInStroke); static JSC_DECLARE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_createLinearGradient); static JSC_DECLARE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_createRadialGradient); static JSC_DECLARE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_createConicGradient); static JSC_DECLARE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_createPattern); static JSC_DECLARE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_createImageData); static JSC_DECLARE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_getImageData); static JSC_DECLARE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_putImageData); static JSC_DECLARE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_closePath); static JSC_DECLARE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_moveTo); static JSC_DECLARE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_lineTo); static JSC_DECLARE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_quadraticCurveTo); static JSC_DECLARE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_bezierCurveTo); static JSC_DECLARE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_arcTo); static JSC_DECLARE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_rect); static JSC_DECLARE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_roundRect); static JSC_DECLARE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_arc); static JSC_DECLARE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_ellipse); static JSC_DECLARE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_setLineDash); static JSC_DECLARE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_getLineDash); static JSC_DECLARE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_clearRect); static JSC_DECLARE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_fillRect); static JSC_DECLARE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_strokeRect); static JSC_DECLARE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_save); static JSC_DECLARE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_restore); static JSC_DECLARE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_fillText); static JSC_DECLARE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_strokeText); static JSC_DECLARE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_measureText); static JSC_DECLARE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_scale); static JSC_DECLARE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_rotate); static JSC_DECLARE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_translate); static JSC_DECLARE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_transform); static JSC_DECLARE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_getTransform); static JSC_DECLARE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_setTransform); static JSC_DECLARE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_resetTransform); // Attributes static JSC_DECLARE_CUSTOM_GETTER(jsOffscreenCanvasRenderingContext2DConstructor); static JSC_DECLARE_CUSTOM_GETTER(jsOffscreenCanvasRenderingContext2D_canvas); static JSC_DECLARE_CUSTOM_GETTER(jsOffscreenCanvasRenderingContext2D_globalAlpha); static JSC_DECLARE_CUSTOM_SETTER(setJSOffscreenCanvasRenderingContext2D_globalAlpha); static JSC_DECLARE_CUSTOM_GETTER(jsOffscreenCanvasRenderingContext2D_globalCompositeOperation); static JSC_DECLARE_CUSTOM_SETTER(setJSOffscreenCanvasRenderingContext2D_globalCompositeOperation); static JSC_DECLARE_CUSTOM_GETTER(jsOffscreenCanvasRenderingContext2D_strokeStyle); static JSC_DECLARE_CUSTOM_SETTER(setJSOffscreenCanvasRenderingContext2D_strokeStyle); static JSC_DECLARE_CUSTOM_GETTER(jsOffscreenCanvasRenderingContext2D_fillStyle); static JSC_DECLARE_CUSTOM_SETTER(setJSOffscreenCanvasRenderingContext2D_fillStyle); static JSC_DECLARE_CUSTOM_GETTER(jsOffscreenCanvasRenderingContext2D_imageSmoothingEnabled); static JSC_DECLARE_CUSTOM_SETTER(setJSOffscreenCanvasRenderingContext2D_imageSmoothingEnabled); static JSC_DECLARE_CUSTOM_GETTER(jsOffscreenCanvasRenderingContext2D_imageSmoothingQuality); static JSC_DECLARE_CUSTOM_SETTER(setJSOffscreenCanvasRenderingContext2D_imageSmoothingQuality); static JSC_DECLARE_CUSTOM_GETTER(jsOffscreenCanvasRenderingContext2D_currentX); static JSC_DECLARE_CUSTOM_GETTER(jsOffscreenCanvasRenderingContext2D_currentY); static JSC_DECLARE_CUSTOM_GETTER(jsOffscreenCanvasRenderingContext2D_lineWidth); static JSC_DECLARE_CUSTOM_SETTER(setJSOffscreenCanvasRenderingContext2D_lineWidth); static JSC_DECLARE_CUSTOM_GETTER(jsOffscreenCanvasRenderingContext2D_lineCap); static JSC_DECLARE_CUSTOM_SETTER(setJSOffscreenCanvasRenderingContext2D_lineCap); static JSC_DECLARE_CUSTOM_GETTER(jsOffscreenCanvasRenderingContext2D_lineJoin); static JSC_DECLARE_CUSTOM_SETTER(setJSOffscreenCanvasRenderingContext2D_lineJoin); static JSC_DECLARE_CUSTOM_GETTER(jsOffscreenCanvasRenderingContext2D_miterLimit); static JSC_DECLARE_CUSTOM_SETTER(setJSOffscreenCanvasRenderingContext2D_miterLimit); static JSC_DECLARE_CUSTOM_GETTER(jsOffscreenCanvasRenderingContext2D_lineDashOffset); static JSC_DECLARE_CUSTOM_SETTER(setJSOffscreenCanvasRenderingContext2D_lineDashOffset); static JSC_DECLARE_CUSTOM_GETTER(jsOffscreenCanvasRenderingContext2D_shadowOffsetX); static JSC_DECLARE_CUSTOM_SETTER(setJSOffscreenCanvasRenderingContext2D_shadowOffsetX); static JSC_DECLARE_CUSTOM_GETTER(jsOffscreenCanvasRenderingContext2D_shadowOffsetY); static JSC_DECLARE_CUSTOM_SETTER(setJSOffscreenCanvasRenderingContext2D_shadowOffsetY); static JSC_DECLARE_CUSTOM_GETTER(jsOffscreenCanvasRenderingContext2D_shadowBlur); static JSC_DECLARE_CUSTOM_SETTER(setJSOffscreenCanvasRenderingContext2D_shadowBlur); static JSC_DECLARE_CUSTOM_GETTER(jsOffscreenCanvasRenderingContext2D_shadowColor); static JSC_DECLARE_CUSTOM_SETTER(setJSOffscreenCanvasRenderingContext2D_shadowColor); static JSC_DECLARE_CUSTOM_GETTER(jsOffscreenCanvasRenderingContext2D_font); static JSC_DECLARE_CUSTOM_SETTER(setJSOffscreenCanvasRenderingContext2D_font); static JSC_DECLARE_CUSTOM_GETTER(jsOffscreenCanvasRenderingContext2D_textAlign); static JSC_DECLARE_CUSTOM_SETTER(setJSOffscreenCanvasRenderingContext2D_textAlign); static JSC_DECLARE_CUSTOM_GETTER(jsOffscreenCanvasRenderingContext2D_textBaseline); static JSC_DECLARE_CUSTOM_SETTER(setJSOffscreenCanvasRenderingContext2D_textBaseline); static JSC_DECLARE_CUSTOM_GETTER(jsOffscreenCanvasRenderingContext2D_direction); static JSC_DECLARE_CUSTOM_SETTER(setJSOffscreenCanvasRenderingContext2D_direction); class JSOffscreenCanvasRenderingContext2DPrototype final : public JSC::JSNonFinalObject { public: using Base = JSC::JSNonFinalObject; static JSOffscreenCanvasRenderingContext2DPrototype* create(JSC::VM& vm, JSDOMGlobalObject* globalObject, JSC::Structure* structure) { JSOffscreenCanvasRenderingContext2DPrototype* ptr = new (NotNull, JSC::allocateCell(vm)) JSOffscreenCanvasRenderingContext2DPrototype(vm, globalObject, structure); ptr->finishCreation(vm); return ptr; } DECLARE_INFO; template static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm) { STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSOffscreenCanvasRenderingContext2DPrototype, Base); return &vm.plainObjectSpace(); } static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype) { return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info()); } private: JSOffscreenCanvasRenderingContext2DPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure) : JSC::JSNonFinalObject(vm, structure) { } void finishCreation(JSC::VM&); }; STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSOffscreenCanvasRenderingContext2DPrototype, JSOffscreenCanvasRenderingContext2DPrototype::Base); using JSOffscreenCanvasRenderingContext2DDOMConstructor = JSDOMConstructorNotConstructable; template<> const ClassInfo JSOffscreenCanvasRenderingContext2DDOMConstructor::s_info = { "OffscreenCanvasRenderingContext2D"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSOffscreenCanvasRenderingContext2DDOMConstructor) }; template<> JSValue JSOffscreenCanvasRenderingContext2DDOMConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject) { UNUSED_PARAM(vm); return globalObject.functionPrototype(); } template<> void JSOffscreenCanvasRenderingContext2DDOMConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject) { putDirect(vm, vm.propertyNames->length, jsNumber(0), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); JSString* nameString = jsNontrivialString(vm, "OffscreenCanvasRenderingContext2D"_s); m_originalName.set(vm, this, nameString); putDirect(vm, vm.propertyNames->name, nameString, JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); putDirect(vm, vm.propertyNames->prototype, JSOffscreenCanvasRenderingContext2D::prototype(vm, globalObject), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum | JSC::PropertyAttribute::DontDelete); } /* Hash table for prototype */ static const HashTableValue JSOffscreenCanvasRenderingContext2DPrototypeTableValues[] = { { "constructor", static_cast(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t) static_cast(jsOffscreenCanvasRenderingContext2DConstructor), (intptr_t) static_cast(0) } }, { "canvas", static_cast(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t) static_cast(jsOffscreenCanvasRenderingContext2D_canvas), (intptr_t) static_cast(0) } }, { "globalAlpha", static_cast(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t) static_cast(jsOffscreenCanvasRenderingContext2D_globalAlpha), (intptr_t) static_cast(setJSOffscreenCanvasRenderingContext2D_globalAlpha) } }, { "globalCompositeOperation", static_cast(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t) static_cast(jsOffscreenCanvasRenderingContext2D_globalCompositeOperation), (intptr_t) static_cast(setJSOffscreenCanvasRenderingContext2D_globalCompositeOperation) } }, { "strokeStyle", static_cast(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t) static_cast(jsOffscreenCanvasRenderingContext2D_strokeStyle), (intptr_t) static_cast(setJSOffscreenCanvasRenderingContext2D_strokeStyle) } }, { "fillStyle", static_cast(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t) static_cast(jsOffscreenCanvasRenderingContext2D_fillStyle), (intptr_t) static_cast(setJSOffscreenCanvasRenderingContext2D_fillStyle) } }, { "imageSmoothingEnabled", static_cast(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t) static_cast(jsOffscreenCanvasRenderingContext2D_imageSmoothingEnabled), (intptr_t) static_cast(setJSOffscreenCanvasRenderingContext2D_imageSmoothingEnabled) } }, { "imageSmoothingQuality", static_cast(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t) static_cast(jsOffscreenCanvasRenderingContext2D_imageSmoothingQuality), (intptr_t) static_cast(setJSOffscreenCanvasRenderingContext2D_imageSmoothingQuality) } }, { "currentX", static_cast(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t) static_cast(jsOffscreenCanvasRenderingContext2D_currentX), (intptr_t) static_cast(0) } }, { "currentY", static_cast(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t) static_cast(jsOffscreenCanvasRenderingContext2D_currentY), (intptr_t) static_cast(0) } }, { "lineWidth", static_cast(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t) static_cast(jsOffscreenCanvasRenderingContext2D_lineWidth), (intptr_t) static_cast(setJSOffscreenCanvasRenderingContext2D_lineWidth) } }, { "lineCap", static_cast(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t) static_cast(jsOffscreenCanvasRenderingContext2D_lineCap), (intptr_t) static_cast(setJSOffscreenCanvasRenderingContext2D_lineCap) } }, { "lineJoin", static_cast(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t) static_cast(jsOffscreenCanvasRenderingContext2D_lineJoin), (intptr_t) static_cast(setJSOffscreenCanvasRenderingContext2D_lineJoin) } }, { "miterLimit", static_cast(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t) static_cast(jsOffscreenCanvasRenderingContext2D_miterLimit), (intptr_t) static_cast(setJSOffscreenCanvasRenderingContext2D_miterLimit) } }, { "lineDashOffset", static_cast(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t) static_cast(jsOffscreenCanvasRenderingContext2D_lineDashOffset), (intptr_t) static_cast(setJSOffscreenCanvasRenderingContext2D_lineDashOffset) } }, { "shadowOffsetX", static_cast(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t) static_cast(jsOffscreenCanvasRenderingContext2D_shadowOffsetX), (intptr_t) static_cast(setJSOffscreenCanvasRenderingContext2D_shadowOffsetX) } }, { "shadowOffsetY", static_cast(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t) static_cast(jsOffscreenCanvasRenderingContext2D_shadowOffsetY), (intptr_t) static_cast(setJSOffscreenCanvasRenderingContext2D_shadowOffsetY) } }, { "shadowBlur", static_cast(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t) static_cast(jsOffscreenCanvasRenderingContext2D_shadowBlur), (intptr_t) static_cast(setJSOffscreenCanvasRenderingContext2D_shadowBlur) } }, { "shadowColor", static_cast(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t) static_cast(jsOffscreenCanvasRenderingContext2D_shadowColor), (intptr_t) static_cast(setJSOffscreenCanvasRenderingContext2D_shadowColor) } }, { "font", static_cast(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t) static_cast(jsOffscreenCanvasRenderingContext2D_font), (intptr_t) static_cast(setJSOffscreenCanvasRenderingContext2D_font) } }, { "textAlign", static_cast(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t) static_cast(jsOffscreenCanvasRenderingContext2D_textAlign), (intptr_t) static_cast(setJSOffscreenCanvasRenderingContext2D_textAlign) } }, { "textBaseline", static_cast(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t) static_cast(jsOffscreenCanvasRenderingContext2D_textBaseline), (intptr_t) static_cast(setJSOffscreenCanvasRenderingContext2D_textBaseline) } }, { "direction", static_cast(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t) static_cast(jsOffscreenCanvasRenderingContext2D_direction), (intptr_t) static_cast(setJSOffscreenCanvasRenderingContext2D_direction) } }, { "commit", static_cast(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t) static_cast(jsOffscreenCanvasRenderingContext2DPrototypeFunction_commit), (intptr_t)(0) } }, { "drawImage", static_cast(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t) static_cast(jsOffscreenCanvasRenderingContext2DPrototypeFunction_drawImage), (intptr_t)(3) } }, { "beginPath", static_cast(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t) static_cast(jsOffscreenCanvasRenderingContext2DPrototypeFunction_beginPath), (intptr_t)(0) } }, { "fill", static_cast(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t) static_cast(jsOffscreenCanvasRenderingContext2DPrototypeFunction_fill), (intptr_t)(0) } }, { "stroke", static_cast(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t) static_cast(jsOffscreenCanvasRenderingContext2DPrototypeFunction_stroke), (intptr_t)(0) } }, { "clip", static_cast(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t) static_cast(jsOffscreenCanvasRenderingContext2DPrototypeFunction_clip), (intptr_t)(0) } }, { "isPointInPath", static_cast(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t) static_cast(jsOffscreenCanvasRenderingContext2DPrototypeFunction_isPointInPath), (intptr_t)(2) } }, { "isPointInStroke", static_cast(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t) static_cast(jsOffscreenCanvasRenderingContext2DPrototypeFunction_isPointInStroke), (intptr_t)(2) } }, { "createLinearGradient", static_cast(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t) static_cast(jsOffscreenCanvasRenderingContext2DPrototypeFunction_createLinearGradient), (intptr_t)(4) } }, { "createRadialGradient", static_cast(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t) static_cast(jsOffscreenCanvasRenderingContext2DPrototypeFunction_createRadialGradient), (intptr_t)(6) } }, { "createConicGradient", static_cast(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t) static_cast(jsOffscreenCanvasRenderingContext2DPrototypeFunction_createConicGradient), (intptr_t)(3) } }, { "createPattern", static_cast(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t) static_cast(jsOffscreenCanvasRenderingContext2DPrototypeFunction_createPattern), (intptr_t)(2) } }, { "createImageData", static_cast(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t) static_cast(jsOffscreenCanvasRenderingContext2DPrototypeFunction_createImageData), (intptr_t)(1) } }, { "getImageData", static_cast(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t) static_cast(jsOffscreenCanvasRenderingContext2DPrototypeFunction_getImageData), (intptr_t)(4) } }, { "putImageData", static_cast(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t) static_cast(jsOffscreenCanvasRenderingContext2DPrototypeFunction_putImageData), (intptr_t)(3) } }, { "closePath", static_cast(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t) static_cast(jsOffscreenCanvasRenderingContext2DPrototypeFunction_closePath), (intptr_t)(0) } }, { "moveTo", static_cast(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t) static_cast(jsOffscreenCanvasRenderingContext2DPrototypeFunction_moveTo), (intptr_t)(2) } }, { "lineTo", static_cast(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t) static_cast(jsOffscreenCanvasRenderingContext2DPrototypeFunction_lineTo), (intptr_t)(2) } }, { "quadraticCurveTo", static_cast(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t) static_cast(jsOffscreenCanvasRenderingContext2DPrototypeFunction_quadraticCurveTo), (intptr_t)(4) } }, { "bezierCurveTo", static_cast(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t) static_cast(jsOffscreenCanvasRenderingContext2DPrototypeFunction_bezierCurveTo), (intptr_t)(6) } }, { "arcTo", static_cast(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t) static_cast(jsOffscreenCanvasRenderingContext2DPrototypeFunction_arcTo), (intptr_t)(5) } }, { "rect", static_cast(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t) static_cast(jsOffscreenCanvasRenderingContext2DPrototypeFunction_rect), (intptr_t)(4) } }, { "roundRect", static_cast(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t) static_cast(jsOffscreenCanvasRenderingContext2DPrototypeFunction_roundRect), (intptr_t)(5) } }, { "arc", static_cast(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t) static_cast(jsOffscreenCanvasRenderingContext2DPrototypeFunction_arc), (intptr_t)(5) } }, { "ellipse", static_cast(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t) static_cast(jsOffscreenCanvasRenderingContext2DPrototypeFunction_ellipse), (intptr_t)(7) } }, { "setLineDash", static_cast(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t) static_cast(jsOffscreenCanvasRenderingContext2DPrototypeFunction_setLineDash), (intptr_t)(1) } }, { "getLineDash", static_cast(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t) static_cast(jsOffscreenCanvasRenderingContext2DPrototypeFunction_getLineDash), (intptr_t)(0) } }, { "clearRect", static_cast(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t) static_cast(jsOffscreenCanvasRenderingContext2DPrototypeFunction_clearRect), (intptr_t)(4) } }, { "fillRect", static_cast(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t) static_cast(jsOffscreenCanvasRenderingContext2DPrototypeFunction_fillRect), (intptr_t)(4) } }, { "strokeRect", static_cast(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t) static_cast(jsOffscreenCanvasRenderingContext2DPrototypeFunction_strokeRect), (intptr_t)(4) } }, { "save", static_cast(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t) static_cast(jsOffscreenCanvasRenderingContext2DPrototypeFunction_save), (intptr_t)(0) } }, { "restore", static_cast(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t) static_cast(jsOffscreenCanvasRenderingContext2DPrototypeFunction_restore), (intptr_t)(0) } }, { "fillText", static_cast(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t) static_cast(jsOffscreenCanvasRenderingContext2DPrototypeFunction_fillText), (intptr_t)(3) } }, { "strokeText", static_cast(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t) static_cast(jsOffscreenCanvasRenderingContext2DPrototypeFunction_strokeText), (intptr_t)(3) } }, { "measureText", static_cast(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t) static_cast(jsOffscreenCanvasRenderingContext2DPrototypeFunction_measureText), (intptr_t)(1) } }, { "scale", static_cast(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t) static_cast(jsOffscreenCanvasRenderingContext2DPrototypeFunction_scale), (intptr_t)(2) } }, { "rotate", static_cast(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t) static_cast(jsOffscreenCanvasRenderingContext2DPrototypeFunction_rotate), (intptr_t)(1) } }, { "translate", static_cast(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t) static_cast(jsOffscreenCanvasRenderingContext2DPrototypeFunction_translate), (intptr_t)(2) } }, { "transform", static_cast(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t) static_cast(jsOffscreenCanvasRenderingContext2DPrototypeFunction_transform), (intptr_t)(6) } }, { "getTransform", static_cast(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t) static_cast(jsOffscreenCanvasRenderingContext2DPrototypeFunction_getTransform), (intptr_t)(0) } }, { "setTransform", static_cast(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t) static_cast(jsOffscreenCanvasRenderingContext2DPrototypeFunction_setTransform), (intptr_t)(0) } }, { "resetTransform", static_cast(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t) static_cast(jsOffscreenCanvasRenderingContext2DPrototypeFunction_resetTransform), (intptr_t)(0) } }, }; const ClassInfo JSOffscreenCanvasRenderingContext2DPrototype::s_info = { "OffscreenCanvasRenderingContext2D"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSOffscreenCanvasRenderingContext2DPrototype) }; void JSOffscreenCanvasRenderingContext2DPrototype::finishCreation(VM& vm) { Base::finishCreation(vm); reifyStaticProperties(vm, JSOffscreenCanvasRenderingContext2D::info(), JSOffscreenCanvasRenderingContext2DPrototypeTableValues, *this); // bool hasDisabledRuntimeProperties = false; // if (!RuntimeEnabledFeatures::sharedFeatures().inspectorAdditionsEnabled()) { // hasDisabledRuntimeProperties = true; // auto propertyName = Identifier::fromString(vm, reinterpret_cast("currentX"), strlen("currentX")); // VM::DeletePropertyModeScope scope(vm, VM::DeletePropertyMode::IgnoreConfigurable); // DeletePropertySlot slot; // JSObject::deleteProperty(this, globalObject(), propertyName, slot); // } // if (!RuntimeEnabledFeatures::sharedFeatures().inspectorAdditionsEnabled()) { // hasDisabledRuntimeProperties = true; // auto propertyName = Identifier::fromString(vm, reinterpret_cast("currentY"), strlen("currentY")); // VM::DeletePropertyModeScope scope(vm, VM::DeletePropertyMode::IgnoreConfigurable); // DeletePropertySlot slot; // JSObject::deleteProperty(this, globalObject(), propertyName, slot); // } // if (hasDisabledRuntimeProperties && structure()->isDictionary()) // flattenDictionaryObject(vm); JSC_TO_STRING_TAG_WITHOUT_TRANSITION(); } const ClassInfo JSOffscreenCanvasRenderingContext2D::s_info = { "OffscreenCanvasRenderingContext2D"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSOffscreenCanvasRenderingContext2D) }; JSOffscreenCanvasRenderingContext2D::JSOffscreenCanvasRenderingContext2D(Structure* structure, JSDOMGlobalObject& globalObject, Ref&& impl) : JSDOMWrapper>(structure, globalObject, WTFMove(impl)) { } void JSOffscreenCanvasRenderingContext2D::finishCreation(VM& vm) { Base::finishCreation(vm); ASSERT(inherits(vm, info())); } JSObject* JSOffscreenCanvasRenderingContext2D::createPrototype(VM& vm, JSDOMGlobalObject& globalObject) { return JSOffscreenCanvasRenderingContext2DPrototype::create(vm, &globalObject, JSOffscreenCanvasRenderingContext2DPrototype::createStructure(vm, &globalObject, globalObject.objectPrototype())); } JSObject* JSOffscreenCanvasRenderingContext2D::prototype(VM& vm, JSDOMGlobalObject& globalObject) { return getDOMPrototype(vm, globalObject); } JSValue JSOffscreenCanvasRenderingContext2D::getConstructor(VM& vm, const JSGlobalObject* globalObject) { return getDOMConstructor(vm, *jsCast(globalObject)); } void JSOffscreenCanvasRenderingContext2D::destroy(JSC::JSCell* cell) { JSOffscreenCanvasRenderingContext2D* thisObject = static_cast(cell); thisObject->JSOffscreenCanvasRenderingContext2D::~JSOffscreenCanvasRenderingContext2D(); } JSC_DEFINE_CUSTOM_GETTER(jsOffscreenCanvasRenderingContext2DConstructor, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, PropertyName)) { VM& vm = JSC::getVM(lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); auto* prototype = jsDynamicCast(vm, JSValue::decode(thisValue)); if (UNLIKELY(!prototype)) return throwVMTypeError(lexicalGlobalObject, throwScope); return JSValue::encode(JSOffscreenCanvasRenderingContext2D::getConstructor(JSC::getVM(lexicalGlobalObject), prototype->globalObject())); } static inline JSValue jsOffscreenCanvasRenderingContext2D_canvasGetter(JSGlobalObject& lexicalGlobalObject, JSOffscreenCanvasRenderingContext2D& thisObject) { auto& vm = JSC::getVM(&lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); auto& impl = thisObject.wrapped(); RELEASE_AND_RETURN(throwScope, (toJS>(lexicalGlobalObject, *thisObject.globalObject(), throwScope, impl.canvas()))); } JSC_DEFINE_CUSTOM_GETTER(jsOffscreenCanvasRenderingContext2D_canvas, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName)) { return IDLAttribute::get(*lexicalGlobalObject, thisValue, attributeName); } static inline JSValue jsOffscreenCanvasRenderingContext2D_globalAlphaGetter(JSGlobalObject& lexicalGlobalObject, JSOffscreenCanvasRenderingContext2D& thisObject) { auto& vm = JSC::getVM(&lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); auto& impl = thisObject.wrapped(); RELEASE_AND_RETURN(throwScope, (toJS(lexicalGlobalObject, throwScope, impl.globalAlpha()))); } JSC_DEFINE_CUSTOM_GETTER(jsOffscreenCanvasRenderingContext2D_globalAlpha, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName)) { return IDLAttribute::get(*lexicalGlobalObject, thisValue, attributeName); } static inline bool setJSOffscreenCanvasRenderingContext2D_globalAlphaSetter(JSGlobalObject& lexicalGlobalObject, JSOffscreenCanvasRenderingContext2D& thisObject, JSValue value) { auto& vm = JSC::getVM(&lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); auto& impl = thisObject.wrapped(); auto nativeValue = convert(lexicalGlobalObject, value); RETURN_IF_EXCEPTION(throwScope, false); invokeFunctorPropagatingExceptionIfNecessary(lexicalGlobalObject, throwScope, [&] { return impl.setGlobalAlpha(WTFMove(nativeValue)); }); return true; } JSC_DEFINE_CUSTOM_SETTER(setJSOffscreenCanvasRenderingContext2D_globalAlpha, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, EncodedJSValue encodedValue, PropertyName attributeName)) { return IDLAttribute::set(*lexicalGlobalObject, thisValue, encodedValue, attributeName); } static inline JSValue jsOffscreenCanvasRenderingContext2D_globalCompositeOperationGetter(JSGlobalObject& lexicalGlobalObject, JSOffscreenCanvasRenderingContext2D& thisObject) { auto& vm = JSC::getVM(&lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); auto& impl = thisObject.wrapped(); RELEASE_AND_RETURN(throwScope, (toJS(lexicalGlobalObject, throwScope, impl.globalCompositeOperation()))); } JSC_DEFINE_CUSTOM_GETTER(jsOffscreenCanvasRenderingContext2D_globalCompositeOperation, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName)) { return IDLAttribute::get(*lexicalGlobalObject, thisValue, attributeName); } static inline bool setJSOffscreenCanvasRenderingContext2D_globalCompositeOperationSetter(JSGlobalObject& lexicalGlobalObject, JSOffscreenCanvasRenderingContext2D& thisObject, JSValue value) { auto& vm = JSC::getVM(&lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); auto& impl = thisObject.wrapped(); auto nativeValue = convert(lexicalGlobalObject, value); RETURN_IF_EXCEPTION(throwScope, false); invokeFunctorPropagatingExceptionIfNecessary(lexicalGlobalObject, throwScope, [&] { return impl.setGlobalCompositeOperation(WTFMove(nativeValue)); }); return true; } JSC_DEFINE_CUSTOM_SETTER(setJSOffscreenCanvasRenderingContext2D_globalCompositeOperation, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, EncodedJSValue encodedValue, PropertyName attributeName)) { return IDLAttribute::set(*lexicalGlobalObject, thisValue, encodedValue, attributeName); } static inline JSValue jsOffscreenCanvasRenderingContext2D_strokeStyleGetter(JSGlobalObject& lexicalGlobalObject, JSOffscreenCanvasRenderingContext2D& thisObject) { auto& vm = JSC::getVM(&lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); auto& impl = thisObject.wrapped(); RELEASE_AND_RETURN(throwScope, (toJS, IDLInterface>>(lexicalGlobalObject, *thisObject.globalObject(), throwScope, impl.strokeStyle()))); } JSC_DEFINE_CUSTOM_GETTER(jsOffscreenCanvasRenderingContext2D_strokeStyle, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName)) { return IDLAttribute::get(*lexicalGlobalObject, thisValue, attributeName); } static inline bool setJSOffscreenCanvasRenderingContext2D_strokeStyleSetter(JSGlobalObject& lexicalGlobalObject, JSOffscreenCanvasRenderingContext2D& thisObject, JSValue value) { auto& vm = JSC::getVM(&lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); auto& impl = thisObject.wrapped(); auto nativeValue = convert, IDLInterface>>(lexicalGlobalObject, value); RETURN_IF_EXCEPTION(throwScope, false); invokeFunctorPropagatingExceptionIfNecessary(lexicalGlobalObject, throwScope, [&] { return impl.setStrokeStyle(WTFMove(nativeValue)); }); return true; } JSC_DEFINE_CUSTOM_SETTER(setJSOffscreenCanvasRenderingContext2D_strokeStyle, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, EncodedJSValue encodedValue, PropertyName attributeName)) { return IDLAttribute::set(*lexicalGlobalObject, thisValue, encodedValue, attributeName); } static inline JSValue jsOffscreenCanvasRenderingContext2D_fillStyleGetter(JSGlobalObject& lexicalGlobalObject, JSOffscreenCanvasRenderingContext2D& thisObject) { auto& vm = JSC::getVM(&lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); auto& impl = thisObject.wrapped(); RELEASE_AND_RETURN(throwScope, (toJS, IDLInterface>>(lexicalGlobalObject, *thisObject.globalObject(), throwScope, impl.fillStyle()))); } JSC_DEFINE_CUSTOM_GETTER(jsOffscreenCanvasRenderingContext2D_fillStyle, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName)) { return IDLAttribute::get(*lexicalGlobalObject, thisValue, attributeName); } static inline bool setJSOffscreenCanvasRenderingContext2D_fillStyleSetter(JSGlobalObject& lexicalGlobalObject, JSOffscreenCanvasRenderingContext2D& thisObject, JSValue value) { auto& vm = JSC::getVM(&lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); auto& impl = thisObject.wrapped(); auto nativeValue = convert, IDLInterface>>(lexicalGlobalObject, value); RETURN_IF_EXCEPTION(throwScope, false); invokeFunctorPropagatingExceptionIfNecessary(lexicalGlobalObject, throwScope, [&] { return impl.setFillStyle(WTFMove(nativeValue)); }); return true; } JSC_DEFINE_CUSTOM_SETTER(setJSOffscreenCanvasRenderingContext2D_fillStyle, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, EncodedJSValue encodedValue, PropertyName attributeName)) { return IDLAttribute::set(*lexicalGlobalObject, thisValue, encodedValue, attributeName); } static inline JSValue jsOffscreenCanvasRenderingContext2D_imageSmoothingEnabledGetter(JSGlobalObject& lexicalGlobalObject, JSOffscreenCanvasRenderingContext2D& thisObject) { auto& vm = JSC::getVM(&lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); auto& impl = thisObject.wrapped(); RELEASE_AND_RETURN(throwScope, (toJS(lexicalGlobalObject, throwScope, impl.imageSmoothingEnabled()))); } JSC_DEFINE_CUSTOM_GETTER(jsOffscreenCanvasRenderingContext2D_imageSmoothingEnabled, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName)) { return IDLAttribute::get(*lexicalGlobalObject, thisValue, attributeName); } static inline bool setJSOffscreenCanvasRenderingContext2D_imageSmoothingEnabledSetter(JSGlobalObject& lexicalGlobalObject, JSOffscreenCanvasRenderingContext2D& thisObject, JSValue value) { auto& vm = JSC::getVM(&lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); auto& impl = thisObject.wrapped(); auto nativeValue = convert(lexicalGlobalObject, value); RETURN_IF_EXCEPTION(throwScope, false); invokeFunctorPropagatingExceptionIfNecessary(lexicalGlobalObject, throwScope, [&] { return impl.setImageSmoothingEnabled(WTFMove(nativeValue)); }); return true; } JSC_DEFINE_CUSTOM_SETTER(setJSOffscreenCanvasRenderingContext2D_imageSmoothingEnabled, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, EncodedJSValue encodedValue, PropertyName attributeName)) { return IDLAttribute::set(*lexicalGlobalObject, thisValue, encodedValue, attributeName); } static inline JSValue jsOffscreenCanvasRenderingContext2D_imageSmoothingQualityGetter(JSGlobalObject& lexicalGlobalObject, JSOffscreenCanvasRenderingContext2D& thisObject) { auto& vm = JSC::getVM(&lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); auto& impl = thisObject.wrapped(); RELEASE_AND_RETURN(throwScope, (toJS>(lexicalGlobalObject, throwScope, impl.imageSmoothingQuality()))); } JSC_DEFINE_CUSTOM_GETTER(jsOffscreenCanvasRenderingContext2D_imageSmoothingQuality, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName)) { return IDLAttribute::get(*lexicalGlobalObject, thisValue, attributeName); } static inline bool setJSOffscreenCanvasRenderingContext2D_imageSmoothingQualitySetter(JSGlobalObject& lexicalGlobalObject, JSOffscreenCanvasRenderingContext2D& thisObject, JSValue value) { auto& vm = JSC::getVM(&lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); auto& impl = thisObject.wrapped(); auto optionalNativeValue = parseEnumeration(lexicalGlobalObject, value); RETURN_IF_EXCEPTION(throwScope, false); if (UNLIKELY(!optionalNativeValue)) return false; auto nativeValue = optionalNativeValue.value(); invokeFunctorPropagatingExceptionIfNecessary(lexicalGlobalObject, throwScope, [&] { return impl.setImageSmoothingQuality(WTFMove(nativeValue)); }); return true; } JSC_DEFINE_CUSTOM_SETTER(setJSOffscreenCanvasRenderingContext2D_imageSmoothingQuality, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, EncodedJSValue encodedValue, PropertyName attributeName)) { return IDLAttribute::set(*lexicalGlobalObject, thisValue, encodedValue, attributeName); } static inline JSValue jsOffscreenCanvasRenderingContext2D_currentXGetter(JSGlobalObject& lexicalGlobalObject, JSOffscreenCanvasRenderingContext2D& thisObject) { auto& vm = JSC::getVM(&lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); auto& impl = thisObject.wrapped(); RELEASE_AND_RETURN(throwScope, (toJS(lexicalGlobalObject, throwScope, impl.currentX()))); } JSC_DEFINE_CUSTOM_GETTER(jsOffscreenCanvasRenderingContext2D_currentX, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName)) { return IDLAttribute::get(*lexicalGlobalObject, thisValue, attributeName); } static inline JSValue jsOffscreenCanvasRenderingContext2D_currentYGetter(JSGlobalObject& lexicalGlobalObject, JSOffscreenCanvasRenderingContext2D& thisObject) { auto& vm = JSC::getVM(&lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); auto& impl = thisObject.wrapped(); RELEASE_AND_RETURN(throwScope, (toJS(lexicalGlobalObject, throwScope, impl.currentY()))); } JSC_DEFINE_CUSTOM_GETTER(jsOffscreenCanvasRenderingContext2D_currentY, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName)) { return IDLAttribute::get(*lexicalGlobalObject, thisValue, attributeName); } static inline JSValue jsOffscreenCanvasRenderingContext2D_lineWidthGetter(JSGlobalObject& lexicalGlobalObject, JSOffscreenCanvasRenderingContext2D& thisObject) { auto& vm = JSC::getVM(&lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); auto& impl = thisObject.wrapped(); RELEASE_AND_RETURN(throwScope, (toJS(lexicalGlobalObject, throwScope, impl.lineWidth()))); } JSC_DEFINE_CUSTOM_GETTER(jsOffscreenCanvasRenderingContext2D_lineWidth, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName)) { return IDLAttribute::get(*lexicalGlobalObject, thisValue, attributeName); } static inline bool setJSOffscreenCanvasRenderingContext2D_lineWidthSetter(JSGlobalObject& lexicalGlobalObject, JSOffscreenCanvasRenderingContext2D& thisObject, JSValue value) { auto& vm = JSC::getVM(&lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); auto& impl = thisObject.wrapped(); auto nativeValue = convert(lexicalGlobalObject, value); RETURN_IF_EXCEPTION(throwScope, false); invokeFunctorPropagatingExceptionIfNecessary(lexicalGlobalObject, throwScope, [&] { return impl.setLineWidth(WTFMove(nativeValue)); }); return true; } JSC_DEFINE_CUSTOM_SETTER(setJSOffscreenCanvasRenderingContext2D_lineWidth, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, EncodedJSValue encodedValue, PropertyName attributeName)) { return IDLAttribute::set(*lexicalGlobalObject, thisValue, encodedValue, attributeName); } static inline JSValue jsOffscreenCanvasRenderingContext2D_lineCapGetter(JSGlobalObject& lexicalGlobalObject, JSOffscreenCanvasRenderingContext2D& thisObject) { auto& vm = JSC::getVM(&lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); auto& impl = thisObject.wrapped(); RELEASE_AND_RETURN(throwScope, (toJS>(lexicalGlobalObject, throwScope, impl.lineCap()))); } JSC_DEFINE_CUSTOM_GETTER(jsOffscreenCanvasRenderingContext2D_lineCap, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName)) { return IDLAttribute::get(*lexicalGlobalObject, thisValue, attributeName); } static inline bool setJSOffscreenCanvasRenderingContext2D_lineCapSetter(JSGlobalObject& lexicalGlobalObject, JSOffscreenCanvasRenderingContext2D& thisObject, JSValue value) { auto& vm = JSC::getVM(&lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); auto& impl = thisObject.wrapped(); auto optionalNativeValue = parseEnumeration(lexicalGlobalObject, value); RETURN_IF_EXCEPTION(throwScope, false); if (UNLIKELY(!optionalNativeValue)) return false; auto nativeValue = optionalNativeValue.value(); invokeFunctorPropagatingExceptionIfNecessary(lexicalGlobalObject, throwScope, [&] { return impl.setLineCap(WTFMove(nativeValue)); }); return true; } JSC_DEFINE_CUSTOM_SETTER(setJSOffscreenCanvasRenderingContext2D_lineCap, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, EncodedJSValue encodedValue, PropertyName attributeName)) { return IDLAttribute::set(*lexicalGlobalObject, thisValue, encodedValue, attributeName); } static inline JSValue jsOffscreenCanvasRenderingContext2D_lineJoinGetter(JSGlobalObject& lexicalGlobalObject, JSOffscreenCanvasRenderingContext2D& thisObject) { auto& vm = JSC::getVM(&lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); auto& impl = thisObject.wrapped(); RELEASE_AND_RETURN(throwScope, (toJS>(lexicalGlobalObject, throwScope, impl.lineJoin()))); } JSC_DEFINE_CUSTOM_GETTER(jsOffscreenCanvasRenderingContext2D_lineJoin, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName)) { return IDLAttribute::get(*lexicalGlobalObject, thisValue, attributeName); } static inline bool setJSOffscreenCanvasRenderingContext2D_lineJoinSetter(JSGlobalObject& lexicalGlobalObject, JSOffscreenCanvasRenderingContext2D& thisObject, JSValue value) { auto& vm = JSC::getVM(&lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); auto& impl = thisObject.wrapped(); auto optionalNativeValue = parseEnumeration(lexicalGlobalObject, value); RETURN_IF_EXCEPTION(throwScope, false); if (UNLIKELY(!optionalNativeValue)) return false; auto nativeValue = optionalNativeValue.value(); invokeFunctorPropagatingExceptionIfNecessary(lexicalGlobalObject, throwScope, [&] { return impl.setLineJoin(WTFMove(nativeValue)); }); return true; } JSC_DEFINE_CUSTOM_SETTER(setJSOffscreenCanvasRenderingContext2D_lineJoin, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, EncodedJSValue encodedValue, PropertyName attributeName)) { return IDLAttribute::set(*lexicalGlobalObject, thisValue, encodedValue, attributeName); } static inline JSValue jsOffscreenCanvasRenderingContext2D_miterLimitGetter(JSGlobalObject& lexicalGlobalObject, JSOffscreenCanvasRenderingContext2D& thisObject) { auto& vm = JSC::getVM(&lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); auto& impl = thisObject.wrapped(); RELEASE_AND_RETURN(throwScope, (toJS(lexicalGlobalObject, throwScope, impl.miterLimit()))); } JSC_DEFINE_CUSTOM_GETTER(jsOffscreenCanvasRenderingContext2D_miterLimit, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName)) { return IDLAttribute::get(*lexicalGlobalObject, thisValue, attributeName); } static inline bool setJSOffscreenCanvasRenderingContext2D_miterLimitSetter(JSGlobalObject& lexicalGlobalObject, JSOffscreenCanvasRenderingContext2D& thisObject, JSValue value) { auto& vm = JSC::getVM(&lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); auto& impl = thisObject.wrapped(); auto nativeValue = convert(lexicalGlobalObject, value); RETURN_IF_EXCEPTION(throwScope, false); invokeFunctorPropagatingExceptionIfNecessary(lexicalGlobalObject, throwScope, [&] { return impl.setMiterLimit(WTFMove(nativeValue)); }); return true; } JSC_DEFINE_CUSTOM_SETTER(setJSOffscreenCanvasRenderingContext2D_miterLimit, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, EncodedJSValue encodedValue, PropertyName attributeName)) { return IDLAttribute::set(*lexicalGlobalObject, thisValue, encodedValue, attributeName); } static inline JSValue jsOffscreenCanvasRenderingContext2D_lineDashOffsetGetter(JSGlobalObject& lexicalGlobalObject, JSOffscreenCanvasRenderingContext2D& thisObject) { auto& vm = JSC::getVM(&lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); auto& impl = thisObject.wrapped(); RELEASE_AND_RETURN(throwScope, (toJS(lexicalGlobalObject, throwScope, impl.lineDashOffset()))); } JSC_DEFINE_CUSTOM_GETTER(jsOffscreenCanvasRenderingContext2D_lineDashOffset, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName)) { return IDLAttribute::get(*lexicalGlobalObject, thisValue, attributeName); } static inline bool setJSOffscreenCanvasRenderingContext2D_lineDashOffsetSetter(JSGlobalObject& lexicalGlobalObject, JSOffscreenCanvasRenderingContext2D& thisObject, JSValue value) { auto& vm = JSC::getVM(&lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); auto& impl = thisObject.wrapped(); auto nativeValue = convert(lexicalGlobalObject, value); RETURN_IF_EXCEPTION(throwScope, false); invokeFunctorPropagatingExceptionIfNecessary(lexicalGlobalObject, throwScope, [&] { return impl.setLineDashOffset(WTFMove(nativeValue)); }); return true; } JSC_DEFINE_CUSTOM_SETTER(setJSOffscreenCanvasRenderingContext2D_lineDashOffset, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, EncodedJSValue encodedValue, PropertyName attributeName)) { return IDLAttribute::set(*lexicalGlobalObject, thisValue, encodedValue, attributeName); } static inline JSValue jsOffscreenCanvasRenderingContext2D_shadowOffsetXGetter(JSGlobalObject& lexicalGlobalObject, JSOffscreenCanvasRenderingContext2D& thisObject) { auto& vm = JSC::getVM(&lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); auto& impl = thisObject.wrapped(); RELEASE_AND_RETURN(throwScope, (toJS(lexicalGlobalObject, throwScope, impl.shadowOffsetX()))); } JSC_DEFINE_CUSTOM_GETTER(jsOffscreenCanvasRenderingContext2D_shadowOffsetX, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName)) { return IDLAttribute::get(*lexicalGlobalObject, thisValue, attributeName); } static inline bool setJSOffscreenCanvasRenderingContext2D_shadowOffsetXSetter(JSGlobalObject& lexicalGlobalObject, JSOffscreenCanvasRenderingContext2D& thisObject, JSValue value) { auto& vm = JSC::getVM(&lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); auto& impl = thisObject.wrapped(); auto nativeValue = convert(lexicalGlobalObject, value); RETURN_IF_EXCEPTION(throwScope, false); invokeFunctorPropagatingExceptionIfNecessary(lexicalGlobalObject, throwScope, [&] { return impl.setShadowOffsetX(WTFMove(nativeValue)); }); return true; } JSC_DEFINE_CUSTOM_SETTER(setJSOffscreenCanvasRenderingContext2D_shadowOffsetX, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, EncodedJSValue encodedValue, PropertyName attributeName)) { return IDLAttribute::set(*lexicalGlobalObject, thisValue, encodedValue, attributeName); } static inline JSValue jsOffscreenCanvasRenderingContext2D_shadowOffsetYGetter(JSGlobalObject& lexicalGlobalObject, JSOffscreenCanvasRenderingContext2D& thisObject) { auto& vm = JSC::getVM(&lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); auto& impl = thisObject.wrapped(); RELEASE_AND_RETURN(throwScope, (toJS(lexicalGlobalObject, throwScope, impl.shadowOffsetY()))); } JSC_DEFINE_CUSTOM_GETTER(jsOffscreenCanvasRenderingContext2D_shadowOffsetY, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName)) { return IDLAttribute::get(*lexicalGlobalObject, thisValue, attributeName); } static inline bool setJSOffscreenCanvasRenderingContext2D_shadowOffsetYSetter(JSGlobalObject& lexicalGlobalObject, JSOffscreenCanvasRenderingContext2D& thisObject, JSValue value) { auto& vm = JSC::getVM(&lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); auto& impl = thisObject.wrapped(); auto nativeValue = convert(lexicalGlobalObject, value); RETURN_IF_EXCEPTION(throwScope, false); invokeFunctorPropagatingExceptionIfNecessary(lexicalGlobalObject, throwScope, [&] { return impl.setShadowOffsetY(WTFMove(nativeValue)); }); return true; } JSC_DEFINE_CUSTOM_SETTER(setJSOffscreenCanvasRenderingContext2D_shadowOffsetY, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, EncodedJSValue encodedValue, PropertyName attributeName)) { return IDLAttribute::set(*lexicalGlobalObject, thisValue, encodedValue, attributeName); } static inline JSValue jsOffscreenCanvasRenderingContext2D_shadowBlurGetter(JSGlobalObject& lexicalGlobalObject, JSOffscreenCanvasRenderingContext2D& thisObject) { auto& vm = JSC::getVM(&lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); auto& impl = thisObject.wrapped(); RELEASE_AND_RETURN(throwScope, (toJS(lexicalGlobalObject, throwScope, impl.shadowBlur()))); } JSC_DEFINE_CUSTOM_GETTER(jsOffscreenCanvasRenderingContext2D_shadowBlur, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName)) { return IDLAttribute::get(*lexicalGlobalObject, thisValue, attributeName); } static inline bool setJSOffscreenCanvasRenderingContext2D_shadowBlurSetter(JSGlobalObject& lexicalGlobalObject, JSOffscreenCanvasRenderingContext2D& thisObject, JSValue value) { auto& vm = JSC::getVM(&lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); auto& impl = thisObject.wrapped(); auto nativeValue = convert(lexicalGlobalObject, value); RETURN_IF_EXCEPTION(throwScope, false); invokeFunctorPropagatingExceptionIfNecessary(lexicalGlobalObject, throwScope, [&] { return impl.setShadowBlur(WTFMove(nativeValue)); }); return true; } JSC_DEFINE_CUSTOM_SETTER(setJSOffscreenCanvasRenderingContext2D_shadowBlur, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, EncodedJSValue encodedValue, PropertyName attributeName)) { return IDLAttribute::set(*lexicalGlobalObject, thisValue, encodedValue, attributeName); } static inline JSValue jsOffscreenCanvasRenderingContext2D_shadowColorGetter(JSGlobalObject& lexicalGlobalObject, JSOffscreenCanvasRenderingContext2D& thisObject) { auto& vm = JSC::getVM(&lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); auto& impl = thisObject.wrapped(); RELEASE_AND_RETURN(throwScope, (toJS(lexicalGlobalObject, throwScope, impl.shadowColor()))); } JSC_DEFINE_CUSTOM_GETTER(jsOffscreenCanvasRenderingContext2D_shadowColor, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName)) { return IDLAttribute::get(*lexicalGlobalObject, thisValue, attributeName); } static inline bool setJSOffscreenCanvasRenderingContext2D_shadowColorSetter(JSGlobalObject& lexicalGlobalObject, JSOffscreenCanvasRenderingContext2D& thisObject, JSValue value) { auto& vm = JSC::getVM(&lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); auto& impl = thisObject.wrapped(); auto nativeValue = convert(lexicalGlobalObject, value); RETURN_IF_EXCEPTION(throwScope, false); invokeFunctorPropagatingExceptionIfNecessary(lexicalGlobalObject, throwScope, [&] { return impl.setShadowColor(WTFMove(nativeValue)); }); return true; } JSC_DEFINE_CUSTOM_SETTER(setJSOffscreenCanvasRenderingContext2D_shadowColor, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, EncodedJSValue encodedValue, PropertyName attributeName)) { return IDLAttribute::set(*lexicalGlobalObject, thisValue, encodedValue, attributeName); } static inline JSValue jsOffscreenCanvasRenderingContext2D_fontGetter(JSGlobalObject& lexicalGlobalObject, JSOffscreenCanvasRenderingContext2D& thisObject) { auto& vm = JSC::getVM(&lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); auto& impl = thisObject.wrapped(); RELEASE_AND_RETURN(throwScope, (toJS(lexicalGlobalObject, throwScope, impl.font()))); } JSC_DEFINE_CUSTOM_GETTER(jsOffscreenCanvasRenderingContext2D_font, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName)) { return IDLAttribute::get(*lexicalGlobalObject, thisValue, attributeName); } static inline bool setJSOffscreenCanvasRenderingContext2D_fontSetter(JSGlobalObject& lexicalGlobalObject, JSOffscreenCanvasRenderingContext2D& thisObject, JSValue value) { auto& vm = JSC::getVM(&lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); auto& impl = thisObject.wrapped(); auto nativeValue = convert(lexicalGlobalObject, value); RETURN_IF_EXCEPTION(throwScope, false); invokeFunctorPropagatingExceptionIfNecessary(lexicalGlobalObject, throwScope, [&] { return impl.setFont(WTFMove(nativeValue)); }); return true; } JSC_DEFINE_CUSTOM_SETTER(setJSOffscreenCanvasRenderingContext2D_font, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, EncodedJSValue encodedValue, PropertyName attributeName)) { return IDLAttribute::set(*lexicalGlobalObject, thisValue, encodedValue, attributeName); } static inline JSValue jsOffscreenCanvasRenderingContext2D_textAlignGetter(JSGlobalObject& lexicalGlobalObject, JSOffscreenCanvasRenderingContext2D& thisObject) { auto& vm = JSC::getVM(&lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); auto& impl = thisObject.wrapped(); RELEASE_AND_RETURN(throwScope, (toJS>(lexicalGlobalObject, throwScope, impl.textAlign()))); } JSC_DEFINE_CUSTOM_GETTER(jsOffscreenCanvasRenderingContext2D_textAlign, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName)) { return IDLAttribute::get(*lexicalGlobalObject, thisValue, attributeName); } static inline bool setJSOffscreenCanvasRenderingContext2D_textAlignSetter(JSGlobalObject& lexicalGlobalObject, JSOffscreenCanvasRenderingContext2D& thisObject, JSValue value) { auto& vm = JSC::getVM(&lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); auto& impl = thisObject.wrapped(); auto optionalNativeValue = parseEnumeration(lexicalGlobalObject, value); RETURN_IF_EXCEPTION(throwScope, false); if (UNLIKELY(!optionalNativeValue)) return false; auto nativeValue = optionalNativeValue.value(); invokeFunctorPropagatingExceptionIfNecessary(lexicalGlobalObject, throwScope, [&] { return impl.setTextAlign(WTFMove(nativeValue)); }); return true; } JSC_DEFINE_CUSTOM_SETTER(setJSOffscreenCanvasRenderingContext2D_textAlign, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, EncodedJSValue encodedValue, PropertyName attributeName)) { return IDLAttribute::set(*lexicalGlobalObject, thisValue, encodedValue, attributeName); } static inline JSValue jsOffscreenCanvasRenderingContext2D_textBaselineGetter(JSGlobalObject& lexicalGlobalObject, JSOffscreenCanvasRenderingContext2D& thisObject) { auto& vm = JSC::getVM(&lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); auto& impl = thisObject.wrapped(); RELEASE_AND_RETURN(throwScope, (toJS>(lexicalGlobalObject, throwScope, impl.textBaseline()))); } JSC_DEFINE_CUSTOM_GETTER(jsOffscreenCanvasRenderingContext2D_textBaseline, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName)) { return IDLAttribute::get(*lexicalGlobalObject, thisValue, attributeName); } static inline bool setJSOffscreenCanvasRenderingContext2D_textBaselineSetter(JSGlobalObject& lexicalGlobalObject, JSOffscreenCanvasRenderingContext2D& thisObject, JSValue value) { auto& vm = JSC::getVM(&lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); auto& impl = thisObject.wrapped(); auto optionalNativeValue = parseEnumeration(lexicalGlobalObject, value); RETURN_IF_EXCEPTION(throwScope, false); if (UNLIKELY(!optionalNativeValue)) return false; auto nativeValue = optionalNativeValue.value(); invokeFunctorPropagatingExceptionIfNecessary(lexicalGlobalObject, throwScope, [&] { return impl.setTextBaseline(WTFMove(nativeValue)); }); return true; } JSC_DEFINE_CUSTOM_SETTER(setJSOffscreenCanvasRenderingContext2D_textBaseline, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, EncodedJSValue encodedValue, PropertyName attributeName)) { return IDLAttribute::set(*lexicalGlobalObject, thisValue, encodedValue, attributeName); } static inline JSValue jsOffscreenCanvasRenderingContext2D_directionGetter(JSGlobalObject& lexicalGlobalObject, JSOffscreenCanvasRenderingContext2D& thisObject) { auto& vm = JSC::getVM(&lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); auto& impl = thisObject.wrapped(); RELEASE_AND_RETURN(throwScope, (toJS>(lexicalGlobalObject, throwScope, impl.direction()))); } JSC_DEFINE_CUSTOM_GETTER(jsOffscreenCanvasRenderingContext2D_direction, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName)) { return IDLAttribute::get(*lexicalGlobalObject, thisValue, attributeName); } static inline bool setJSOffscreenCanvasRenderingContext2D_directionSetter(JSGlobalObject& lexicalGlobalObject, JSOffscreenCanvasRenderingContext2D& thisObject, JSValue value) { auto& vm = JSC::getVM(&lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); auto& impl = thisObject.wrapped(); auto optionalNativeValue = parseEnumeration(lexicalGlobalObject, value); RETURN_IF_EXCEPTION(throwScope, false); if (UNLIKELY(!optionalNativeValue)) return false; auto nativeValue = optionalNativeValue.value(); invokeFunctorPropagatingExceptionIfNecessary(lexicalGlobalObject, throwScope, [&] { return impl.setDirection(WTFMove(nativeValue)); }); return true; } JSC_DEFINE_CUSTOM_SETTER(setJSOffscreenCanvasRenderingContext2D_direction, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, EncodedJSValue encodedValue, PropertyName attributeName)) { return IDLAttribute::set(*lexicalGlobalObject, thisValue, encodedValue, attributeName); } static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunction_commitBody(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation::ClassParameter castedThis) { auto& vm = JSC::getVM(lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); UNUSED_PARAM(throwScope); UNUSED_PARAM(callFrame); auto& impl = castedThis->wrapped(); RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.commit(); }))); } JSC_DEFINE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_commit, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) { return IDLOperation::call(*lexicalGlobalObject, *callFrame, "commit"); } // static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunction_drawImage1Body(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation::ClassParameter castedThis) // { // auto& vm = JSC::getVM(lexicalGlobalObject); // auto throwScope = DECLARE_THROW_SCOPE(vm); // UNUSED_PARAM(throwScope); // UNUSED_PARAM(callFrame); // auto& impl = castedThis->wrapped(); // EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0); // auto image = convert, IDLInterface, IDLInterface, IDLInterface, IDLInterface>>(*lexicalGlobalObject, argument0.value()); // RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); // EnsureStillAliveScope argument1 = callFrame->uncheckedArgument(1); // auto dx = convert(*lexicalGlobalObject, argument1.value()); // RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); // EnsureStillAliveScope argument2 = callFrame->uncheckedArgument(2); // auto dy = convert(*lexicalGlobalObject, argument2.value()); // RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); // RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.drawImage(WTFMove(image), WTFMove(dx), WTFMove(dy)); }))); // } // static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunction_drawImage2Body(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation::ClassParameter castedThis) // { // auto& vm = JSC::getVM(lexicalGlobalObject); // auto throwScope = DECLARE_THROW_SCOPE(vm); // UNUSED_PARAM(throwScope); // UNUSED_PARAM(callFrame); // auto& impl = castedThis->wrapped(); // EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0); // auto image = convert, IDLInterface, IDLInterface, IDLInterface, IDLInterface>>(*lexicalGlobalObject, argument0.value()); // RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); // EnsureStillAliveScope argument1 = callFrame->uncheckedArgument(1); // auto dx = convert(*lexicalGlobalObject, argument1.value()); // RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); // EnsureStillAliveScope argument2 = callFrame->uncheckedArgument(2); // auto dy = convert(*lexicalGlobalObject, argument2.value()); // RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); // EnsureStillAliveScope argument3 = callFrame->uncheckedArgument(3); // auto dw = convert(*lexicalGlobalObject, argument3.value()); // RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); // EnsureStillAliveScope argument4 = callFrame->uncheckedArgument(4); // auto dh = convert(*lexicalGlobalObject, argument4.value()); // RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); // RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.drawImage(WTFMove(image), WTFMove(dx), WTFMove(dy), WTFMove(dw), WTFMove(dh)); }))); // } // static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunction_drawImage3Body(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation::ClassParameter castedThis) // { // auto& vm = JSC::getVM(lexicalGlobalObject); // auto throwScope = DECLARE_THROW_SCOPE(vm); // UNUSED_PARAM(throwScope); // UNUSED_PARAM(callFrame); // auto& impl = castedThis->wrapped(); // EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0); // auto image = convert, IDLInterface, IDLInterface, IDLInterface, IDLInterface>>(*lexicalGlobalObject, argument0.value()); // RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); // EnsureStillAliveScope argument1 = callFrame->uncheckedArgument(1); // auto sx = convert(*lexicalGlobalObject, argument1.value()); // RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); // EnsureStillAliveScope argument2 = callFrame->uncheckedArgument(2); // auto sy = convert(*lexicalGlobalObject, argument2.value()); // RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); // EnsureStillAliveScope argument3 = callFrame->uncheckedArgument(3); // auto sw = convert(*lexicalGlobalObject, argument3.value()); // RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); // EnsureStillAliveScope argument4 = callFrame->uncheckedArgument(4); // auto sh = convert(*lexicalGlobalObject, argument4.value()); // RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); // EnsureStillAliveScope argument5 = callFrame->uncheckedArgument(5); // auto dx = convert(*lexicalGlobalObject, argument5.value()); // RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); // EnsureStillAliveScope argument6 = callFrame->uncheckedArgument(6); // auto dy = convert(*lexicalGlobalObject, argument6.value()); // RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); // EnsureStillAliveScope argument7 = callFrame->uncheckedArgument(7); // auto dw = convert(*lexicalGlobalObject, argument7.value()); // RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); // EnsureStillAliveScope argument8 = callFrame->uncheckedArgument(8); // auto dh = convert(*lexicalGlobalObject, argument8.value()); // RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); // RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.drawImage(WTFMove(image), WTFMove(sx), WTFMove(sy), WTFMove(sw), WTFMove(sh), WTFMove(dx), WTFMove(dy), WTFMove(dw), WTFMove(dh)); }))); // } // static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunction_drawImageOverloadDispatcher(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation::ClassParameter castedThis) // { // auto& vm = JSC::getVM(lexicalGlobalObject); // auto throwScope = DECLARE_THROW_SCOPE(vm); // UNUSED_PARAM(throwScope); // UNUSED_PARAM(callFrame); // size_t argsCount = std::min(9, callFrame->argumentCount()); // if (argsCount == 3) { // RELEASE_AND_RETURN(throwScope, (jsOffscreenCanvasRenderingContext2DPrototypeFunction_drawImage1Body(lexicalGlobalObject, callFrame, castedThis))); // } // if (argsCount == 5) { // RELEASE_AND_RETURN(throwScope, (jsOffscreenCanvasRenderingContext2DPrototypeFunction_drawImage2Body(lexicalGlobalObject, callFrame, castedThis))); // } // if (argsCount == 9) { // RELEASE_AND_RETURN(throwScope, (jsOffscreenCanvasRenderingContext2DPrototypeFunction_drawImage3Body(lexicalGlobalObject, callFrame, castedThis))); // } // return argsCount < 3 ? throwVMError(lexicalGlobalObject, throwScope, createNotEnoughArgumentsError(lexicalGlobalObject)) : throwVMTypeError(lexicalGlobalObject, throwScope); // } JSC_DEFINE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_drawImage, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) { return JSC::JSValue::encode(JSC::jsUndefined()); // return IDLOperation::call(*lexicalGlobalObject, *callFrame, "drawImage"); } static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunction_beginPathBody(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation::ClassParameter castedThis) { auto& vm = JSC::getVM(lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); UNUSED_PARAM(throwScope); UNUSED_PARAM(callFrame); auto& impl = castedThis->wrapped(); RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.beginPath(); }))); } JSC_DEFINE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_beginPath, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) { return IDLOperation::call(*lexicalGlobalObject, *callFrame, "beginPath"); } static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunction_fill1Body(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation::ClassParameter castedThis) { auto& vm = JSC::getVM(lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); UNUSED_PARAM(throwScope); UNUSED_PARAM(callFrame); auto& impl = castedThis->wrapped(); EnsureStillAliveScope argument0 = callFrame->argument(0); auto fillRule = argument0.value().isUndefined() ? CanvasFillRule::Nonzero : convert>(*lexicalGlobalObject, argument0.value(), [](JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& scope) { throwArgumentMustBeEnumError(lexicalGlobalObject, scope, 0, "fillRule", "OffscreenCanvasRenderingContext2D", "fill", expectedEnumerationValues()); }); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.fill(WTFMove(fillRule)); }))); } static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunction_fill2Body(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation::ClassParameter castedThis) { auto& vm = JSC::getVM(lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); UNUSED_PARAM(throwScope); UNUSED_PARAM(callFrame); auto& impl = castedThis->wrapped(); EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0); auto path = convert>(*lexicalGlobalObject, argument0.value(), [](JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& scope) { throwArgumentTypeError(lexicalGlobalObject, scope, 0, "path", "OffscreenCanvasRenderingContext2D", "fill", "Path2D"); }); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument1 = callFrame->argument(1); auto fillRule = argument1.value().isUndefined() ? CanvasFillRule::Nonzero : convert>(*lexicalGlobalObject, argument1.value(), [](JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& scope) { throwArgumentMustBeEnumError(lexicalGlobalObject, scope, 1, "fillRule", "OffscreenCanvasRenderingContext2D", "fill", expectedEnumerationValues()); }); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.fill(*path, WTFMove(fillRule)); }))); } static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunction_fillOverloadDispatcher(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation::ClassParameter castedThis) { auto& vm = JSC::getVM(lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); UNUSED_PARAM(throwScope); UNUSED_PARAM(callFrame); size_t argsCount = std::min(2, callFrame->argumentCount()); if (argsCount == 0) { RELEASE_AND_RETURN(throwScope, (jsOffscreenCanvasRenderingContext2DPrototypeFunction_fill1Body(lexicalGlobalObject, callFrame, castedThis))); } if (argsCount == 1) { JSValue distinguishingArg = callFrame->uncheckedArgument(0); if (distinguishingArg.isUndefined()) RELEASE_AND_RETURN(throwScope, (jsOffscreenCanvasRenderingContext2DPrototypeFunction_fill1Body(lexicalGlobalObject, callFrame, castedThis))); if (distinguishingArg.isObject() && asObject(distinguishingArg)->inherits(vm)) RELEASE_AND_RETURN(throwScope, (jsOffscreenCanvasRenderingContext2DPrototypeFunction_fill2Body(lexicalGlobalObject, callFrame, castedThis))); RELEASE_AND_RETURN(throwScope, (jsOffscreenCanvasRenderingContext2DPrototypeFunction_fill1Body(lexicalGlobalObject, callFrame, castedThis))); } if (argsCount == 2) { RELEASE_AND_RETURN(throwScope, (jsOffscreenCanvasRenderingContext2DPrototypeFunction_fill2Body(lexicalGlobalObject, callFrame, castedThis))); } return throwVMTypeError(lexicalGlobalObject, throwScope); } JSC_DEFINE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_fill, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) { return IDLOperation::call(*lexicalGlobalObject, *callFrame, "fill"); } static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunction_stroke1Body(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation::ClassParameter castedThis) { auto& vm = JSC::getVM(lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); UNUSED_PARAM(throwScope); UNUSED_PARAM(callFrame); auto& impl = castedThis->wrapped(); RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.stroke(); }))); } static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunction_stroke2Body(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation::ClassParameter castedThis) { auto& vm = JSC::getVM(lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); UNUSED_PARAM(throwScope); UNUSED_PARAM(callFrame); auto& impl = castedThis->wrapped(); EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0); auto path = convert>(*lexicalGlobalObject, argument0.value(), [](JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& scope) { throwArgumentTypeError(lexicalGlobalObject, scope, 0, "path", "OffscreenCanvasRenderingContext2D", "stroke", "Path2D"); }); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.stroke(*path); }))); } static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunction_strokeOverloadDispatcher(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation::ClassParameter castedThis) { auto& vm = JSC::getVM(lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); UNUSED_PARAM(throwScope); UNUSED_PARAM(callFrame); size_t argsCount = std::min(1, callFrame->argumentCount()); if (argsCount == 0) { RELEASE_AND_RETURN(throwScope, (jsOffscreenCanvasRenderingContext2DPrototypeFunction_stroke1Body(lexicalGlobalObject, callFrame, castedThis))); } if (argsCount == 1) { RELEASE_AND_RETURN(throwScope, (jsOffscreenCanvasRenderingContext2DPrototypeFunction_stroke2Body(lexicalGlobalObject, callFrame, castedThis))); } return throwVMTypeError(lexicalGlobalObject, throwScope); } JSC_DEFINE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_stroke, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) { return IDLOperation::call(*lexicalGlobalObject, *callFrame, "stroke"); } static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunction_clip1Body(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation::ClassParameter castedThis) { auto& vm = JSC::getVM(lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); UNUSED_PARAM(throwScope); UNUSED_PARAM(callFrame); auto& impl = castedThis->wrapped(); EnsureStillAliveScope argument0 = callFrame->argument(0); auto fillRule = argument0.value().isUndefined() ? CanvasFillRule::Nonzero : convert>(*lexicalGlobalObject, argument0.value(), [](JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& scope) { throwArgumentMustBeEnumError(lexicalGlobalObject, scope, 0, "fillRule", "OffscreenCanvasRenderingContext2D", "clip", expectedEnumerationValues()); }); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.clip(WTFMove(fillRule)); }))); } static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunction_clip2Body(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation::ClassParameter castedThis) { auto& vm = JSC::getVM(lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); UNUSED_PARAM(throwScope); UNUSED_PARAM(callFrame); auto& impl = castedThis->wrapped(); EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0); auto path = convert>(*lexicalGlobalObject, argument0.value(), [](JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& scope) { throwArgumentTypeError(lexicalGlobalObject, scope, 0, "path", "OffscreenCanvasRenderingContext2D", "clip", "Path2D"); }); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument1 = callFrame->argument(1); auto fillRule = argument1.value().isUndefined() ? CanvasFillRule::Nonzero : convert>(*lexicalGlobalObject, argument1.value(), [](JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& scope) { throwArgumentMustBeEnumError(lexicalGlobalObject, scope, 1, "fillRule", "OffscreenCanvasRenderingContext2D", "clip", expectedEnumerationValues()); }); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.clip(*path, WTFMove(fillRule)); }))); } static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunction_clipOverloadDispatcher(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation::ClassParameter castedThis) { auto& vm = JSC::getVM(lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); UNUSED_PARAM(throwScope); UNUSED_PARAM(callFrame); size_t argsCount = std::min(2, callFrame->argumentCount()); if (argsCount == 0) { RELEASE_AND_RETURN(throwScope, (jsOffscreenCanvasRenderingContext2DPrototypeFunction_clip1Body(lexicalGlobalObject, callFrame, castedThis))); } if (argsCount == 1) { JSValue distinguishingArg = callFrame->uncheckedArgument(0); if (distinguishingArg.isUndefined()) RELEASE_AND_RETURN(throwScope, (jsOffscreenCanvasRenderingContext2DPrototypeFunction_clip1Body(lexicalGlobalObject, callFrame, castedThis))); if (distinguishingArg.isObject() && asObject(distinguishingArg)->inherits(vm)) RELEASE_AND_RETURN(throwScope, (jsOffscreenCanvasRenderingContext2DPrototypeFunction_clip2Body(lexicalGlobalObject, callFrame, castedThis))); RELEASE_AND_RETURN(throwScope, (jsOffscreenCanvasRenderingContext2DPrototypeFunction_clip1Body(lexicalGlobalObject, callFrame, castedThis))); } if (argsCount == 2) { RELEASE_AND_RETURN(throwScope, (jsOffscreenCanvasRenderingContext2DPrototypeFunction_clip2Body(lexicalGlobalObject, callFrame, castedThis))); } return throwVMTypeError(lexicalGlobalObject, throwScope); } JSC_DEFINE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_clip, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) { return IDLOperation::call(*lexicalGlobalObject, *callFrame, "clip"); } static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunction_isPointInPath1Body(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation::ClassParameter castedThis) { auto& vm = JSC::getVM(lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); UNUSED_PARAM(throwScope); UNUSED_PARAM(callFrame); auto& impl = castedThis->wrapped(); EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0); auto x = convert(*lexicalGlobalObject, argument0.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument1 = callFrame->uncheckedArgument(1); auto y = convert(*lexicalGlobalObject, argument1.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument2 = callFrame->argument(2); auto fillRule = argument2.value().isUndefined() ? CanvasFillRule::Nonzero : convert>(*lexicalGlobalObject, argument2.value(), [](JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& scope) { throwArgumentMustBeEnumError(lexicalGlobalObject, scope, 2, "fillRule", "OffscreenCanvasRenderingContext2D", "isPointInPath", expectedEnumerationValues()); }); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, impl.isPointInPath(WTFMove(x), WTFMove(y), WTFMove(fillRule))))); } static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunction_isPointInPath2Body(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation::ClassParameter castedThis) { auto& vm = JSC::getVM(lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); UNUSED_PARAM(throwScope); UNUSED_PARAM(callFrame); auto& impl = castedThis->wrapped(); EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0); auto path = convert>(*lexicalGlobalObject, argument0.value(), [](JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& scope) { throwArgumentTypeError(lexicalGlobalObject, scope, 0, "path", "OffscreenCanvasRenderingContext2D", "isPointInPath", "Path2D"); }); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument1 = callFrame->uncheckedArgument(1); auto x = convert(*lexicalGlobalObject, argument1.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument2 = callFrame->uncheckedArgument(2); auto y = convert(*lexicalGlobalObject, argument2.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument3 = callFrame->argument(3); auto fillRule = argument3.value().isUndefined() ? CanvasFillRule::Nonzero : convert>(*lexicalGlobalObject, argument3.value(), [](JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& scope) { throwArgumentMustBeEnumError(lexicalGlobalObject, scope, 3, "fillRule", "OffscreenCanvasRenderingContext2D", "isPointInPath", expectedEnumerationValues()); }); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, impl.isPointInPath(*path, WTFMove(x), WTFMove(y), WTFMove(fillRule))))); } static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunction_isPointInPathOverloadDispatcher(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation::ClassParameter castedThis) { auto& vm = JSC::getVM(lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); UNUSED_PARAM(throwScope); UNUSED_PARAM(callFrame); size_t argsCount = std::min(4, callFrame->argumentCount()); if (argsCount == 2) { RELEASE_AND_RETURN(throwScope, (jsOffscreenCanvasRenderingContext2DPrototypeFunction_isPointInPath1Body(lexicalGlobalObject, callFrame, castedThis))); } if (argsCount == 3) { JSValue distinguishingArg = callFrame->uncheckedArgument(0); if (distinguishingArg.isObject() && asObject(distinguishingArg)->inherits(vm)) RELEASE_AND_RETURN(throwScope, (jsOffscreenCanvasRenderingContext2DPrototypeFunction_isPointInPath2Body(lexicalGlobalObject, callFrame, castedThis))); if (distinguishingArg.isNumber()) RELEASE_AND_RETURN(throwScope, (jsOffscreenCanvasRenderingContext2DPrototypeFunction_isPointInPath1Body(lexicalGlobalObject, callFrame, castedThis))); RELEASE_AND_RETURN(throwScope, (jsOffscreenCanvasRenderingContext2DPrototypeFunction_isPointInPath1Body(lexicalGlobalObject, callFrame, castedThis))); } if (argsCount == 4) { RELEASE_AND_RETURN(throwScope, (jsOffscreenCanvasRenderingContext2DPrototypeFunction_isPointInPath2Body(lexicalGlobalObject, callFrame, castedThis))); } return argsCount < 2 ? throwVMError(lexicalGlobalObject, throwScope, createNotEnoughArgumentsError(lexicalGlobalObject)) : throwVMTypeError(lexicalGlobalObject, throwScope); } JSC_DEFINE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_isPointInPath, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) { return IDLOperation::call(*lexicalGlobalObject, *callFrame, "isPointInPath"); } static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunction_isPointInStroke1Body(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation::ClassParameter castedThis) { auto& vm = JSC::getVM(lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); UNUSED_PARAM(throwScope); UNUSED_PARAM(callFrame); auto& impl = castedThis->wrapped(); EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0); auto x = convert(*lexicalGlobalObject, argument0.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument1 = callFrame->uncheckedArgument(1); auto y = convert(*lexicalGlobalObject, argument1.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, impl.isPointInStroke(WTFMove(x), WTFMove(y))))); } static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunction_isPointInStroke2Body(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation::ClassParameter castedThis) { auto& vm = JSC::getVM(lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); UNUSED_PARAM(throwScope); UNUSED_PARAM(callFrame); auto& impl = castedThis->wrapped(); EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0); auto path = convert>(*lexicalGlobalObject, argument0.value(), [](JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& scope) { throwArgumentTypeError(lexicalGlobalObject, scope, 0, "path", "OffscreenCanvasRenderingContext2D", "isPointInStroke", "Path2D"); }); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument1 = callFrame->uncheckedArgument(1); auto x = convert(*lexicalGlobalObject, argument1.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument2 = callFrame->uncheckedArgument(2); auto y = convert(*lexicalGlobalObject, argument2.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, impl.isPointInStroke(*path, WTFMove(x), WTFMove(y))))); } static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunction_isPointInStrokeOverloadDispatcher(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation::ClassParameter castedThis) { auto& vm = JSC::getVM(lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); UNUSED_PARAM(throwScope); UNUSED_PARAM(callFrame); size_t argsCount = std::min(3, callFrame->argumentCount()); if (argsCount == 2) { RELEASE_AND_RETURN(throwScope, (jsOffscreenCanvasRenderingContext2DPrototypeFunction_isPointInStroke1Body(lexicalGlobalObject, callFrame, castedThis))); } if (argsCount == 3) { RELEASE_AND_RETURN(throwScope, (jsOffscreenCanvasRenderingContext2DPrototypeFunction_isPointInStroke2Body(lexicalGlobalObject, callFrame, castedThis))); } return argsCount < 2 ? throwVMError(lexicalGlobalObject, throwScope, createNotEnoughArgumentsError(lexicalGlobalObject)) : throwVMTypeError(lexicalGlobalObject, throwScope); } JSC_DEFINE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_isPointInStroke, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) { return IDLOperation::call(*lexicalGlobalObject, *callFrame, "isPointInStroke"); } static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunction_createLinearGradientBody(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation::ClassParameter castedThis) { auto& vm = JSC::getVM(lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); UNUSED_PARAM(throwScope); UNUSED_PARAM(callFrame); auto& impl = castedThis->wrapped(); if (UNLIKELY(callFrame->argumentCount() < 4)) return throwVMError(lexicalGlobalObject, throwScope, createNotEnoughArgumentsError(lexicalGlobalObject)); EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0); auto x0 = convert(*lexicalGlobalObject, argument0.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument1 = callFrame->uncheckedArgument(1); auto y0 = convert(*lexicalGlobalObject, argument1.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument2 = callFrame->uncheckedArgument(2); auto x1 = convert(*lexicalGlobalObject, argument2.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument3 = callFrame->uncheckedArgument(3); auto y1 = convert(*lexicalGlobalObject, argument3.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, impl.createLinearGradient(WTFMove(x0), WTFMove(y0), WTFMove(x1), WTFMove(y1))))); } JSC_DEFINE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_createLinearGradient, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) { return IDLOperation::call(*lexicalGlobalObject, *callFrame, "createLinearGradient"); } static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunction_createRadialGradientBody(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation::ClassParameter castedThis) { auto& vm = JSC::getVM(lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); UNUSED_PARAM(throwScope); UNUSED_PARAM(callFrame); auto& impl = castedThis->wrapped(); if (UNLIKELY(callFrame->argumentCount() < 6)) return throwVMError(lexicalGlobalObject, throwScope, createNotEnoughArgumentsError(lexicalGlobalObject)); EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0); auto x0 = convert(*lexicalGlobalObject, argument0.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument1 = callFrame->uncheckedArgument(1); auto y0 = convert(*lexicalGlobalObject, argument1.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument2 = callFrame->uncheckedArgument(2); auto r0 = convert(*lexicalGlobalObject, argument2.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument3 = callFrame->uncheckedArgument(3); auto x1 = convert(*lexicalGlobalObject, argument3.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument4 = callFrame->uncheckedArgument(4); auto y1 = convert(*lexicalGlobalObject, argument4.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument5 = callFrame->uncheckedArgument(5); auto r1 = convert(*lexicalGlobalObject, argument5.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, impl.createRadialGradient(WTFMove(x0), WTFMove(y0), WTFMove(r0), WTFMove(x1), WTFMove(y1), WTFMove(r1))))); } JSC_DEFINE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_createRadialGradient, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) { return IDLOperation::call(*lexicalGlobalObject, *callFrame, "createRadialGradient"); } static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunction_createConicGradientBody(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation::ClassParameter castedThis) { auto& vm = JSC::getVM(lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); UNUSED_PARAM(throwScope); UNUSED_PARAM(callFrame); auto& impl = castedThis->wrapped(); if (UNLIKELY(callFrame->argumentCount() < 3)) return throwVMError(lexicalGlobalObject, throwScope, createNotEnoughArgumentsError(lexicalGlobalObject)); EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0); auto angle = convert(*lexicalGlobalObject, argument0.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument1 = callFrame->uncheckedArgument(1); auto x = convert(*lexicalGlobalObject, argument1.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument2 = callFrame->uncheckedArgument(2); auto y = convert(*lexicalGlobalObject, argument2.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, impl.createConicGradient(WTFMove(angle), WTFMove(x), WTFMove(y))))); } JSC_DEFINE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_createConicGradient, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) { return IDLOperation::call(*lexicalGlobalObject, *callFrame, "createConicGradient"); } static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunction_createPatternBody(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation::ClassParameter castedThis) { auto& vm = JSC::getVM(lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); UNUSED_PARAM(throwScope); UNUSED_PARAM(callFrame); auto& impl = castedThis->wrapped(); if (UNLIKELY(callFrame->argumentCount() < 2)) return throwVMError(lexicalGlobalObject, throwScope, createNotEnoughArgumentsError(lexicalGlobalObject)); EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0); auto image = convert, IDLInterface, IDLInterface, IDLInterface, IDLInterface>>(*lexicalGlobalObject, argument0.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument1 = callFrame->uncheckedArgument(1); auto repetition = convert>(*lexicalGlobalObject, argument1.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS>>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, impl.createPattern(WTFMove(image), WTFMove(repetition))))); } JSC_DEFINE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_createPattern, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) { return IDLOperation::call(*lexicalGlobalObject, *callFrame, "createPattern"); } static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunction_createImageData1Body(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation::ClassParameter castedThis) { auto& vm = JSC::getVM(lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); UNUSED_PARAM(throwScope); UNUSED_PARAM(callFrame); auto& impl = castedThis->wrapped(); EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0); auto sw = convert>(*lexicalGlobalObject, argument0.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument1 = callFrame->uncheckedArgument(1); auto sh = convert>(*lexicalGlobalObject, argument1.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument2 = callFrame->argument(2); // auto settings = convert>(*lexicalGlobalObject, argument2.value()); // RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, impl.createImageData(WTFMove(sw), WTFMove(sh))))); } static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunction_createImageData2Body(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation::ClassParameter castedThis) { auto& vm = JSC::getVM(lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); UNUSED_PARAM(throwScope); UNUSED_PARAM(callFrame); auto& impl = castedThis->wrapped(); EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0); auto imagedata = convert>(*lexicalGlobalObject, argument0.value(), [](JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& scope) { throwArgumentTypeError(lexicalGlobalObject, scope, 0, "imagedata", "OffscreenCanvasRenderingContext2D", "createImageData", "ImageData"); }); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, impl.createImageData(*imagedata)))); } static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunction_createImageDataOverloadDispatcher(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation::ClassParameter castedThis) { auto& vm = JSC::getVM(lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); UNUSED_PARAM(throwScope); UNUSED_PARAM(callFrame); size_t argsCount = std::min(3, callFrame->argumentCount()); if (argsCount == 1) { RELEASE_AND_RETURN(throwScope, (jsOffscreenCanvasRenderingContext2DPrototypeFunction_createImageData2Body(lexicalGlobalObject, callFrame, castedThis))); } if (argsCount == 2) { RELEASE_AND_RETURN(throwScope, (jsOffscreenCanvasRenderingContext2DPrototypeFunction_createImageData1Body(lexicalGlobalObject, callFrame, castedThis))); } if (argsCount == 3) { RELEASE_AND_RETURN(throwScope, (jsOffscreenCanvasRenderingContext2DPrototypeFunction_createImageData1Body(lexicalGlobalObject, callFrame, castedThis))); } return argsCount < 1 ? throwVMError(lexicalGlobalObject, throwScope, createNotEnoughArgumentsError(lexicalGlobalObject)) : throwVMTypeError(lexicalGlobalObject, throwScope); } JSC_DEFINE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_createImageData, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) { return IDLOperation::call(*lexicalGlobalObject, *callFrame, "createImageData"); } static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunction_getImageDataBody(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation::ClassParameter castedThis) { auto& vm = JSC::getVM(lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); UNUSED_PARAM(throwScope); UNUSED_PARAM(callFrame); auto& impl = castedThis->wrapped(); if (UNLIKELY(callFrame->argumentCount() < 4)) return throwVMError(lexicalGlobalObject, throwScope, createNotEnoughArgumentsError(lexicalGlobalObject)); EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0); auto sx = convert>(*lexicalGlobalObject, argument0.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument1 = callFrame->uncheckedArgument(1); auto sy = convert>(*lexicalGlobalObject, argument1.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument2 = callFrame->uncheckedArgument(2); auto sw = convert>(*lexicalGlobalObject, argument2.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument3 = callFrame->uncheckedArgument(3); auto sh = convert>(*lexicalGlobalObject, argument3.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); // EnsureStillAliveScope argument4 = callFrame->argument(4); // auto settings = convert>(*lexicalGlobalObject, argument4.value()); // RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, impl.getImageData(WTFMove(sx), WTFMove(sy), WTFMove(sw), WTFMove(sh))))); } JSC_DEFINE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_getImageData, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) { return IDLOperation::call(*lexicalGlobalObject, *callFrame, "getImageData"); } static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunction_putImageData1Body(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation::ClassParameter castedThis) { auto& vm = JSC::getVM(lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); UNUSED_PARAM(throwScope); UNUSED_PARAM(callFrame); auto& impl = castedThis->wrapped(); EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0); auto imagedata = convert>(*lexicalGlobalObject, argument0.value(), [](JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& scope) { throwArgumentTypeError(lexicalGlobalObject, scope, 0, "imagedata", "OffscreenCanvasRenderingContext2D", "putImageData", "ImageData"); }); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument1 = callFrame->uncheckedArgument(1); auto dx = convert>(*lexicalGlobalObject, argument1.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument2 = callFrame->uncheckedArgument(2); auto dy = convert>(*lexicalGlobalObject, argument2.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.putImageData(*imagedata, WTFMove(dx), WTFMove(dy)); }))); } static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunction_putImageData2Body(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation::ClassParameter castedThis) { auto& vm = JSC::getVM(lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); UNUSED_PARAM(throwScope); UNUSED_PARAM(callFrame); auto& impl = castedThis->wrapped(); EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0); auto imagedata = convert>(*lexicalGlobalObject, argument0.value(), [](JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& scope) { throwArgumentTypeError(lexicalGlobalObject, scope, 0, "imagedata", "OffscreenCanvasRenderingContext2D", "putImageData", "ImageData"); }); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument1 = callFrame->uncheckedArgument(1); auto dx = convert>(*lexicalGlobalObject, argument1.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument2 = callFrame->uncheckedArgument(2); auto dy = convert>(*lexicalGlobalObject, argument2.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument3 = callFrame->uncheckedArgument(3); auto dirtyX = convert>(*lexicalGlobalObject, argument3.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument4 = callFrame->uncheckedArgument(4); auto dirtyY = convert>(*lexicalGlobalObject, argument4.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument5 = callFrame->uncheckedArgument(5); auto dirtyWidth = convert>(*lexicalGlobalObject, argument5.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument6 = callFrame->uncheckedArgument(6); auto dirtyHeight = convert>(*lexicalGlobalObject, argument6.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.putImageData(*imagedata, WTFMove(dx), WTFMove(dy), WTFMove(dirtyX), WTFMove(dirtyY), WTFMove(dirtyWidth), WTFMove(dirtyHeight)); }))); } static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunction_putImageDataOverloadDispatcher(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation::ClassParameter castedThis) { auto& vm = JSC::getVM(lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); UNUSED_PARAM(throwScope); UNUSED_PARAM(callFrame); size_t argsCount = std::min(7, callFrame->argumentCount()); if (argsCount == 3) { RELEASE_AND_RETURN(throwScope, (jsOffscreenCanvasRenderingContext2DPrototypeFunction_putImageData1Body(lexicalGlobalObject, callFrame, castedThis))); } if (argsCount == 7) { RELEASE_AND_RETURN(throwScope, (jsOffscreenCanvasRenderingContext2DPrototypeFunction_putImageData2Body(lexicalGlobalObject, callFrame, castedThis))); } return argsCount < 3 ? throwVMError(lexicalGlobalObject, throwScope, createNotEnoughArgumentsError(lexicalGlobalObject)) : throwVMTypeError(lexicalGlobalObject, throwScope); } JSC_DEFINE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_putImageData, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) { return IDLOperation::call(*lexicalGlobalObject, *callFrame, "putImageData"); } static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunction_closePathBody(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation::ClassParameter castedThis) { auto& vm = JSC::getVM(lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); UNUSED_PARAM(throwScope); UNUSED_PARAM(callFrame); auto& impl = castedThis->wrapped(); RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.closePath(); }))); } JSC_DEFINE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_closePath, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) { return IDLOperation::call(*lexicalGlobalObject, *callFrame, "closePath"); } static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunction_moveToBody(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation::ClassParameter castedThis) { auto& vm = JSC::getVM(lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); UNUSED_PARAM(throwScope); UNUSED_PARAM(callFrame); auto& impl = castedThis->wrapped(); if (UNLIKELY(callFrame->argumentCount() < 2)) return throwVMError(lexicalGlobalObject, throwScope, createNotEnoughArgumentsError(lexicalGlobalObject)); EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0); auto x = convert(*lexicalGlobalObject, argument0.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument1 = callFrame->uncheckedArgument(1); auto y = convert(*lexicalGlobalObject, argument1.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.moveTo(WTFMove(x), WTFMove(y)); }))); } JSC_DEFINE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_moveTo, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) { return IDLOperation::call(*lexicalGlobalObject, *callFrame, "moveTo"); } static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunction_lineToBody(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation::ClassParameter castedThis) { auto& vm = JSC::getVM(lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); UNUSED_PARAM(throwScope); UNUSED_PARAM(callFrame); auto& impl = castedThis->wrapped(); if (UNLIKELY(callFrame->argumentCount() < 2)) return throwVMError(lexicalGlobalObject, throwScope, createNotEnoughArgumentsError(lexicalGlobalObject)); EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0); auto x = convert(*lexicalGlobalObject, argument0.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument1 = callFrame->uncheckedArgument(1); auto y = convert(*lexicalGlobalObject, argument1.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.lineTo(WTFMove(x), WTFMove(y)); }))); } JSC_DEFINE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_lineTo, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) { return IDLOperation::call(*lexicalGlobalObject, *callFrame, "lineTo"); } static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunction_quadraticCurveToBody(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation::ClassParameter castedThis) { auto& vm = JSC::getVM(lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); UNUSED_PARAM(throwScope); UNUSED_PARAM(callFrame); auto& impl = castedThis->wrapped(); if (UNLIKELY(callFrame->argumentCount() < 4)) return throwVMError(lexicalGlobalObject, throwScope, createNotEnoughArgumentsError(lexicalGlobalObject)); EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0); auto cpx = convert(*lexicalGlobalObject, argument0.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument1 = callFrame->uncheckedArgument(1); auto cpy = convert(*lexicalGlobalObject, argument1.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument2 = callFrame->uncheckedArgument(2); auto x = convert(*lexicalGlobalObject, argument2.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument3 = callFrame->uncheckedArgument(3); auto y = convert(*lexicalGlobalObject, argument3.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.quadraticCurveTo(WTFMove(cpx), WTFMove(cpy), WTFMove(x), WTFMove(y)); }))); } JSC_DEFINE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_quadraticCurveTo, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) { return IDLOperation::call(*lexicalGlobalObject, *callFrame, "quadraticCurveTo"); } static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunction_bezierCurveToBody(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation::ClassParameter castedThis) { auto& vm = JSC::getVM(lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); UNUSED_PARAM(throwScope); UNUSED_PARAM(callFrame); auto& impl = castedThis->wrapped(); if (UNLIKELY(callFrame->argumentCount() < 6)) return throwVMError(lexicalGlobalObject, throwScope, createNotEnoughArgumentsError(lexicalGlobalObject)); EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0); auto cp1x = convert(*lexicalGlobalObject, argument0.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument1 = callFrame->uncheckedArgument(1); auto cp1y = convert(*lexicalGlobalObject, argument1.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument2 = callFrame->uncheckedArgument(2); auto cp2x = convert(*lexicalGlobalObject, argument2.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument3 = callFrame->uncheckedArgument(3); auto cp2y = convert(*lexicalGlobalObject, argument3.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument4 = callFrame->uncheckedArgument(4); auto x = convert(*lexicalGlobalObject, argument4.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument5 = callFrame->uncheckedArgument(5); auto y = convert(*lexicalGlobalObject, argument5.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.bezierCurveTo(WTFMove(cp1x), WTFMove(cp1y), WTFMove(cp2x), WTFMove(cp2y), WTFMove(x), WTFMove(y)); }))); } JSC_DEFINE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_bezierCurveTo, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) { return IDLOperation::call(*lexicalGlobalObject, *callFrame, "bezierCurveTo"); } static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunction_arcToBody(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation::ClassParameter castedThis) { auto& vm = JSC::getVM(lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); UNUSED_PARAM(throwScope); UNUSED_PARAM(callFrame); auto& impl = castedThis->wrapped(); if (UNLIKELY(callFrame->argumentCount() < 5)) return throwVMError(lexicalGlobalObject, throwScope, createNotEnoughArgumentsError(lexicalGlobalObject)); EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0); auto x1 = convert(*lexicalGlobalObject, argument0.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument1 = callFrame->uncheckedArgument(1); auto y1 = convert(*lexicalGlobalObject, argument1.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument2 = callFrame->uncheckedArgument(2); auto x2 = convert(*lexicalGlobalObject, argument2.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument3 = callFrame->uncheckedArgument(3); auto y2 = convert(*lexicalGlobalObject, argument3.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument4 = callFrame->uncheckedArgument(4); auto radius = convert(*lexicalGlobalObject, argument4.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.arcTo(WTFMove(x1), WTFMove(y1), WTFMove(x2), WTFMove(y2), WTFMove(radius)); }))); } JSC_DEFINE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_arcTo, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) { return IDLOperation::call(*lexicalGlobalObject, *callFrame, "arcTo"); } static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunction_rectBody(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation::ClassParameter castedThis) { auto& vm = JSC::getVM(lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); UNUSED_PARAM(throwScope); UNUSED_PARAM(callFrame); auto& impl = castedThis->wrapped(); if (UNLIKELY(callFrame->argumentCount() < 4)) return throwVMError(lexicalGlobalObject, throwScope, createNotEnoughArgumentsError(lexicalGlobalObject)); EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0); auto x = convert(*lexicalGlobalObject, argument0.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument1 = callFrame->uncheckedArgument(1); auto y = convert(*lexicalGlobalObject, argument1.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument2 = callFrame->uncheckedArgument(2); auto w = convert(*lexicalGlobalObject, argument2.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument3 = callFrame->uncheckedArgument(3); auto h = convert(*lexicalGlobalObject, argument3.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.rect(WTFMove(x), WTFMove(y), WTFMove(w), WTFMove(h)); }))); } JSC_DEFINE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_rect, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) { return IDLOperation::call(*lexicalGlobalObject, *callFrame, "rect"); } static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunction_roundRect1Body(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation::ClassParameter castedThis) { auto& vm = JSC::getVM(lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); UNUSED_PARAM(throwScope); UNUSED_PARAM(callFrame); auto& impl = castedThis->wrapped(); EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0); auto x = convert(*lexicalGlobalObject, argument0.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument1 = callFrame->uncheckedArgument(1); auto y = convert(*lexicalGlobalObject, argument1.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument2 = callFrame->uncheckedArgument(2); auto w = convert(*lexicalGlobalObject, argument2.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument3 = callFrame->uncheckedArgument(3); auto h = convert(*lexicalGlobalObject, argument3.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument4 = callFrame->uncheckedArgument(4); auto radii = convert>>>(*lexicalGlobalObject, argument4.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.roundRect(WTFMove(x), WTFMove(y), WTFMove(w), WTFMove(h), WTFMove(radii)); }))); } static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunction_roundRect2Body(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation::ClassParameter castedThis) { auto& vm = JSC::getVM(lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); UNUSED_PARAM(throwScope); UNUSED_PARAM(callFrame); auto& impl = castedThis->wrapped(); EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0); auto x = convert(*lexicalGlobalObject, argument0.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument1 = callFrame->uncheckedArgument(1); auto y = convert(*lexicalGlobalObject, argument1.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument2 = callFrame->uncheckedArgument(2); auto w = convert(*lexicalGlobalObject, argument2.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument3 = callFrame->uncheckedArgument(3); auto h = convert(*lexicalGlobalObject, argument3.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument4 = callFrame->uncheckedArgument(4); auto radii = convert>>(*lexicalGlobalObject, argument4.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.roundRect(WTFMove(x), WTFMove(y), WTFMove(w), WTFMove(h), WTFMove(radii)); }))); } static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunction_roundRectOverloadDispatcher(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation::ClassParameter castedThis) { auto& vm = JSC::getVM(lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); UNUSED_PARAM(throwScope); UNUSED_PARAM(callFrame); size_t argsCount = std::min(5, callFrame->argumentCount()); if (argsCount == 5) { JSValue distinguishingArg = callFrame->uncheckedArgument(4); if (distinguishingArg.isUndefinedOrNull()) RELEASE_AND_RETURN(throwScope, (jsOffscreenCanvasRenderingContext2DPrototypeFunction_roundRect2Body(lexicalGlobalObject, callFrame, castedThis))); { bool success = hasIteratorMethod(lexicalGlobalObject, distinguishingArg); RETURN_IF_EXCEPTION(throwScope, {}); if (success) RELEASE_AND_RETURN(throwScope, (jsOffscreenCanvasRenderingContext2DPrototypeFunction_roundRect1Body(lexicalGlobalObject, callFrame, castedThis))); } if (distinguishingArg.isObject()) RELEASE_AND_RETURN(throwScope, (jsOffscreenCanvasRenderingContext2DPrototypeFunction_roundRect2Body(lexicalGlobalObject, callFrame, castedThis))); if (distinguishingArg.isNumber()) RELEASE_AND_RETURN(throwScope, (jsOffscreenCanvasRenderingContext2DPrototypeFunction_roundRect2Body(lexicalGlobalObject, callFrame, castedThis))); RELEASE_AND_RETURN(throwScope, (jsOffscreenCanvasRenderingContext2DPrototypeFunction_roundRect2Body(lexicalGlobalObject, callFrame, castedThis))); } return argsCount < 5 ? throwVMError(lexicalGlobalObject, throwScope, createNotEnoughArgumentsError(lexicalGlobalObject)) : throwVMTypeError(lexicalGlobalObject, throwScope); } JSC_DEFINE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_roundRect, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) { return IDLOperation::call(*lexicalGlobalObject, *callFrame, "roundRect"); } static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunction_arcBody(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation::ClassParameter castedThis) { auto& vm = JSC::getVM(lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); UNUSED_PARAM(throwScope); UNUSED_PARAM(callFrame); auto& impl = castedThis->wrapped(); if (UNLIKELY(callFrame->argumentCount() < 5)) return throwVMError(lexicalGlobalObject, throwScope, createNotEnoughArgumentsError(lexicalGlobalObject)); EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0); auto x = convert(*lexicalGlobalObject, argument0.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument1 = callFrame->uncheckedArgument(1); auto y = convert(*lexicalGlobalObject, argument1.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument2 = callFrame->uncheckedArgument(2); auto radius = convert(*lexicalGlobalObject, argument2.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument3 = callFrame->uncheckedArgument(3); auto startAngle = convert(*lexicalGlobalObject, argument3.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument4 = callFrame->uncheckedArgument(4); auto endAngle = convert(*lexicalGlobalObject, argument4.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument5 = callFrame->argument(5); auto anticlockwise = convert(*lexicalGlobalObject, argument5.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.arc(WTFMove(x), WTFMove(y), WTFMove(radius), WTFMove(startAngle), WTFMove(endAngle), WTFMove(anticlockwise)); }))); } JSC_DEFINE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_arc, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) { return IDLOperation::call(*lexicalGlobalObject, *callFrame, "arc"); } static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunction_ellipseBody(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation::ClassParameter castedThis) { auto& vm = JSC::getVM(lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); UNUSED_PARAM(throwScope); UNUSED_PARAM(callFrame); auto& impl = castedThis->wrapped(); if (UNLIKELY(callFrame->argumentCount() < 7)) return throwVMError(lexicalGlobalObject, throwScope, createNotEnoughArgumentsError(lexicalGlobalObject)); EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0); auto x = convert(*lexicalGlobalObject, argument0.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument1 = callFrame->uncheckedArgument(1); auto y = convert(*lexicalGlobalObject, argument1.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument2 = callFrame->uncheckedArgument(2); auto radiusX = convert(*lexicalGlobalObject, argument2.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument3 = callFrame->uncheckedArgument(3); auto radiusY = convert(*lexicalGlobalObject, argument3.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument4 = callFrame->uncheckedArgument(4); auto rotation = convert(*lexicalGlobalObject, argument4.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument5 = callFrame->uncheckedArgument(5); auto startAngle = convert(*lexicalGlobalObject, argument5.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument6 = callFrame->uncheckedArgument(6); auto endAngle = convert(*lexicalGlobalObject, argument6.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument7 = callFrame->argument(7); auto anticlockwise = convert(*lexicalGlobalObject, argument7.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.ellipse(WTFMove(x), WTFMove(y), WTFMove(radiusX), WTFMove(radiusY), WTFMove(rotation), WTFMove(startAngle), WTFMove(endAngle), WTFMove(anticlockwise)); }))); } JSC_DEFINE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_ellipse, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) { return IDLOperation::call(*lexicalGlobalObject, *callFrame, "ellipse"); } static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunction_setLineDashBody(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation::ClassParameter castedThis) { auto& vm = JSC::getVM(lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); UNUSED_PARAM(throwScope); UNUSED_PARAM(callFrame); auto& impl = castedThis->wrapped(); if (UNLIKELY(callFrame->argumentCount() < 1)) return throwVMError(lexicalGlobalObject, throwScope, createNotEnoughArgumentsError(lexicalGlobalObject)); EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0); auto segments = convert>(*lexicalGlobalObject, argument0.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.setLineDash(WTFMove(segments)); }))); } JSC_DEFINE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_setLineDash, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) { return IDLOperation::call(*lexicalGlobalObject, *callFrame, "setLineDash"); } static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunction_getLineDashBody(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation::ClassParameter castedThis) { auto& vm = JSC::getVM(lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); UNUSED_PARAM(throwScope); UNUSED_PARAM(callFrame); auto& impl = castedThis->wrapped(); RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, impl.getLineDash()))); } JSC_DEFINE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_getLineDash, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) { return IDLOperation::call(*lexicalGlobalObject, *callFrame, "getLineDash"); } static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunction_clearRectBody(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation::ClassParameter castedThis) { auto& vm = JSC::getVM(lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); UNUSED_PARAM(throwScope); UNUSED_PARAM(callFrame); auto& impl = castedThis->wrapped(); if (UNLIKELY(callFrame->argumentCount() < 4)) return throwVMError(lexicalGlobalObject, throwScope, createNotEnoughArgumentsError(lexicalGlobalObject)); EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0); auto x = convert(*lexicalGlobalObject, argument0.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument1 = callFrame->uncheckedArgument(1); auto y = convert(*lexicalGlobalObject, argument1.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument2 = callFrame->uncheckedArgument(2); auto w = convert(*lexicalGlobalObject, argument2.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument3 = callFrame->uncheckedArgument(3); auto h = convert(*lexicalGlobalObject, argument3.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.clearRect(WTFMove(x), WTFMove(y), WTFMove(w), WTFMove(h)); }))); } JSC_DEFINE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_clearRect, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) { return IDLOperation::call(*lexicalGlobalObject, *callFrame, "clearRect"); } static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunction_fillRectBody(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation::ClassParameter castedThis) { auto& vm = JSC::getVM(lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); UNUSED_PARAM(throwScope); UNUSED_PARAM(callFrame); auto& impl = castedThis->wrapped(); if (UNLIKELY(callFrame->argumentCount() < 4)) return throwVMError(lexicalGlobalObject, throwScope, createNotEnoughArgumentsError(lexicalGlobalObject)); EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0); auto x = convert(*lexicalGlobalObject, argument0.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument1 = callFrame->uncheckedArgument(1); auto y = convert(*lexicalGlobalObject, argument1.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument2 = callFrame->uncheckedArgument(2); auto w = convert(*lexicalGlobalObject, argument2.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument3 = callFrame->uncheckedArgument(3); auto h = convert(*lexicalGlobalObject, argument3.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.fillRect(WTFMove(x), WTFMove(y), WTFMove(w), WTFMove(h)); }))); } JSC_DEFINE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_fillRect, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) { return IDLOperation::call(*lexicalGlobalObject, *callFrame, "fillRect"); } static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunction_strokeRectBody(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation::ClassParameter castedThis) { auto& vm = JSC::getVM(lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); UNUSED_PARAM(throwScope); UNUSED_PARAM(callFrame); auto& impl = castedThis->wrapped(); if (UNLIKELY(callFrame->argumentCount() < 4)) return throwVMError(lexicalGlobalObject, throwScope, createNotEnoughArgumentsError(lexicalGlobalObject)); EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0); auto x = convert(*lexicalGlobalObject, argument0.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument1 = callFrame->uncheckedArgument(1); auto y = convert(*lexicalGlobalObject, argument1.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument2 = callFrame->uncheckedArgument(2); auto w = convert(*lexicalGlobalObject, argument2.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument3 = callFrame->uncheckedArgument(3); auto h = convert(*lexicalGlobalObject, argument3.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.strokeRect(WTFMove(x), WTFMove(y), WTFMove(w), WTFMove(h)); }))); } JSC_DEFINE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_strokeRect, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) { return IDLOperation::call(*lexicalGlobalObject, *callFrame, "strokeRect"); } static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunction_saveBody(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation::ClassParameter castedThis) { auto& vm = JSC::getVM(lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); UNUSED_PARAM(throwScope); UNUSED_PARAM(callFrame); auto& impl = castedThis->wrapped(); RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.save(); }))); } JSC_DEFINE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_save, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) { return IDLOperation::call(*lexicalGlobalObject, *callFrame, "save"); } static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunction_restoreBody(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation::ClassParameter castedThis) { auto& vm = JSC::getVM(lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); UNUSED_PARAM(throwScope); UNUSED_PARAM(callFrame); auto& impl = castedThis->wrapped(); RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.restore(); }))); } JSC_DEFINE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_restore, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) { return IDLOperation::call(*lexicalGlobalObject, *callFrame, "restore"); } static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunction_fillTextBody(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation::ClassParameter castedThis) { auto& vm = JSC::getVM(lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); UNUSED_PARAM(throwScope); UNUSED_PARAM(callFrame); auto& impl = castedThis->wrapped(); if (UNLIKELY(callFrame->argumentCount() < 3)) return throwVMError(lexicalGlobalObject, throwScope, createNotEnoughArgumentsError(lexicalGlobalObject)); EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0); auto text = convert(*lexicalGlobalObject, argument0.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument1 = callFrame->uncheckedArgument(1); auto x = convert(*lexicalGlobalObject, argument1.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument2 = callFrame->uncheckedArgument(2); auto y = convert(*lexicalGlobalObject, argument2.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument3 = callFrame->argument(3); auto maxWidth = argument3.value().isUndefined() ? std::optional::ReturnType>() : std::optional::ReturnType>(convert(*lexicalGlobalObject, argument3.value())); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.fillText(WTFMove(text), WTFMove(x), WTFMove(y), WTFMove(maxWidth)); }))); } JSC_DEFINE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_fillText, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) { return IDLOperation::call(*lexicalGlobalObject, *callFrame, "fillText"); } static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunction_strokeTextBody(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation::ClassParameter castedThis) { auto& vm = JSC::getVM(lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); UNUSED_PARAM(throwScope); UNUSED_PARAM(callFrame); auto& impl = castedThis->wrapped(); if (UNLIKELY(callFrame->argumentCount() < 3)) return throwVMError(lexicalGlobalObject, throwScope, createNotEnoughArgumentsError(lexicalGlobalObject)); EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0); auto text = convert(*lexicalGlobalObject, argument0.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument1 = callFrame->uncheckedArgument(1); auto x = convert(*lexicalGlobalObject, argument1.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument2 = callFrame->uncheckedArgument(2); auto y = convert(*lexicalGlobalObject, argument2.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument3 = callFrame->argument(3); auto maxWidth = argument3.value().isUndefined() ? std::optional::ReturnType>() : std::optional::ReturnType>(convert(*lexicalGlobalObject, argument3.value())); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.strokeText(WTFMove(text), WTFMove(x), WTFMove(y), WTFMove(maxWidth)); }))); } JSC_DEFINE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_strokeText, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) { return IDLOperation::call(*lexicalGlobalObject, *callFrame, "strokeText"); } static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunction_measureTextBody(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation::ClassParameter castedThis) { auto& vm = JSC::getVM(lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); UNUSED_PARAM(throwScope); UNUSED_PARAM(callFrame); auto& impl = castedThis->wrapped(); if (UNLIKELY(callFrame->argumentCount() < 1)) return throwVMError(lexicalGlobalObject, throwScope, createNotEnoughArgumentsError(lexicalGlobalObject)); EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0); auto text = convert(*lexicalGlobalObject, argument0.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, impl.measureText(WTFMove(text))))); } JSC_DEFINE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_measureText, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) { return IDLOperation::call(*lexicalGlobalObject, *callFrame, "measureText"); } static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunction_scaleBody(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation::ClassParameter castedThis) { auto& vm = JSC::getVM(lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); UNUSED_PARAM(throwScope); UNUSED_PARAM(callFrame); auto& impl = castedThis->wrapped(); if (UNLIKELY(callFrame->argumentCount() < 2)) return throwVMError(lexicalGlobalObject, throwScope, createNotEnoughArgumentsError(lexicalGlobalObject)); EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0); auto x = convert(*lexicalGlobalObject, argument0.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument1 = callFrame->uncheckedArgument(1); auto y = convert(*lexicalGlobalObject, argument1.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.scale(WTFMove(x), WTFMove(y)); }))); } JSC_DEFINE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_scale, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) { return IDLOperation::call(*lexicalGlobalObject, *callFrame, "scale"); } static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunction_rotateBody(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation::ClassParameter castedThis) { auto& vm = JSC::getVM(lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); UNUSED_PARAM(throwScope); UNUSED_PARAM(callFrame); auto& impl = castedThis->wrapped(); if (UNLIKELY(callFrame->argumentCount() < 1)) return throwVMError(lexicalGlobalObject, throwScope, createNotEnoughArgumentsError(lexicalGlobalObject)); EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0); auto angle = convert(*lexicalGlobalObject, argument0.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.rotate(WTFMove(angle)); }))); } JSC_DEFINE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_rotate, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) { return IDLOperation::call(*lexicalGlobalObject, *callFrame, "rotate"); } static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunction_translateBody(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation::ClassParameter castedThis) { auto& vm = JSC::getVM(lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); UNUSED_PARAM(throwScope); UNUSED_PARAM(callFrame); auto& impl = castedThis->wrapped(); if (UNLIKELY(callFrame->argumentCount() < 2)) return throwVMError(lexicalGlobalObject, throwScope, createNotEnoughArgumentsError(lexicalGlobalObject)); EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0); auto x = convert(*lexicalGlobalObject, argument0.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument1 = callFrame->uncheckedArgument(1); auto y = convert(*lexicalGlobalObject, argument1.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.translate(WTFMove(x), WTFMove(y)); }))); } JSC_DEFINE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_translate, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) { return IDLOperation::call(*lexicalGlobalObject, *callFrame, "translate"); } static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunction_transformBody(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation::ClassParameter castedThis) { auto& vm = JSC::getVM(lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); UNUSED_PARAM(throwScope); UNUSED_PARAM(callFrame); auto& impl = castedThis->wrapped(); if (UNLIKELY(callFrame->argumentCount() < 6)) return throwVMError(lexicalGlobalObject, throwScope, createNotEnoughArgumentsError(lexicalGlobalObject)); EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0); auto a = convert(*lexicalGlobalObject, argument0.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument1 = callFrame->uncheckedArgument(1); auto b = convert(*lexicalGlobalObject, argument1.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument2 = callFrame->uncheckedArgument(2); auto c = convert(*lexicalGlobalObject, argument2.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument3 = callFrame->uncheckedArgument(3); auto d = convert(*lexicalGlobalObject, argument3.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument4 = callFrame->uncheckedArgument(4); auto e = convert(*lexicalGlobalObject, argument4.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument5 = callFrame->uncheckedArgument(5); auto f = convert(*lexicalGlobalObject, argument5.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.transform(WTFMove(a), WTFMove(b), WTFMove(c), WTFMove(d), WTFMove(e), WTFMove(f)); }))); } JSC_DEFINE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_transform, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) { return IDLOperation::call(*lexicalGlobalObject, *callFrame, "transform"); } static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunction_getTransformBody(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation::ClassParameter castedThis) { auto& vm = JSC::getVM(lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); UNUSED_PARAM(throwScope); UNUSED_PARAM(callFrame); auto& impl = castedThis->wrapped(); RELEASE_AND_RETURN(throwScope, JSValue::encode(toJSNewlyCreated>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, impl.getTransform()))); } JSC_DEFINE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_getTransform, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) { return IDLOperation::call(*lexicalGlobalObject, *callFrame, "getTransform"); } static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunction_setTransform1Body(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation::ClassParameter castedThis) { auto& vm = JSC::getVM(lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); UNUSED_PARAM(throwScope); UNUSED_PARAM(callFrame); auto& impl = castedThis->wrapped(); EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0); auto a = convert(*lexicalGlobalObject, argument0.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument1 = callFrame->uncheckedArgument(1); auto b = convert(*lexicalGlobalObject, argument1.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument2 = callFrame->uncheckedArgument(2); auto c = convert(*lexicalGlobalObject, argument2.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument3 = callFrame->uncheckedArgument(3); auto d = convert(*lexicalGlobalObject, argument3.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument4 = callFrame->uncheckedArgument(4); auto e = convert(*lexicalGlobalObject, argument4.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument5 = callFrame->uncheckedArgument(5); auto f = convert(*lexicalGlobalObject, argument5.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.setTransform(WTFMove(a), WTFMove(b), WTFMove(c), WTFMove(d), WTFMove(e), WTFMove(f)); }))); } static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunction_setTransform2Body(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation::ClassParameter castedThis) { auto& vm = JSC::getVM(lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); UNUSED_PARAM(throwScope); UNUSED_PARAM(callFrame); auto& impl = castedThis->wrapped(); EnsureStillAliveScope argument0 = callFrame->argument(0); auto transform = convert>(*lexicalGlobalObject, argument0.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.setTransform(WTFMove(transform)); }))); } static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunction_setTransformOverloadDispatcher(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation::ClassParameter castedThis) { auto& vm = JSC::getVM(lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); UNUSED_PARAM(throwScope); UNUSED_PARAM(callFrame); size_t argsCount = std::min(6, callFrame->argumentCount()); if (argsCount == 0) { RELEASE_AND_RETURN(throwScope, (jsOffscreenCanvasRenderingContext2DPrototypeFunction_setTransform2Body(lexicalGlobalObject, callFrame, castedThis))); } if (argsCount == 1) { RELEASE_AND_RETURN(throwScope, (jsOffscreenCanvasRenderingContext2DPrototypeFunction_setTransform2Body(lexicalGlobalObject, callFrame, castedThis))); } if (argsCount == 6) { RELEASE_AND_RETURN(throwScope, (jsOffscreenCanvasRenderingContext2DPrototypeFunction_setTransform1Body(lexicalGlobalObject, callFrame, castedThis))); } return throwVMTypeError(lexicalGlobalObject, throwScope); } JSC_DEFINE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_setTransform, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) { return IDLOperation::call(*lexicalGlobalObject, *callFrame, "setTransform"); } static inline JSC::EncodedJSValue jsOffscreenCanvasRenderingContext2DPrototypeFunction_resetTransformBody(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation::ClassParameter castedThis) { auto& vm = JSC::getVM(lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); UNUSED_PARAM(throwScope); UNUSED_PARAM(callFrame); auto& impl = castedThis->wrapped(); RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.resetTransform(); }))); } JSC_DEFINE_HOST_FUNCTION(jsOffscreenCanvasRenderingContext2DPrototypeFunction_resetTransform, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) { return IDLOperation::call(*lexicalGlobalObject, *callFrame, "resetTransform"); } JSC::GCClient::IsoSubspace* JSOffscreenCanvasRenderingContext2D::subspaceForImpl(JSC::VM& vm) { return WebCore::subspaceForImpl( vm, [](auto& spaces) { return spaces.m_clientSubspaceForOffscreenCanvasRenderingContext2D.get(); }, [](auto& spaces, auto&& space) { spaces.m_clientSubspaceForOffscreenCanvasRenderingContext2D = WTFMove(space); }, [](auto& spaces) { return spaces.m_subspaceForOffscreenCanvasRenderingContext2D.get(); }, [](auto& spaces, auto&& space) { spaces.m_subspaceForOffscreenCanvasRenderingContext2D = WTFMove(space); }); } template void JSOffscreenCanvasRenderingContext2D::visitChildrenImpl(JSCell* cell, Visitor& visitor) { auto* thisObject = jsCast(cell); ASSERT_GC_OBJECT_INHERITS(thisObject, info()); Base::visitChildren(thisObject, visitor); thisObject->visitAdditionalChildren(visitor); } DEFINE_VISIT_CHILDREN(JSOffscreenCanvasRenderingContext2D); template void JSOffscreenCanvasRenderingContext2D::visitOutputConstraints(JSCell* cell, Visitor& visitor) { auto* thisObject = jsCast(cell); ASSERT_GC_OBJECT_INHERITS(thisObject, info()); Base::visitOutputConstraints(thisObject, visitor); thisObject->visitAdditionalChildren(visitor); } template void JSOffscreenCanvasRenderingContext2D::visitOutputConstraints(JSCell*, AbstractSlotVisitor&); template void JSOffscreenCanvasRenderingContext2D::visitOutputConstraints(JSCell*, SlotVisitor&); void JSOffscreenCanvasRenderingContext2D::analyzeHeap(JSCell* cell, HeapAnalyzer& analyzer) { auto* thisObject = jsCast(cell); analyzer.setWrappedObjectForCell(cell, &thisObject->wrapped()); if (thisObject->scriptExecutionContext()) analyzer.setLabelForCell(cell, "url " + thisObject->scriptExecutionContext()->url().string()); Base::analyzeHeap(cell, analyzer); } void JSOffscreenCanvasRenderingContext2DOwner::finalize(JSC::Handle handle, void* context) { auto* jsOffscreenCanvasRenderingContext2D = static_cast(handle.slot()->asCell()); auto& world = *static_cast(context); uncacheWrapper(world, &jsOffscreenCanvasRenderingContext2D->wrapped(), jsOffscreenCanvasRenderingContext2D); } #if ENABLE(BINDING_INTEGRITY) #if PLATFORM(WIN) #pragma warning(disable : 4483) extern "C" { extern void (*const __identifier("??_7OffscreenCanvasRenderingContext2D@WebCore@@6B@")[])(); } #else extern "C" { extern void* _ZTVN7WebCore33OffscreenCanvasRenderingContext2DE[]; } #endif #endif JSC::JSValue toJSNewlyCreated(JSC::JSGlobalObject*, JSDOMGlobalObject* globalObject, Ref&& impl) { if constexpr (std::is_polymorphic_v) { #if ENABLE(BINDING_INTEGRITY) const void* actualVTablePointer = getVTablePointer(impl.ptr()); #if PLATFORM(WIN) void* expectedVTablePointer = __identifier("??_7OffscreenCanvasRenderingContext2D@WebCore@@6B@"); #else void* expectedVTablePointer = &_ZTVN7WebCore33OffscreenCanvasRenderingContext2DE[2]; #endif // If you hit this assertion you either have a use after free bug, or // OffscreenCanvasRenderingContext2D has subclasses. If OffscreenCanvasRenderingContext2D has subclasses that get passed // to toJS() we currently require OffscreenCanvasRenderingContext2D you to opt out of binding hardening // by adding the SkipVTableValidation attribute to the interface IDL definition RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer); #endif } return createWrapper(globalObject, WTFMove(impl)); } JSC::JSValue toJS(JSC::JSGlobalObject* lexicalGlobalObject, JSDOMGlobalObject* globalObject, OffscreenCanvasRenderingContext2D& impl) { return wrap(lexicalGlobalObject, globalObject, impl); } OffscreenCanvasRenderingContext2D* JSOffscreenCanvasRenderingContext2D::toWrapped(JSC::VM& vm, JSC::JSValue value) { if (auto* wrapper = jsDynamicCast(vm, value)) return &wrapper->wrapped(); return nullptr; } }