[Streams API] Separate compile flag for ReadableStream and WritableStream
[WebKit-https.git] / Source / JavaScriptCore / Scripts / tests / builtins / expected / WebCoreJSBuiltins.h-result
1 ### Begin File: WebCoreJSBuiltins.h
2 /*
3  * Copyright (c) 2015 Canon Inc. All rights reserved.
4  * Copyright (c) 2016 Apple Inc. All rights reserved.
5  * 
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions
8  * are met:
9  * 1. Redistributions of source code must retain the above copyright
10  *    notice, this list of conditions and the following disclaimer.
11  * 2. Redistributions in binary form must reproduce the above copyright
12  *    notice, this list of conditions and the following disclaimer in the
13  *    documentation and/or other materials provided with the distribution.
14  * 
15  * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
16  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
17  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
18  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
19  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
25  * THE POSSIBILITY OF SUCH DAMAGE.
26  * 
27  */
28
29 // DO NOT EDIT THIS FILE. It is automatically generated from JavaScript files for
30 // builtins by the script: Source/JavaScriptCore/Scripts/generate-js-builtins.py
31
32 #pragma once
33
34 #include "AnotherGuardedInternalBuiltinBuiltins.h"
35 #include "ArbitraryConditionalGuardBuiltins.h"
36 #include "GuardedBuiltinBuiltins.h"
37 #include "GuardedInternalBuiltinBuiltins.h"
38 #include "UnguardedBuiltinBuiltins.h"
39 #include "xmlCasingTestBuiltins.h"
40 #include <runtime/VM.h>
41
42 namespace WebCore {
43
44 class JSBuiltinFunctions {
45 public:
46     explicit JSBuiltinFunctions(JSC::VM& vm)
47         : m_vm(vm)
48 #if ENABLE(FETCH_API)
49         , m_anotherGuardedInternalBuiltinBuiltins(&m_vm)
50 #endif // ENABLE(FETCH_API)
51 #if ENABLE(STREAMS_API) || USE(CF)
52         , m_arbitraryConditionalGuardBuiltins(&m_vm)
53 #endif // ENABLE(STREAMS_API) || USE(CF)
54 #if ENABLE(STREAMS_API)
55         , m_guardedBuiltinBuiltins(&m_vm)
56 #endif // ENABLE(STREAMS_API)
57 #if ENABLE(READABLE_STREAM_API) || ENABLE(WRITABLE_STREAM_API)
58         , m_guardedInternalBuiltinBuiltins(&m_vm)
59 #endif // ENABLE(READABLE_STREAM_API) || ENABLE(WRITABLE_STREAM_API)
60         , m_unguardedBuiltinBuiltins(&m_vm)
61 #if ENABLE(STREAMS_API)
62         , m_xmlCasingTestBuiltins(&m_vm)
63 #endif // ENABLE(STREAMS_API)
64     {
65 #if ENABLE(FETCH_API)
66         m_anotherGuardedInternalBuiltinBuiltins.exportNames();
67 #endif // ENABLE(FETCH_API)
68 #if ENABLE(READABLE_STREAM_API) || ENABLE(WRITABLE_STREAM_API)
69         m_guardedInternalBuiltinBuiltins.exportNames();
70 #endif // ENABLE(READABLE_STREAM_API) || ENABLE(WRITABLE_STREAM_API)
71 #if ENABLE(STREAMS_API)
72         m_xmlCasingTestBuiltins.exportNames();
73 #endif // ENABLE(STREAMS_API)
74     }
75
76 #if ENABLE(FETCH_API)
77     AnotherGuardedInternalBuiltinBuiltinsWrapper& anotherGuardedInternalBuiltinBuiltins() { return m_anotherGuardedInternalBuiltinBuiltins; }
78 #endif // ENABLE(FETCH_API)
79 #if ENABLE(STREAMS_API) || USE(CF)
80     ArbitraryConditionalGuardBuiltinsWrapper& arbitraryConditionalGuardBuiltins() { return m_arbitraryConditionalGuardBuiltins; }
81 #endif // ENABLE(STREAMS_API) || USE(CF)
82 #if ENABLE(STREAMS_API)
83     GuardedBuiltinBuiltinsWrapper& guardedBuiltinBuiltins() { return m_guardedBuiltinBuiltins; }
84 #endif // ENABLE(STREAMS_API)
85 #if ENABLE(READABLE_STREAM_API) || ENABLE(WRITABLE_STREAM_API)
86     GuardedInternalBuiltinBuiltinsWrapper& guardedInternalBuiltinBuiltins() { return m_guardedInternalBuiltinBuiltins; }
87 #endif // ENABLE(READABLE_STREAM_API) || ENABLE(WRITABLE_STREAM_API)
88     UnguardedBuiltinBuiltinsWrapper& unguardedBuiltinBuiltins() { return m_unguardedBuiltinBuiltins; }
89 #if ENABLE(STREAMS_API)
90     XMLCasingTestBuiltinsWrapper& xmlCasingTestBuiltins() { return m_xmlCasingTestBuiltins; }
91 #endif // ENABLE(STREAMS_API)
92
93 private:
94     JSC::VM& m_vm;
95 #if ENABLE(FETCH_API)
96     AnotherGuardedInternalBuiltinBuiltinsWrapper m_anotherGuardedInternalBuiltinBuiltins;
97 #endif // ENABLE(FETCH_API)
98 #if ENABLE(STREAMS_API) || USE(CF)
99     ArbitraryConditionalGuardBuiltinsWrapper m_arbitraryConditionalGuardBuiltins;
100 #endif // ENABLE(STREAMS_API) || USE(CF)
101 #if ENABLE(STREAMS_API)
102     GuardedBuiltinBuiltinsWrapper m_guardedBuiltinBuiltins;
103 #endif // ENABLE(STREAMS_API)
104 #if ENABLE(READABLE_STREAM_API) || ENABLE(WRITABLE_STREAM_API)
105     GuardedInternalBuiltinBuiltinsWrapper m_guardedInternalBuiltinBuiltins;
106 #endif // ENABLE(READABLE_STREAM_API) || ENABLE(WRITABLE_STREAM_API)
107     UnguardedBuiltinBuiltinsWrapper m_unguardedBuiltinBuiltins;
108 #if ENABLE(STREAMS_API)
109     XMLCasingTestBuiltinsWrapper m_xmlCasingTestBuiltins;
110 #endif // ENABLE(STREAMS_API)
111 };
112
113 } // namespace WebCore
114 ### End File: WebCoreJSBuiltins.h
115
116 ### Begin File: WebCoreJSBuiltins.cpp
117 /*
118  * Copyright (c) 2015 Canon Inc. All rights reserved.
119  * Copyright (c) 2016 Apple Inc. All rights reserved.
120  * 
121  * Redistribution and use in source and binary forms, with or without
122  * modification, are permitted provided that the following conditions
123  * are met:
124  * 1. Redistributions of source code must retain the above copyright
125  *    notice, this list of conditions and the following disclaimer.
126  * 2. Redistributions in binary form must reproduce the above copyright
127  *    notice, this list of conditions and the following disclaimer in the
128  *    documentation and/or other materials provided with the distribution.
129  * 
130  * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
131  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
132  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
133  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
134  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
135  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
136  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
137  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
138  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
139  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
140  * THE POSSIBILITY OF SUCH DAMAGE.
141  * 
142  */
143
144 // DO NOT EDIT THIS FILE. It is automatically generated from JavaScript files for
145 // builtins by the script: Source/JavaScriptCore/Scripts/generate-js-builtins.py
146
147 #include "AnotherGuardedInternalBuiltinBuiltins.cpp"
148 #include "ArbitraryConditionalGuardBuiltins.cpp"
149 #include "GuardedBuiltinBuiltins.cpp"
150 #include "GuardedInternalBuiltinBuiltins.cpp"
151 #include "UnguardedBuiltinBuiltins.cpp"
152 #include "xmlCasingTestBuiltins.cpp"
153 ### End File: WebCoreJSBuiltins.cpp
154
155 ### Begin File: WebCoreJSBuiltinInternals.h
156 /*
157  * Copyright (c) 2015 Canon Inc. All rights reserved.
158  * Copyright (c) 2016 Apple Inc. All rights reserved.
159  * 
160  * Redistribution and use in source and binary forms, with or without
161  * modification, are permitted provided that the following conditions
162  * are met:
163  * 1. Redistributions of source code must retain the above copyright
164  *    notice, this list of conditions and the following disclaimer.
165  * 2. Redistributions in binary form must reproduce the above copyright
166  *    notice, this list of conditions and the following disclaimer in the
167  *    documentation and/or other materials provided with the distribution.
168  * 
169  * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
170  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
171  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
172  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
173  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
174  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
175  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
176  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
177  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
178  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
179  * THE POSSIBILITY OF SUCH DAMAGE.
180  * 
181  */
182
183 // DO NOT EDIT THIS FILE. It is automatically generated from JavaScript files for
184 // builtins by the script: Source/JavaScriptCore/Scripts/generate-js-builtins.py
185
186 #pragma once
187
188 #include "AnotherGuardedInternalBuiltinBuiltins.h"
189 #include "GuardedInternalBuiltinBuiltins.h"
190 #include "xmlCasingTestBuiltins.h"
191 #include <runtime/VM.h>
192
193 namespace WebCore {
194
195 class JSDOMGlobalObject;
196
197 class JSBuiltinInternalFunctions {
198 public:
199     explicit JSBuiltinInternalFunctions(JSC::VM&);
200
201     void visit(JSC::SlotVisitor&);
202     void initialize(JSDOMGlobalObject&);
203
204 #if ENABLE(FETCH_API)
205     AnotherGuardedInternalBuiltinBuiltinFunctions& anotherGuardedInternalBuiltin() { return m_anotherGuardedInternalBuiltin; }
206 #endif // ENABLE(FETCH_API)
207 #if ENABLE(READABLE_STREAM_API) || ENABLE(WRITABLE_STREAM_API)
208     GuardedInternalBuiltinBuiltinFunctions& guardedInternalBuiltin() { return m_guardedInternalBuiltin; }
209 #endif // ENABLE(READABLE_STREAM_API) || ENABLE(WRITABLE_STREAM_API)
210 #if ENABLE(STREAMS_API)
211     XMLCasingTestBuiltinFunctions& xmlCasingTest() { return m_xmlCasingTest; }
212 #endif // ENABLE(STREAMS_API)
213
214 private:
215 #if ENABLE(FETCH_API) || ENABLE(READABLE_STREAM_API) || ENABLE(WRITABLE_STREAM_API) || ENABLE(STREAMS_API)
216     JSC::VM& m_vm;
217 #endif // ENABLE(FETCH_API) || ENABLE(READABLE_STREAM_API) || ENABLE(WRITABLE_STREAM_API) || ENABLE(STREAMS_API)
218 #if ENABLE(FETCH_API)
219     AnotherGuardedInternalBuiltinBuiltinFunctions m_anotherGuardedInternalBuiltin;
220 #endif // ENABLE(FETCH_API)
221 #if ENABLE(READABLE_STREAM_API) || ENABLE(WRITABLE_STREAM_API)
222     GuardedInternalBuiltinBuiltinFunctions m_guardedInternalBuiltin;
223 #endif // ENABLE(READABLE_STREAM_API) || ENABLE(WRITABLE_STREAM_API)
224 #if ENABLE(STREAMS_API)
225     XMLCasingTestBuiltinFunctions m_xmlCasingTest;
226 #endif // ENABLE(STREAMS_API)
227 };
228
229 } // namespace WebCore
230 ### End File: WebCoreJSBuiltinInternals.h
231
232 ### Begin File: WebCoreJSBuiltinInternals.cpp
233 /*
234  * Copyright (c) 2015 Canon Inc. All rights reserved.
235  * Copyright (c) 2016 Apple Inc. All rights reserved.
236  * 
237  * Redistribution and use in source and binary forms, with or without
238  * modification, are permitted provided that the following conditions
239  * are met:
240  * 1. Redistributions of source code must retain the above copyright
241  *    notice, this list of conditions and the following disclaimer.
242  * 2. Redistributions in binary form must reproduce the above copyright
243  *    notice, this list of conditions and the following disclaimer in the
244  *    documentation and/or other materials provided with the distribution.
245  * 
246  * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
247  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
248  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
249  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
250  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
251  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
252  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
253  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
254  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
255  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
256  * THE POSSIBILITY OF SUCH DAMAGE.
257  * 
258  */
259
260 // DO NOT EDIT THIS FILE. It is automatically generated from JavaScript files for
261 // builtins by the script: Source/JavaScriptCore/Scripts/generate-js-builtins.py
262
263 #include "config.h"
264 #include "WebCoreJSBuiltinInternals.h"
265
266 #include "JSDOMGlobalObject.h"
267 #include "WebCoreJSClientData.h"
268 #include <heap/HeapInlines.h>
269 #include <heap/SlotVisitorInlines.h>
270 #include <runtime/JSCJSValueInlines.h>
271 #include <runtime/StructureInlines.h>
272
273 namespace WebCore {
274
275 JSBuiltinInternalFunctions::JSBuiltinInternalFunctions(JSC::VM& vm)
276 #if ENABLE(FETCH_API) || ENABLE(READABLE_STREAM_API) || ENABLE(WRITABLE_STREAM_API) || ENABLE(STREAMS_API)
277     : m_vm(vm)
278 #endif // ENABLE(FETCH_API) || ENABLE(READABLE_STREAM_API) || ENABLE(WRITABLE_STREAM_API) || ENABLE(STREAMS_API)
279 #if ENABLE(FETCH_API)
280     , m_anotherGuardedInternalBuiltin(m_vm)
281 #endif // ENABLE(FETCH_API)
282 #if ENABLE(READABLE_STREAM_API) || ENABLE(WRITABLE_STREAM_API)
283     , m_guardedInternalBuiltin(m_vm)
284 #endif // ENABLE(READABLE_STREAM_API) || ENABLE(WRITABLE_STREAM_API)
285 #if ENABLE(STREAMS_API)
286     , m_xmlCasingTest(m_vm)
287 #endif // ENABLE(STREAMS_API)
288 {
289     UNUSED_PARAM(vm);
290 }
291
292 void JSBuiltinInternalFunctions::visit(JSC::SlotVisitor& visitor)
293 {
294 #if ENABLE(FETCH_API)
295     m_anotherGuardedInternalBuiltin.visit(visitor);
296 #endif // ENABLE(FETCH_API)
297 #if ENABLE(READABLE_STREAM_API) || ENABLE(WRITABLE_STREAM_API)
298     m_guardedInternalBuiltin.visit(visitor);
299 #endif // ENABLE(READABLE_STREAM_API) || ENABLE(WRITABLE_STREAM_API)
300 #if ENABLE(STREAMS_API)
301     m_xmlCasingTest.visit(visitor);
302 #endif // ENABLE(STREAMS_API)
303     UNUSED_PARAM(visitor);
304 }
305
306 void JSBuiltinInternalFunctions::initialize(JSDOMGlobalObject& globalObject)
307 {
308     UNUSED_PARAM(globalObject);
309 #if ENABLE(FETCH_API)
310     m_anotherGuardedInternalBuiltin.init(globalObject);
311 #endif // ENABLE(FETCH_API)
312 #if ENABLE(READABLE_STREAM_API) || ENABLE(WRITABLE_STREAM_API)
313     m_guardedInternalBuiltin.init(globalObject);
314 #endif // ENABLE(READABLE_STREAM_API) || ENABLE(WRITABLE_STREAM_API)
315 #if ENABLE(STREAMS_API)
316     m_xmlCasingTest.init(globalObject);
317 #endif // ENABLE(STREAMS_API)
318
319 #if ENABLE(FETCH_API) || ENABLE(READABLE_STREAM_API) || ENABLE(WRITABLE_STREAM_API) || ENABLE(STREAMS_API)
320     JSVMClientData& clientData = *static_cast<JSVMClientData*>(m_vm.clientData);
321     JSDOMGlobalObject::GlobalPropertyInfo staticGlobals[] = {
322 #if ENABLE(FETCH_API)
323 #define DECLARE_GLOBAL_STATIC(name) \
324     JSDOMGlobalObject::GlobalPropertyInfo( \
325         clientData.builtinFunctions().anotherGuardedInternalBuiltinBuiltins().name##PrivateName(), anotherGuardedInternalBuiltin().m_##name##Function.get() , JSC::DontDelete | JSC::ReadOnly),
326     WEBCORE_FOREACH_ANOTHERGUARDEDINTERNALBUILTIN_BUILTIN_FUNCTION_NAME(DECLARE_GLOBAL_STATIC)
327 #undef DECLARE_GLOBAL_STATIC
328 #endif // ENABLE(FETCH_API)
329 #if ENABLE(READABLE_STREAM_API) || ENABLE(WRITABLE_STREAM_API)
330 #define DECLARE_GLOBAL_STATIC(name) \
331     JSDOMGlobalObject::GlobalPropertyInfo( \
332         clientData.builtinFunctions().guardedInternalBuiltinBuiltins().name##PrivateName(), guardedInternalBuiltin().m_##name##Function.get() , JSC::DontDelete | JSC::ReadOnly),
333     WEBCORE_FOREACH_GUARDEDINTERNALBUILTIN_BUILTIN_FUNCTION_NAME(DECLARE_GLOBAL_STATIC)
334 #undef DECLARE_GLOBAL_STATIC
335 #endif // ENABLE(READABLE_STREAM_API) || ENABLE(WRITABLE_STREAM_API)
336 #if ENABLE(STREAMS_API)
337 #define DECLARE_GLOBAL_STATIC(name) \
338     JSDOMGlobalObject::GlobalPropertyInfo( \
339         clientData.builtinFunctions().xmlCasingTestBuiltins().name##PrivateName(), xmlCasingTest().m_##name##Function.get() , JSC::DontDelete | JSC::ReadOnly),
340     WEBCORE_FOREACH_XMLCASINGTEST_BUILTIN_FUNCTION_NAME(DECLARE_GLOBAL_STATIC)
341 #undef DECLARE_GLOBAL_STATIC
342 #endif // ENABLE(STREAMS_API)
343     };
344     globalObject.addStaticGlobals(staticGlobals, WTF_ARRAY_LENGTH(staticGlobals));
345     UNUSED_PARAM(clientData);
346 #endif // ENABLE(FETCH_API) || ENABLE(READABLE_STREAM_API) || ENABLE(WRITABLE_STREAM_API) || ENABLE(STREAMS_API)
347 }
348
349 } // namespace WebCore
350 ### End File: WebCoreJSBuiltinInternals.cpp