| 1 | /* |
| 2 | This file is part of the WebKit open source project. |
| 3 | This file has been generated by generate-bindings.pl. DO NOT MODIFY! |
| 4 | |
| 5 | This library is free software; you can redistribute it and/or |
| 6 | modify it under the terms of the GNU Library General Public |
| 7 | License as published by the Free Software Foundation; either |
| 8 | version 2 of the License, or (at your option) any later version. |
| 9 | |
| 10 | This library is distributed in the hope that it will be useful, |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 | Library General Public License for more details. |
| 14 | |
| 15 | You should have received a copy of the GNU Library General Public License |
| 16 | along with this library; see the file COPYING.LIB. If not, write to |
| 17 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 18 | Boston, MA 02110-1301, USA. |
| 19 | */ |
| 20 | |
| 21 | #include "config.h" |
| 22 | #include "JSDOMMatrix2DInit.h" |
| 23 | |
| 24 | #include "JSDOMConvertNumbers.h" |
| 25 | #include <JavaScriptCore/JSCInlines.h> |
| 26 | |
| 27 | |
| 28 | namespace WebCore { |
| 29 | using namespace JSC; |
| 30 | |
| 31 | template<> DOMMatrix2DInit convertDictionary<DOMMatrix2DInit>(ExecState& state, JSValue value) |
| 32 | { |
| 33 | VM& vm = state.vm(); |
| 34 | auto throwScope = DECLARE_THROW_SCOPE(vm); |
| 35 | bool isNullOrUndefined = value.isUndefinedOrNull(); |
| 36 | auto* object = isNullOrUndefined ? nullptr : value.getObject(); |
| 37 | if (UNLIKELY(!isNullOrUndefined && !object)) { |
| 38 | throwTypeError(&state, throwScope); |
| 39 | return { }; |
| 40 | } |
| 41 | DOMMatrix2DInit result; |
| 42 | JSValue aValue; |
| 43 | if (isNullOrUndefined) |
| 44 | aValue = jsUndefined(); |
| 45 | else { |
| 46 | aValue = object->get(&state, Identifier::fromString(&state, "a" )); |
| 47 | RETURN_IF_EXCEPTION(throwScope, { }); |
| 48 | } |
| 49 | if (!aValue.isUndefined()) { |
| 50 | result.a = convert<IDLUnrestrictedDouble>(state, aValue); |
| 51 | RETURN_IF_EXCEPTION(throwScope, { }); |
| 52 | } |
| 53 | JSValue bValue; |
| 54 | if (isNullOrUndefined) |
| 55 | bValue = jsUndefined(); |
| 56 | else { |
| 57 | bValue = object->get(&state, Identifier::fromString(&state, "b" )); |
| 58 | RETURN_IF_EXCEPTION(throwScope, { }); |
| 59 | } |
| 60 | if (!bValue.isUndefined()) { |
| 61 | result.b = convert<IDLUnrestrictedDouble>(state, bValue); |
| 62 | RETURN_IF_EXCEPTION(throwScope, { }); |
| 63 | } |
| 64 | JSValue cValue; |
| 65 | if (isNullOrUndefined) |
| 66 | cValue = jsUndefined(); |
| 67 | else { |
| 68 | cValue = object->get(&state, Identifier::fromString(&state, "c" )); |
| 69 | RETURN_IF_EXCEPTION(throwScope, { }); |
| 70 | } |
| 71 | if (!cValue.isUndefined()) { |
| 72 | result.c = convert<IDLUnrestrictedDouble>(state, cValue); |
| 73 | RETURN_IF_EXCEPTION(throwScope, { }); |
| 74 | } |
| 75 | JSValue dValue; |
| 76 | if (isNullOrUndefined) |
| 77 | dValue = jsUndefined(); |
| 78 | else { |
| 79 | dValue = object->get(&state, Identifier::fromString(&state, "d" )); |
| 80 | RETURN_IF_EXCEPTION(throwScope, { }); |
| 81 | } |
| 82 | if (!dValue.isUndefined()) { |
| 83 | result.d = convert<IDLUnrestrictedDouble>(state, dValue); |
| 84 | RETURN_IF_EXCEPTION(throwScope, { }); |
| 85 | } |
| 86 | JSValue eValue; |
| 87 | if (isNullOrUndefined) |
| 88 | eValue = jsUndefined(); |
| 89 | else { |
| 90 | eValue = object->get(&state, Identifier::fromString(&state, "e" )); |
| 91 | RETURN_IF_EXCEPTION(throwScope, { }); |
| 92 | } |
| 93 | if (!eValue.isUndefined()) { |
| 94 | result.e = convert<IDLUnrestrictedDouble>(state, eValue); |
| 95 | RETURN_IF_EXCEPTION(throwScope, { }); |
| 96 | } |
| 97 | JSValue fValue; |
| 98 | if (isNullOrUndefined) |
| 99 | fValue = jsUndefined(); |
| 100 | else { |
| 101 | fValue = object->get(&state, Identifier::fromString(&state, "f" )); |
| 102 | RETURN_IF_EXCEPTION(throwScope, { }); |
| 103 | } |
| 104 | if (!fValue.isUndefined()) { |
| 105 | result.f = convert<IDLUnrestrictedDouble>(state, fValue); |
| 106 | RETURN_IF_EXCEPTION(throwScope, { }); |
| 107 | } |
| 108 | JSValue m11Value; |
| 109 | if (isNullOrUndefined) |
| 110 | m11Value = jsUndefined(); |
| 111 | else { |
| 112 | m11Value = object->get(&state, Identifier::fromString(&state, "m11" )); |
| 113 | RETURN_IF_EXCEPTION(throwScope, { }); |
| 114 | } |
| 115 | if (!m11Value.isUndefined()) { |
| 116 | result.m11 = convert<IDLUnrestrictedDouble>(state, m11Value); |
| 117 | RETURN_IF_EXCEPTION(throwScope, { }); |
| 118 | } |
| 119 | JSValue m12Value; |
| 120 | if (isNullOrUndefined) |
| 121 | m12Value = jsUndefined(); |
| 122 | else { |
| 123 | m12Value = object->get(&state, Identifier::fromString(&state, "m12" )); |
| 124 | RETURN_IF_EXCEPTION(throwScope, { }); |
| 125 | } |
| 126 | if (!m12Value.isUndefined()) { |
| 127 | result.m12 = convert<IDLUnrestrictedDouble>(state, m12Value); |
| 128 | RETURN_IF_EXCEPTION(throwScope, { }); |
| 129 | } |
| 130 | JSValue m21Value; |
| 131 | if (isNullOrUndefined) |
| 132 | m21Value = jsUndefined(); |
| 133 | else { |
| 134 | m21Value = object->get(&state, Identifier::fromString(&state, "m21" )); |
| 135 | RETURN_IF_EXCEPTION(throwScope, { }); |
| 136 | } |
| 137 | if (!m21Value.isUndefined()) { |
| 138 | result.m21 = convert<IDLUnrestrictedDouble>(state, m21Value); |
| 139 | RETURN_IF_EXCEPTION(throwScope, { }); |
| 140 | } |
| 141 | JSValue m22Value; |
| 142 | if (isNullOrUndefined) |
| 143 | m22Value = jsUndefined(); |
| 144 | else { |
| 145 | m22Value = object->get(&state, Identifier::fromString(&state, "m22" )); |
| 146 | RETURN_IF_EXCEPTION(throwScope, { }); |
| 147 | } |
| 148 | if (!m22Value.isUndefined()) { |
| 149 | result.m22 = convert<IDLUnrestrictedDouble>(state, m22Value); |
| 150 | RETURN_IF_EXCEPTION(throwScope, { }); |
| 151 | } |
| 152 | JSValue m41Value; |
| 153 | if (isNullOrUndefined) |
| 154 | m41Value = jsUndefined(); |
| 155 | else { |
| 156 | m41Value = object->get(&state, Identifier::fromString(&state, "m41" )); |
| 157 | RETURN_IF_EXCEPTION(throwScope, { }); |
| 158 | } |
| 159 | if (!m41Value.isUndefined()) { |
| 160 | result.m41 = convert<IDLUnrestrictedDouble>(state, m41Value); |
| 161 | RETURN_IF_EXCEPTION(throwScope, { }); |
| 162 | } |
| 163 | JSValue m42Value; |
| 164 | if (isNullOrUndefined) |
| 165 | m42Value = jsUndefined(); |
| 166 | else { |
| 167 | m42Value = object->get(&state, Identifier::fromString(&state, "m42" )); |
| 168 | RETURN_IF_EXCEPTION(throwScope, { }); |
| 169 | } |
| 170 | if (!m42Value.isUndefined()) { |
| 171 | result.m42 = convert<IDLUnrestrictedDouble>(state, m42Value); |
| 172 | RETURN_IF_EXCEPTION(throwScope, { }); |
| 173 | } |
| 174 | return result; |
| 175 | } |
| 176 | |
| 177 | } // namespace WebCore |
| 178 | |