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 "JSDOMQuadInit.h"
23
24#include "JSDOMPointInit.h"
25#include <JavaScriptCore/JSCInlines.h>
26
27
28namespace WebCore {
29using namespace JSC;
30
31template<> DOMQuadInit convertDictionary<DOMQuadInit>(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 DOMQuadInit result;
42 JSValue p1Value;
43 if (isNullOrUndefined)
44 p1Value = jsUndefined();
45 else {
46 p1Value = object->get(&state, Identifier::fromString(&state, "p1"));
47 RETURN_IF_EXCEPTION(throwScope, { });
48 }
49 if (!p1Value.isUndefined()) {
50 result.p1 = convert<IDLDictionary<DOMPointInit>>(state, p1Value);
51 RETURN_IF_EXCEPTION(throwScope, { });
52 }
53 JSValue p2Value;
54 if (isNullOrUndefined)
55 p2Value = jsUndefined();
56 else {
57 p2Value = object->get(&state, Identifier::fromString(&state, "p2"));
58 RETURN_IF_EXCEPTION(throwScope, { });
59 }
60 if (!p2Value.isUndefined()) {
61 result.p2 = convert<IDLDictionary<DOMPointInit>>(state, p2Value);
62 RETURN_IF_EXCEPTION(throwScope, { });
63 }
64 JSValue p3Value;
65 if (isNullOrUndefined)
66 p3Value = jsUndefined();
67 else {
68 p3Value = object->get(&state, Identifier::fromString(&state, "p3"));
69 RETURN_IF_EXCEPTION(throwScope, { });
70 }
71 if (!p3Value.isUndefined()) {
72 result.p3 = convert<IDLDictionary<DOMPointInit>>(state, p3Value);
73 RETURN_IF_EXCEPTION(throwScope, { });
74 }
75 JSValue p4Value;
76 if (isNullOrUndefined)
77 p4Value = jsUndefined();
78 else {
79 p4Value = object->get(&state, Identifier::fromString(&state, "p4"));
80 RETURN_IF_EXCEPTION(throwScope, { });
81 }
82 if (!p4Value.isUndefined()) {
83 result.p4 = convert<IDLDictionary<DOMPointInit>>(state, p4Value);
84 RETURN_IF_EXCEPTION(throwScope, { });
85 }
86 return result;
87}
88
89} // namespace WebCore
90