diff options
author | 2022-06-22 23:21:48 -0700 | |
---|---|---|
committer | 2022-06-22 23:21:48 -0700 | |
commit | 729d445b6885f69dd2c6355f38707bd42851c791 (patch) | |
tree | f87a7c408929ea3f57bbb7ace380cf869da83c0e /src/bun.js/bindings/webcore/JSEventModifierInit.cpp | |
parent | 25f820c6bf1d8ec6d444ef579cc036b8c0607b75 (diff) | |
download | bun-jarred/rename.tar.gz bun-jarred/rename.tar.zst bun-jarred/rename.zip |
change the directory structurejarred/rename
Diffstat (limited to 'src/bun.js/bindings/webcore/JSEventModifierInit.cpp')
-rw-r--r-- | src/bun.js/bindings/webcore/JSEventModifierInit.cpp | 180 |
1 files changed, 180 insertions, 0 deletions
diff --git a/src/bun.js/bindings/webcore/JSEventModifierInit.cpp b/src/bun.js/bindings/webcore/JSEventModifierInit.cpp new file mode 100644 index 000000000..0e9d2c804 --- /dev/null +++ b/src/bun.js/bindings/webcore/JSEventModifierInit.cpp @@ -0,0 +1,180 @@ +/* + 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 "JSEventModifierInit.h" + +#include "JSDOMConvertBoolean.h" +#include "JSDOMConvertInterface.h" +#include "JSDOMConvertNullable.h" +#include "JSDOMConvertNumbers.h" +// #include "JSWindowProxy.h" +#include <JavaScriptCore/JSCInlines.h> + +namespace WebCore { +using namespace JSC; + +template<> EventModifierInit convertDictionary<EventModifierInit>(JSGlobalObject& lexicalGlobalObject, JSValue value) +{ + VM& vm = JSC::getVM(&lexicalGlobalObject); + auto throwScope = DECLARE_THROW_SCOPE(vm); + bool isNullOrUndefined = value.isUndefinedOrNull(); + auto* object = isNullOrUndefined ? nullptr : value.getObject(); + if (UNLIKELY(!isNullOrUndefined && !object)) { + throwTypeError(&lexicalGlobalObject, throwScope); + return {}; + } + EventModifierInit result; + JSValue bubblesValue; + if (isNullOrUndefined) + bubblesValue = jsUndefined(); + else { + bubblesValue = object->get(&lexicalGlobalObject, Identifier::fromString(vm, "bubbles"_s)); + RETURN_IF_EXCEPTION(throwScope, {}); + } + if (!bubblesValue.isUndefined()) { + result.bubbles = convert<IDLBoolean>(lexicalGlobalObject, bubblesValue); + RETURN_IF_EXCEPTION(throwScope, {}); + } else + result.bubbles = false; + JSValue cancelableValue; + if (isNullOrUndefined) + cancelableValue = jsUndefined(); + else { + cancelableValue = object->get(&lexicalGlobalObject, Identifier::fromString(vm, "cancelable"_s)); + RETURN_IF_EXCEPTION(throwScope, {}); + } + if (!cancelableValue.isUndefined()) { + result.cancelable = convert<IDLBoolean>(lexicalGlobalObject, cancelableValue); + RETURN_IF_EXCEPTION(throwScope, {}); + } else + result.cancelable = false; + JSValue composedValue; + if (isNullOrUndefined) + composedValue = jsUndefined(); + else { + composedValue = object->get(&lexicalGlobalObject, Identifier::fromString(vm, "composed"_s)); + RETURN_IF_EXCEPTION(throwScope, {}); + } + if (!composedValue.isUndefined()) { + result.composed = convert<IDLBoolean>(lexicalGlobalObject, composedValue); + RETURN_IF_EXCEPTION(throwScope, {}); + } else + result.composed = false; + JSValue detailValue; + if (isNullOrUndefined) + detailValue = jsUndefined(); + else { + detailValue = object->get(&lexicalGlobalObject, Identifier::fromString(vm, "detail"_s)); + RETURN_IF_EXCEPTION(throwScope, {}); + } + if (!detailValue.isUndefined()) { + result.detail = convert<IDLLong>(lexicalGlobalObject, detailValue); + RETURN_IF_EXCEPTION(throwScope, {}); + } else + result.detail = 0; + JSValue viewValue; + if (isNullOrUndefined) + viewValue = jsUndefined(); + else { + viewValue = object->get(&lexicalGlobalObject, Identifier::fromString(vm, "view"_s)); + RETURN_IF_EXCEPTION(throwScope, {}); + } + // if (!viewValue.isUndefined()) { + // result.view = convert<IDLNullable<IDLInterface<WindowProxy>>>(lexicalGlobalObject, viewValue); + // RETURN_IF_EXCEPTION(throwScope, { }); + // } else + result.view = nullptr; + JSValue altKeyValue; + if (isNullOrUndefined) + altKeyValue = jsUndefined(); + else { + altKeyValue = object->get(&lexicalGlobalObject, Identifier::fromString(vm, "altKey"_s)); + RETURN_IF_EXCEPTION(throwScope, {}); + } + if (!altKeyValue.isUndefined()) { + result.altKey = convert<IDLBoolean>(lexicalGlobalObject, altKeyValue); + RETURN_IF_EXCEPTION(throwScope, {}); + } else + result.altKey = false; + JSValue ctrlKeyValue; + if (isNullOrUndefined) + ctrlKeyValue = jsUndefined(); + else { + ctrlKeyValue = object->get(&lexicalGlobalObject, Identifier::fromString(vm, "ctrlKey"_s)); + RETURN_IF_EXCEPTION(throwScope, {}); + } + if (!ctrlKeyValue.isUndefined()) { + result.ctrlKey = convert<IDLBoolean>(lexicalGlobalObject, ctrlKeyValue); + RETURN_IF_EXCEPTION(throwScope, {}); + } else + result.ctrlKey = false; + JSValue metaKeyValue; + if (isNullOrUndefined) + metaKeyValue = jsUndefined(); + else { + metaKeyValue = object->get(&lexicalGlobalObject, Identifier::fromString(vm, "metaKey"_s)); + RETURN_IF_EXCEPTION(throwScope, {}); + } + if (!metaKeyValue.isUndefined()) { + result.metaKey = convert<IDLBoolean>(lexicalGlobalObject, metaKeyValue); + RETURN_IF_EXCEPTION(throwScope, {}); + } else + result.metaKey = false; + JSValue modifierAltGraphValue; + if (isNullOrUndefined) + modifierAltGraphValue = jsUndefined(); + else { + modifierAltGraphValue = object->get(&lexicalGlobalObject, Identifier::fromString(vm, "modifierAltGraph"_s)); + RETURN_IF_EXCEPTION(throwScope, {}); + } + if (!modifierAltGraphValue.isUndefined()) { + result.modifierAltGraph = convert<IDLBoolean>(lexicalGlobalObject, modifierAltGraphValue); + RETURN_IF_EXCEPTION(throwScope, {}); + } else + result.modifierAltGraph = false; + JSValue modifierCapsLockValue; + if (isNullOrUndefined) + modifierCapsLockValue = jsUndefined(); + else { + modifierCapsLockValue = object->get(&lexicalGlobalObject, Identifier::fromString(vm, "modifierCapsLock"_s)); + RETURN_IF_EXCEPTION(throwScope, {}); + } + if (!modifierCapsLockValue.isUndefined()) { + result.modifierCapsLock = convert<IDLBoolean>(lexicalGlobalObject, modifierCapsLockValue); + RETURN_IF_EXCEPTION(throwScope, {}); + } else + result.modifierCapsLock = false; + JSValue shiftKeyValue; + if (isNullOrUndefined) + shiftKeyValue = jsUndefined(); + else { + shiftKeyValue = object->get(&lexicalGlobalObject, Identifier::fromString(vm, "shiftKey"_s)); + RETURN_IF_EXCEPTION(throwScope, {}); + } + if (!shiftKeyValue.isUndefined()) { + result.shiftKey = convert<IDLBoolean>(lexicalGlobalObject, shiftKeyValue); + RETURN_IF_EXCEPTION(throwScope, {}); + } else + result.shiftKey = false; + return result; +} + +} // namespace WebCore |