4c2e2cf8ff033587061f18295e001ef98fc39acf
[WebKit-https.git] / Source / WebCore / bindings / scripts / test / V8 / V8TestObj.cpp
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., 59 Temple Place - Suite 330,
18     Boston, MA 02111-1307, USA.
19 */
20
21 #include "config.h"
22 #include "V8TestObj.h"
23
24 #include "Dictionary.h"
25 #include "ExceptionCode.h"
26 #include "HTMLNames.h"
27 #include "IDBBindingUtilities.h"
28 #include "IDBKey.h"
29 #include "RuntimeEnabledFeatures.h"
30 #include "SVGPropertyTearOff.h"
31 #include "SVGStaticPropertyTearOff.h"
32 #include "ScriptArguments.h"
33 #include "ScriptCallStack.h"
34 #include "ScriptCallStackFactory.h"
35 #include "ScriptProfile.h"
36 #include "SerializedScriptValue.h"
37 #include "V8Binding.h"
38 #include "V8BindingMacros.h"
39 #include "V8BindingState.h"
40 #include "V8DOMWrapper.h"
41 #include "V8Document.h"
42 #include "V8IsolatedContext.h"
43 #include "V8Proxy.h"
44 #include "V8SVGDocument.h"
45 #include "V8SVGPoint.h"
46 #include "V8ScriptProfile.h"
47 #include "V8TestCallback.h"
48 #include "V8a.h"
49 #include "V8any.h"
50 #include "V8b.h"
51 #include "V8bool.h"
52 #include "V8c.h"
53 #include "V8d.h"
54 #include "V8e.h"
55 #include "V8int.h"
56 #include "V8sequence.h"
57 #include <wtf/GetPtr.h>
58 #include <wtf/RefCounted.h>
59 #include <wtf/RefPtr.h>
60 #include <wtf/UnusedParam.h>
61 #include <wtf/Vector.h>
62
63 #if ENABLE(Condition1)
64 #include "V8TestObjectA.h"
65 #endif
66
67 #if ENABLE(Condition1) && ENABLE(Condition2)
68 #include "V8TestObjectB.h"
69 #endif
70
71 #if ENABLE(Condition1) || ENABLE(Condition2)
72 #include "V8TestObjectC.h"
73 #endif
74
75 namespace WebCore {
76
77 WrapperTypeInfo V8TestObj::info = { V8TestObj::GetTemplate, V8TestObj::derefObject, 0, 0 };
78
79 namespace TestObjInternal {
80
81 template <typename T> void V8_USE(T) { }
82
83 static v8::Handle<v8::Value> readOnlyIntAttrAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
84 {
85     INC_STATS("DOM.TestObj.readOnlyIntAttr._get");
86     TestObj* imp = V8TestObj::toNative(info.Holder());
87     return v8::Integer::New(imp->readOnlyIntAttr());
88 }
89
90 static v8::Handle<v8::Value> readOnlyStringAttrAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
91 {
92     INC_STATS("DOM.TestObj.readOnlyStringAttr._get");
93     TestObj* imp = V8TestObj::toNative(info.Holder());
94     return v8String(imp->readOnlyStringAttr());
95 }
96
97 static v8::Handle<v8::Value> readOnlyTestObjAttrAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
98 {
99     INC_STATS("DOM.TestObj.readOnlyTestObjAttr._get");
100     TestObj* imp = V8TestObj::toNative(info.Holder());
101     RefPtr<TestObj> result = imp->readOnlyTestObjAttr();
102     v8::Handle<v8::Value> wrapper = result.get() ? getDOMObjectMap().get(result.get()) : v8::Handle<v8::Object>();
103     if (wrapper.IsEmpty()) {
104         wrapper = toV8(result.get());
105         if (!wrapper.IsEmpty())
106             V8DOMWrapper::setNamedHiddenReference(info.Holder(), "readOnlyTestObjAttr", wrapper);
107     }
108     return wrapper;
109 }
110
111 static v8::Handle<v8::Value> shortAttrAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
112 {
113     INC_STATS("DOM.TestObj.shortAttr._get");
114     TestObj* imp = V8TestObj::toNative(info.Holder());
115     return v8::Integer::New(imp->shortAttr());
116 }
117
118 static void shortAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
119 {
120     INC_STATS("DOM.TestObj.shortAttr._set");
121     TestObj* imp = V8TestObj::toNative(info.Holder());
122     int v = toInt32(value);
123     imp->setShortAttr(v);
124     return;
125 }
126
127 static v8::Handle<v8::Value> unsignedShortAttrAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
128 {
129     INC_STATS("DOM.TestObj.unsignedShortAttr._get");
130     TestObj* imp = V8TestObj::toNative(info.Holder());
131     return v8::Integer::New(imp->unsignedShortAttr());
132 }
133
134 static void unsignedShortAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
135 {
136     INC_STATS("DOM.TestObj.unsignedShortAttr._set");
137     TestObj* imp = V8TestObj::toNative(info.Holder());
138     int v = toUInt32(value);
139     imp->setUnsignedShortAttr(v);
140     return;
141 }
142
143 static v8::Handle<v8::Value> intAttrAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
144 {
145     INC_STATS("DOM.TestObj.intAttr._get");
146     TestObj* imp = V8TestObj::toNative(info.Holder());
147     return v8::Integer::New(imp->intAttr());
148 }
149
150 static void intAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
151 {
152     INC_STATS("DOM.TestObj.intAttr._set");
153     TestObj* imp = V8TestObj::toNative(info.Holder());
154     int v = toInt32(value);
155     imp->setIntAttr(v);
156     return;
157 }
158
159 static v8::Handle<v8::Value> longLongAttrAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
160 {
161     INC_STATS("DOM.TestObj.longLongAttr._get");
162     TestObj* imp = V8TestObj::toNative(info.Holder());
163     return v8::Number::New(static_cast<double>(imp->longLongAttr()));
164 }
165
166 static void longLongAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
167 {
168     INC_STATS("DOM.TestObj.longLongAttr._set");
169     TestObj* imp = V8TestObj::toNative(info.Holder());
170     long long v = toInt64(value);
171     imp->setLongLongAttr(WTF::getPtr(v));
172     return;
173 }
174
175 static v8::Handle<v8::Value> unsignedLongLongAttrAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
176 {
177     INC_STATS("DOM.TestObj.unsignedLongLongAttr._get");
178     TestObj* imp = V8TestObj::toNative(info.Holder());
179     return v8::Number::New(static_cast<double>(imp->unsignedLongLongAttr()));
180 }
181
182 static void unsignedLongLongAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
183 {
184     INC_STATS("DOM.TestObj.unsignedLongLongAttr._set");
185     TestObj* imp = V8TestObj::toNative(info.Holder());
186     unsigned long long v = toInt64(value);
187     imp->setUnsignedLongLongAttr(WTF::getPtr(v));
188     return;
189 }
190
191 static v8::Handle<v8::Value> stringAttrAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
192 {
193     INC_STATS("DOM.TestObj.stringAttr._get");
194     TestObj* imp = V8TestObj::toNative(info.Holder());
195     return v8String(imp->stringAttr());
196 }
197
198 static void stringAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
199 {
200     INC_STATS("DOM.TestObj.stringAttr._set");
201     TestObj* imp = V8TestObj::toNative(info.Holder());
202     STRING_TO_V8PARAMETER_EXCEPTION_BLOCK_VOID(V8Parameter<>, v, value);
203     imp->setStringAttr(v);
204     return;
205 }
206
207 static v8::Handle<v8::Value> testObjAttrAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
208 {
209     INC_STATS("DOM.TestObj.testObjAttr._get");
210     TestObj* imp = V8TestObj::toNative(info.Holder());
211     return toV8(imp->testObjAttr());
212 }
213
214 static void testObjAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
215 {
216     INC_STATS("DOM.TestObj.testObjAttr._set");
217     TestObj* imp = V8TestObj::toNative(info.Holder());
218     TestObj* v = V8TestObj::HasInstance(value) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(value)) : 0;
219     imp->setTestObjAttr(WTF::getPtr(v));
220     return;
221 }
222
223 static v8::Handle<v8::Value> sequenceAttrAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
224 {
225     INC_STATS("DOM.TestObj.sequenceAttr._get");
226     TestObj* imp = V8TestObj::toNative(info.Holder());
227     return v8Array(imp->sequenceAttr());
228 }
229
230 static void sequenceAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
231 {
232     INC_STATS("DOM.TestObj.sequenceAttr._set");
233     TestObj* imp = V8TestObj::toNative(info.Holder());
234     Vector<ScriptProfile> v = toNativeArray(value);
235     imp->setSequenceAttr(v);
236     return;
237 }
238
239 static v8::Handle<v8::Value> XMLObjAttrAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
240 {
241     INC_STATS("DOM.TestObj.XMLObjAttr._get");
242     TestObj* imp = V8TestObj::toNative(info.Holder());
243     return toV8(imp->xmlObjAttr());
244 }
245
246 static void XMLObjAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
247 {
248     INC_STATS("DOM.TestObj.XMLObjAttr._set");
249     TestObj* imp = V8TestObj::toNative(info.Holder());
250     TestObj* v = V8TestObj::HasInstance(value) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(value)) : 0;
251     imp->setXMLObjAttr(WTF::getPtr(v));
252     return;
253 }
254
255 static v8::Handle<v8::Value> createAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
256 {
257     INC_STATS("DOM.TestObj.create._get");
258     TestObj* imp = V8TestObj::toNative(info.Holder());
259     return v8Boolean(imp->isCreate());
260 }
261
262 static void createAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
263 {
264     INC_STATS("DOM.TestObj.create._set");
265     TestObj* imp = V8TestObj::toNative(info.Holder());
266     bool v = value->BooleanValue();
267     imp->setCreate(v);
268     return;
269 }
270
271 static v8::Handle<v8::Value> reflectedStringAttrAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
272 {
273     INC_STATS("DOM.TestObj.reflectedStringAttr._get");
274     TestObj* imp = V8TestObj::toNative(info.Holder());
275     return v8String(imp->getAttribute(WebCore::HTMLNames::reflectedstringattrAttr));
276 }
277
278 static void reflectedStringAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
279 {
280     INC_STATS("DOM.TestObj.reflectedStringAttr._set");
281     TestObj* imp = V8TestObj::toNative(info.Holder());
282     STRING_TO_V8PARAMETER_EXCEPTION_BLOCK_VOID(V8Parameter<WithNullCheck>, v, value);
283     imp->setAttribute(WebCore::HTMLNames::reflectedstringattrAttr, v);
284     return;
285 }
286
287 static v8::Handle<v8::Value> reflectedIntegralAttrAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
288 {
289     INC_STATS("DOM.TestObj.reflectedIntegralAttr._get");
290     TestObj* imp = V8TestObj::toNative(info.Holder());
291     return v8::Integer::New(imp->getIntegralAttribute(WebCore::HTMLNames::reflectedintegralattrAttr));
292 }
293
294 static void reflectedIntegralAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
295 {
296     INC_STATS("DOM.TestObj.reflectedIntegralAttr._set");
297     TestObj* imp = V8TestObj::toNative(info.Holder());
298     int v = toInt32(value);
299     imp->setIntegralAttribute(WebCore::HTMLNames::reflectedintegralattrAttr, v);
300     return;
301 }
302
303 static v8::Handle<v8::Value> reflectedUnsignedIntegralAttrAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
304 {
305     INC_STATS("DOM.TestObj.reflectedUnsignedIntegralAttr._get");
306     TestObj* imp = V8TestObj::toNative(info.Holder());
307     return v8::Integer::NewFromUnsigned(std::max(0, imp->getIntegralAttribute(WebCore::HTMLNames::reflectedunsignedintegralattrAttr)));
308 }
309
310 static void reflectedUnsignedIntegralAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
311 {
312     INC_STATS("DOM.TestObj.reflectedUnsignedIntegralAttr._set");
313     TestObj* imp = V8TestObj::toNative(info.Holder());
314     unsigned v = toUInt32(value);
315     imp->setUnsignedIntegralAttribute(WebCore::HTMLNames::reflectedunsignedintegralattrAttr, v);
316     return;
317 }
318
319 static v8::Handle<v8::Value> reflectedBooleanAttrAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
320 {
321     INC_STATS("DOM.TestObj.reflectedBooleanAttr._get");
322     TestObj* imp = V8TestObj::toNative(info.Holder());
323     return v8Boolean(imp->hasAttribute(WebCore::HTMLNames::reflectedbooleanattrAttr));
324 }
325
326 static void reflectedBooleanAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
327 {
328     INC_STATS("DOM.TestObj.reflectedBooleanAttr._set");
329     TestObj* imp = V8TestObj::toNative(info.Holder());
330     bool v = value->BooleanValue();
331     imp->setBooleanAttribute(WebCore::HTMLNames::reflectedbooleanattrAttr, v);
332     return;
333 }
334
335 static v8::Handle<v8::Value> reflectedURLAttrAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
336 {
337     INC_STATS("DOM.TestObj.reflectedURLAttr._get");
338     TestObj* imp = V8TestObj::toNative(info.Holder());
339     return v8String(imp->getURLAttribute(WebCore::HTMLNames::reflectedurlattrAttr));
340 }
341
342 static void reflectedURLAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
343 {
344     INC_STATS("DOM.TestObj.reflectedURLAttr._set");
345     TestObj* imp = V8TestObj::toNative(info.Holder());
346     STRING_TO_V8PARAMETER_EXCEPTION_BLOCK_VOID(V8Parameter<WithNullCheck>, v, value);
347     imp->setAttribute(WebCore::HTMLNames::reflectedurlattrAttr, v);
348     return;
349 }
350
351 static v8::Handle<v8::Value> reflectedStringAttrAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
352 {
353     INC_STATS("DOM.TestObj.reflectedStringAttr._get");
354     TestObj* imp = V8TestObj::toNative(info.Holder());
355     return v8String(imp->getAttribute(WebCore::HTMLNames::customContentStringAttrAttr));
356 }
357
358 static void reflectedStringAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
359 {
360     INC_STATS("DOM.TestObj.reflectedStringAttr._set");
361     TestObj* imp = V8TestObj::toNative(info.Holder());
362     STRING_TO_V8PARAMETER_EXCEPTION_BLOCK_VOID(V8Parameter<WithNullCheck>, v, value);
363     imp->setAttribute(WebCore::HTMLNames::customContentStringAttrAttr, v);
364     return;
365 }
366
367 static v8::Handle<v8::Value> reflectedCustomIntegralAttrAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
368 {
369     INC_STATS("DOM.TestObj.reflectedCustomIntegralAttr._get");
370     TestObj* imp = V8TestObj::toNative(info.Holder());
371     return v8::Integer::New(imp->getIntegralAttribute(WebCore::HTMLNames::customContentIntegralAttrAttr));
372 }
373
374 static void reflectedCustomIntegralAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
375 {
376     INC_STATS("DOM.TestObj.reflectedCustomIntegralAttr._set");
377     TestObj* imp = V8TestObj::toNative(info.Holder());
378     int v = toInt32(value);
379     imp->setIntegralAttribute(WebCore::HTMLNames::customContentIntegralAttrAttr, v);
380     return;
381 }
382
383 static v8::Handle<v8::Value> reflectedCustomBooleanAttrAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
384 {
385     INC_STATS("DOM.TestObj.reflectedCustomBooleanAttr._get");
386     TestObj* imp = V8TestObj::toNative(info.Holder());
387     return v8Boolean(imp->hasAttribute(WebCore::HTMLNames::customContentBooleanAttrAttr));
388 }
389
390 static void reflectedCustomBooleanAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
391 {
392     INC_STATS("DOM.TestObj.reflectedCustomBooleanAttr._set");
393     TestObj* imp = V8TestObj::toNative(info.Holder());
394     bool v = value->BooleanValue();
395     imp->setBooleanAttribute(WebCore::HTMLNames::customContentBooleanAttrAttr, v);
396     return;
397 }
398
399 static v8::Handle<v8::Value> reflectedCustomURLAttrAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
400 {
401     INC_STATS("DOM.TestObj.reflectedCustomURLAttr._get");
402     TestObj* imp = V8TestObj::toNative(info.Holder());
403     return v8String(imp->getURLAttribute(WebCore::HTMLNames::customContentURLAttrAttr));
404 }
405
406 static void reflectedCustomURLAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
407 {
408     INC_STATS("DOM.TestObj.reflectedCustomURLAttr._set");
409     TestObj* imp = V8TestObj::toNative(info.Holder());
410     STRING_TO_V8PARAMETER_EXCEPTION_BLOCK_VOID(V8Parameter<WithNullCheck>, v, value);
411     imp->setAttribute(WebCore::HTMLNames::customContentURLAttrAttr, v);
412     return;
413 }
414
415 static v8::Handle<v8::Value> attrWithGetterExceptionAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
416 {
417     INC_STATS("DOM.TestObj.attrWithGetterException._get");
418     TestObj* imp = V8TestObj::toNative(info.Holder());
419     ExceptionCode ec = 0;
420     int v = imp->attrWithGetterException(ec);
421     if (UNLIKELY(ec)) {
422         V8Proxy::setDOMException(ec);
423         return v8::Handle<v8::Value>();
424     }
425     return v8::Integer::New(v);
426 }
427
428 static void attrWithGetterExceptionAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
429 {
430     INC_STATS("DOM.TestObj.attrWithGetterException._set");
431     TestObj* imp = V8TestObj::toNative(info.Holder());
432     int v = toInt32(value);
433     ExceptionCode ec = 0;
434     imp->setAttrWithGetterException(v, ec);
435     if (UNLIKELY(ec))
436         V8Proxy::setDOMException(ec);
437     return;
438 }
439
440 static v8::Handle<v8::Value> attrWithSetterExceptionAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
441 {
442     INC_STATS("DOM.TestObj.attrWithSetterException._get");
443     TestObj* imp = V8TestObj::toNative(info.Holder());
444     return v8::Integer::New(imp->attrWithSetterException());
445 }
446
447 static void attrWithSetterExceptionAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
448 {
449     INC_STATS("DOM.TestObj.attrWithSetterException._set");
450     TestObj* imp = V8TestObj::toNative(info.Holder());
451     int v = toInt32(value);
452     ExceptionCode ec = 0;
453     imp->setAttrWithSetterException(v, ec);
454     if (UNLIKELY(ec))
455         V8Proxy::setDOMException(ec);
456     return;
457 }
458
459 static v8::Handle<v8::Value> stringAttrWithGetterExceptionAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
460 {
461     INC_STATS("DOM.TestObj.stringAttrWithGetterException._get");
462     TestObj* imp = V8TestObj::toNative(info.Holder());
463     ExceptionCode ec = 0;
464     String v = imp->stringAttrWithGetterException(ec);
465     if (UNLIKELY(ec)) {
466         V8Proxy::setDOMException(ec);
467         return v8::Handle<v8::Value>();
468     }
469     return v8String(v);
470 }
471
472 static void stringAttrWithGetterExceptionAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
473 {
474     INC_STATS("DOM.TestObj.stringAttrWithGetterException._set");
475     TestObj* imp = V8TestObj::toNative(info.Holder());
476     STRING_TO_V8PARAMETER_EXCEPTION_BLOCK_VOID(V8Parameter<>, v, value);
477     ExceptionCode ec = 0;
478     imp->setStringAttrWithGetterException(v, ec);
479     if (UNLIKELY(ec))
480         V8Proxy::setDOMException(ec);
481     return;
482 }
483
484 static v8::Handle<v8::Value> stringAttrWithSetterExceptionAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
485 {
486     INC_STATS("DOM.TestObj.stringAttrWithSetterException._get");
487     TestObj* imp = V8TestObj::toNative(info.Holder());
488     return v8String(imp->stringAttrWithSetterException());
489 }
490
491 static void stringAttrWithSetterExceptionAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
492 {
493     INC_STATS("DOM.TestObj.stringAttrWithSetterException._set");
494     TestObj* imp = V8TestObj::toNative(info.Holder());
495     STRING_TO_V8PARAMETER_EXCEPTION_BLOCK_VOID(V8Parameter<>, v, value);
496     ExceptionCode ec = 0;
497     imp->setStringAttrWithSetterException(v, ec);
498     if (UNLIKELY(ec))
499         V8Proxy::setDOMException(ec);
500     return;
501 }
502
503 static v8::Handle<v8::Value> withScriptStateAttributeAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
504 {
505     INC_STATS("DOM.TestObj.withScriptStateAttribute._get");
506     TestObj* imp = V8TestObj::toNative(info.Holder());
507     ScriptState* state = ScriptState::current();
508     if (!state)
509         return v8::Undefined();
510     return v8::Integer::New(imp->withScriptStateAttribute(state));
511 }
512
513 static void withScriptStateAttributeAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
514 {
515     INC_STATS("DOM.TestObj.withScriptStateAttribute._set");
516     TestObj* imp = V8TestObj::toNative(info.Holder());
517     int v = toInt32(value);
518     ScriptState* state = ScriptState::current();
519     if (!state)
520         return;
521     imp->setWithScriptStateAttribute(state, v);
522     if (state.hadException())
523         throwError(state.exception());
524     return;
525 }
526
527 static v8::Handle<v8::Value> withScriptExecutionContextAttributeAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
528 {
529     INC_STATS("DOM.TestObj.withScriptExecutionContextAttribute._get");
530     TestObj* imp = V8TestObj::toNative(info.Holder());
531     ScriptExecutionContext* scriptContext = getScriptExecutionContext();
532     if (!scriptContext)
533         return v8::Undefined();
534     return toV8(imp->withScriptExecutionContextAttribute(scriptContext));
535 }
536
537 static void withScriptExecutionContextAttributeAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
538 {
539     INC_STATS("DOM.TestObj.withScriptExecutionContextAttribute._set");
540     TestObj* imp = V8TestObj::toNative(info.Holder());
541     TestObj* v = V8TestObj::HasInstance(value) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(value)) : 0;
542     ScriptExecutionContext* scriptContext = getScriptExecutionContext();
543     if (!scriptContext)
544         return;
545     imp->setWithScriptExecutionContextAttribute(scriptContext, WTF::getPtr(v));
546     return;
547 }
548
549 static v8::Handle<v8::Value> withScriptStateAttributeRaisesAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
550 {
551     INC_STATS("DOM.TestObj.withScriptStateAttributeRaises._get");
552     TestObj* imp = V8TestObj::toNative(info.Holder());
553     ExceptionCode ec = 0;
554     ScriptState* state = ScriptState::current();
555     if (!state)
556         return v8::Undefined();
557     RefPtr<TestObj> v = imp->withScriptStateAttributeRaises(state, ec);
558     if (UNLIKELY(ec)) {
559         V8Proxy::setDOMException(ec);
560         return v8::Handle<v8::Value>();
561     }
562     if (state.hadException())
563         return throwError(state.exception());
564     return toV8(v.release());
565 }
566
567 static void withScriptStateAttributeRaisesAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
568 {
569     INC_STATS("DOM.TestObj.withScriptStateAttributeRaises._set");
570     TestObj* imp = V8TestObj::toNative(info.Holder());
571     TestObj* v = V8TestObj::HasInstance(value) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(value)) : 0;
572     ExceptionCode ec = 0;
573     ScriptState* state = ScriptState::current();
574     if (!state)
575         return;
576     imp->setWithScriptStateAttributeRaises(state, WTF::getPtr(v), ec);
577     if (UNLIKELY(ec))
578         V8Proxy::setDOMException(ec);
579     if (state.hadException())
580         throwError(state.exception());
581     return;
582 }
583
584 static v8::Handle<v8::Value> withScriptExecutionContextAttributeRaisesAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
585 {
586     INC_STATS("DOM.TestObj.withScriptExecutionContextAttributeRaises._get");
587     TestObj* imp = V8TestObj::toNative(info.Holder());
588     ExceptionCode ec = 0;
589     ScriptExecutionContext* scriptContext = getScriptExecutionContext();
590     if (!scriptContext)
591         return v8::Undefined();
592     RefPtr<TestObj> v = imp->withScriptExecutionContextAttributeRaises(scriptContext, ec);
593     if (UNLIKELY(ec)) {
594         V8Proxy::setDOMException(ec);
595         return v8::Handle<v8::Value>();
596     }
597     return toV8(v.release());
598 }
599
600 static void withScriptExecutionContextAttributeRaisesAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
601 {
602     INC_STATS("DOM.TestObj.withScriptExecutionContextAttributeRaises._set");
603     TestObj* imp = V8TestObj::toNative(info.Holder());
604     TestObj* v = V8TestObj::HasInstance(value) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(value)) : 0;
605     ExceptionCode ec = 0;
606     ScriptExecutionContext* scriptContext = getScriptExecutionContext();
607     if (!scriptContext)
608         return;
609     imp->setWithScriptExecutionContextAttributeRaises(scriptContext, WTF::getPtr(v), ec);
610     if (UNLIKELY(ec))
611         V8Proxy::setDOMException(ec);
612     return;
613 }
614
615 static v8::Handle<v8::Value> withScriptExecutionContextAndScriptStateAttributeAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
616 {
617     INC_STATS("DOM.TestObj.withScriptExecutionContextAndScriptStateAttribute._get");
618     TestObj* imp = V8TestObj::toNative(info.Holder());
619     ScriptState* state = ScriptState::current();
620     if (!state)
621         return v8::Undefined();
622     ScriptExecutionContext* scriptContext = getScriptExecutionContext();
623     if (!scriptContext)
624         return v8::Undefined();
625     return toV8(imp->withScriptExecutionContextAndScriptStateAttribute(state, scriptContext));
626 }
627
628 static void withScriptExecutionContextAndScriptStateAttributeAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
629 {
630     INC_STATS("DOM.TestObj.withScriptExecutionContextAndScriptStateAttribute._set");
631     TestObj* imp = V8TestObj::toNative(info.Holder());
632     TestObj* v = V8TestObj::HasInstance(value) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(value)) : 0;
633     ScriptState* state = ScriptState::current();
634     if (!state)
635         return;
636     ScriptExecutionContext* scriptContext = getScriptExecutionContext();
637     if (!scriptContext)
638         return;
639     imp->setWithScriptExecutionContextAndScriptStateAttribute(state, scriptContext, WTF::getPtr(v));
640     if (state.hadException())
641         throwError(state.exception());
642     return;
643 }
644
645 static v8::Handle<v8::Value> withScriptExecutionContextAndScriptStateAttributeRaisesAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
646 {
647     INC_STATS("DOM.TestObj.withScriptExecutionContextAndScriptStateAttributeRaises._get");
648     TestObj* imp = V8TestObj::toNative(info.Holder());
649     ExceptionCode ec = 0;
650     ScriptState* state = ScriptState::current();
651     if (!state)
652         return v8::Undefined();
653     ScriptExecutionContext* scriptContext = getScriptExecutionContext();
654     if (!scriptContext)
655         return v8::Undefined();
656     RefPtr<TestObj> v = imp->withScriptExecutionContextAndScriptStateAttributeRaises(state, scriptContext, ec);
657     if (UNLIKELY(ec)) {
658         V8Proxy::setDOMException(ec);
659         return v8::Handle<v8::Value>();
660     }
661     if (state.hadException())
662         return throwError(state.exception());
663     return toV8(v.release());
664 }
665
666 static void withScriptExecutionContextAndScriptStateAttributeRaisesAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
667 {
668     INC_STATS("DOM.TestObj.withScriptExecutionContextAndScriptStateAttributeRaises._set");
669     TestObj* imp = V8TestObj::toNative(info.Holder());
670     TestObj* v = V8TestObj::HasInstance(value) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(value)) : 0;
671     ExceptionCode ec = 0;
672     ScriptState* state = ScriptState::current();
673     if (!state)
674         return;
675     ScriptExecutionContext* scriptContext = getScriptExecutionContext();
676     if (!scriptContext)
677         return;
678     imp->setWithScriptExecutionContextAndScriptStateAttributeRaises(state, scriptContext, WTF::getPtr(v), ec);
679     if (UNLIKELY(ec))
680         V8Proxy::setDOMException(ec);
681     if (state.hadException())
682         throwError(state.exception());
683     return;
684 }
685
686 static v8::Handle<v8::Value> withScriptExecutionContextAndScriptStateWithSpacesAttributeAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
687 {
688     INC_STATS("DOM.TestObj.withScriptExecutionContextAndScriptStateWithSpacesAttribute._get");
689     TestObj* imp = V8TestObj::toNative(info.Holder());
690     ScriptState* state = ScriptState::current();
691     if (!state)
692         return v8::Undefined();
693     ScriptExecutionContext* scriptContext = getScriptExecutionContext();
694     if (!scriptContext)
695         return v8::Undefined();
696     return toV8(imp->withScriptExecutionContextAndScriptStateWithSpacesAttribute(state, scriptContext));
697 }
698
699 static void withScriptExecutionContextAndScriptStateWithSpacesAttributeAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
700 {
701     INC_STATS("DOM.TestObj.withScriptExecutionContextAndScriptStateWithSpacesAttribute._set");
702     TestObj* imp = V8TestObj::toNative(info.Holder());
703     TestObj* v = V8TestObj::HasInstance(value) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(value)) : 0;
704     ScriptState* state = ScriptState::current();
705     if (!state)
706         return;
707     ScriptExecutionContext* scriptContext = getScriptExecutionContext();
708     if (!scriptContext)
709         return;
710     imp->setWithScriptExecutionContextAndScriptStateWithSpacesAttribute(state, scriptContext, WTF::getPtr(v));
711     if (state.hadException())
712         throwError(state.exception());
713     return;
714 }
715
716 static v8::Handle<v8::Value> withScriptArgumentsAndCallStackAttributeAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
717 {
718     INC_STATS("DOM.TestObj.withScriptArgumentsAndCallStackAttribute._get");
719     TestObj* imp = V8TestObj::toNative(info.Holder());
720     RefPtr<ScriptCallStack> callStack(createScriptCallStackForInspector());
721     if (!callStack)
722         return v8::Undefined();
723     return toV8(imp->withScriptArgumentsAndCallStackAttribute(callStack));
724 }
725
726 static void withScriptArgumentsAndCallStackAttributeAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
727 {
728     INC_STATS("DOM.TestObj.withScriptArgumentsAndCallStackAttribute._set");
729     TestObj* imp = V8TestObj::toNative(info.Holder());
730     TestObj* v = V8TestObj::HasInstance(value) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(value)) : 0;
731     RefPtr<ScriptCallStack> callStack(createScriptCallStackForInspector());
732     if (!callStack)
733         return v8::Undefined();
734     imp->setWithScriptArgumentsAndCallStackAttribute(callStack, WTF::getPtr(v));
735     return;
736 }
737
738 #if ENABLE(Condition1)
739
740 static v8::Handle<v8::Value> conditionalAttr1AttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
741 {
742     INC_STATS("DOM.TestObj.conditionalAttr1._get");
743     TestObj* imp = V8TestObj::toNative(info.Holder());
744     return v8::Integer::New(imp->conditionalAttr1());
745 }
746
747 #endif // ENABLE(Condition1)
748
749 #if ENABLE(Condition1)
750
751 static void conditionalAttr1AttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
752 {
753     INC_STATS("DOM.TestObj.conditionalAttr1._set");
754     TestObj* imp = V8TestObj::toNative(info.Holder());
755     int v = toInt32(value);
756     imp->setConditionalAttr1(v);
757     return;
758 }
759
760 #endif // ENABLE(Condition1)
761
762 #if ENABLE(Condition1) && ENABLE(Condition2)
763
764 static v8::Handle<v8::Value> conditionalAttr2AttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
765 {
766     INC_STATS("DOM.TestObj.conditionalAttr2._get");
767     TestObj* imp = V8TestObj::toNative(info.Holder());
768     return v8::Integer::New(imp->conditionalAttr2());
769 }
770
771 #endif // ENABLE(Condition1) && ENABLE(Condition2)
772
773 #if ENABLE(Condition1) && ENABLE(Condition2)
774
775 static void conditionalAttr2AttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
776 {
777     INC_STATS("DOM.TestObj.conditionalAttr2._set");
778     TestObj* imp = V8TestObj::toNative(info.Holder());
779     int v = toInt32(value);
780     imp->setConditionalAttr2(v);
781     return;
782 }
783
784 #endif // ENABLE(Condition1) && ENABLE(Condition2)
785
786 #if ENABLE(Condition1) || ENABLE(Condition2)
787
788 static v8::Handle<v8::Value> conditionalAttr3AttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
789 {
790     INC_STATS("DOM.TestObj.conditionalAttr3._get");
791     TestObj* imp = V8TestObj::toNative(info.Holder());
792     return v8::Integer::New(imp->conditionalAttr3());
793 }
794
795 #endif // ENABLE(Condition1) || ENABLE(Condition2)
796
797 #if ENABLE(Condition1) || ENABLE(Condition2)
798
799 static void conditionalAttr3AttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
800 {
801     INC_STATS("DOM.TestObj.conditionalAttr3._set");
802     TestObj* imp = V8TestObj::toNative(info.Holder());
803     int v = toInt32(value);
804     imp->setConditionalAttr3(v);
805     return;
806 }
807
808 #endif // ENABLE(Condition1) || ENABLE(Condition2)
809
810 static v8::Handle<v8::Value> cachedAttribute1AttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
811 {
812     INC_STATS("DOM.TestObj.cachedAttribute1._get");
813     TestObj* imp = V8TestObj::toNative(info.Holder());
814     RefPtr<any> result = imp->cachedAttribute1();
815     v8::Handle<v8::Value> wrapper = result.get() ? getDOMObjectMap().get(result.get()) : v8::Handle<v8::Object>();
816     if (wrapper.IsEmpty()) {
817         wrapper = toV8(result.get());
818         if (!wrapper.IsEmpty())
819             V8DOMWrapper::setNamedHiddenReference(info.Holder(), "cachedAttribute1", wrapper);
820     }
821     return wrapper;
822 }
823
824 static v8::Handle<v8::Value> cachedAttribute2AttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
825 {
826     INC_STATS("DOM.TestObj.cachedAttribute2._get");
827     TestObj* imp = V8TestObj::toNative(info.Holder());
828     RefPtr<any> result = imp->cachedAttribute2();
829     v8::Handle<v8::Value> wrapper = result.get() ? getDOMObjectMap().get(result.get()) : v8::Handle<v8::Object>();
830     if (wrapper.IsEmpty()) {
831         wrapper = toV8(result.get());
832         if (!wrapper.IsEmpty())
833             V8DOMWrapper::setNamedHiddenReference(info.Holder(), "cachedAttribute2", wrapper);
834     }
835     return wrapper;
836 }
837
838 static v8::Handle<v8::Value> enabledAtRuntimeAttr1AttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
839 {
840     INC_STATS("DOM.TestObj.enabledAtRuntimeAttr1._get");
841     TestObj* imp = V8TestObj::toNative(info.Holder());
842     return v8::Integer::New(imp->enabledAtRuntimeAttr1());
843 }
844
845 static void enabledAtRuntimeAttr1AttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
846 {
847     INC_STATS("DOM.TestObj.enabledAtRuntimeAttr1._set");
848     TestObj* imp = V8TestObj::toNative(info.Holder());
849     int v = toInt32(value);
850     imp->setEnabledAtRuntimeAttr1(v);
851     return;
852 }
853
854 static v8::Handle<v8::Value> enabledAtRuntimeAttr2AttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
855 {
856     INC_STATS("DOM.TestObj.enabledAtRuntimeAttr2._get");
857     TestObj* imp = V8TestObj::toNative(info.Holder());
858     return v8::Integer::New(imp->enabledAtRuntimeAttr2());
859 }
860
861 static void enabledAtRuntimeAttr2AttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
862 {
863     INC_STATS("DOM.TestObj.enabledAtRuntimeAttr2._set");
864     TestObj* imp = V8TestObj::toNative(info.Holder());
865     int v = toInt32(value);
866     imp->setEnabledAtRuntimeAttr2(v);
867     return;
868 }
869
870 static v8::Handle<v8::Value> floatArrayAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
871 {
872     INC_STATS("DOM.TestObj.floatArray._get");
873     TestObj* imp = V8TestObj::toNative(info.Holder());
874     return v8NumberArray(imp->floatArray());
875 }
876
877 static void floatArrayAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
878 {
879     INC_STATS("DOM.TestObj.floatArray._set");
880     TestObj* imp = V8TestObj::toNative(info.Holder());
881     Vector<float> v = v8NumberArrayToVector<float>(value);
882     imp->setFloatArray(v);
883     return;
884 }
885
886 static v8::Handle<v8::Value> doubleArrayAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
887 {
888     INC_STATS("DOM.TestObj.doubleArray._get");
889     TestObj* imp = V8TestObj::toNative(info.Holder());
890     return v8NumberArray(imp->doubleArray());
891 }
892
893 static void doubleArrayAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
894 {
895     INC_STATS("DOM.TestObj.doubleArray._set");
896     TestObj* imp = V8TestObj::toNative(info.Holder());
897     Vector<double> v = v8NumberArrayToVector<double>(value);
898     imp->setDoubleArray(v);
899     return;
900 }
901
902 static v8::Handle<v8::Value> contentDocumentAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
903 {
904     INC_STATS("DOM.TestObj.contentDocument._get");
905     TestObj* imp = V8TestObj::toNative(info.Holder());
906     if (!V8BindingSecurity::shouldAllowAccessToNode(V8BindingState::Only(), imp->contentDocument()))
907         return v8::Handle<v8::Value>(v8::Null());
908
909     return toV8(imp->contentDocument());
910 }
911
912 static v8::Handle<v8::Value> mutablePointAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
913 {
914     INC_STATS("DOM.TestObj.mutablePoint._get");
915     TestObj* imp = V8TestObj::toNative(info.Holder());
916     return toV8(WTF::getPtr(SVGStaticPropertyTearOff<TestObj, FloatPoint>::create(imp, imp->mutablePoint(), &TestObj::updateMutablePoint)));
917 }
918
919 static void mutablePointAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
920 {
921     INC_STATS("DOM.TestObj.mutablePoint._set");
922     TestObj* imp = V8TestObj::toNative(info.Holder());
923     RefPtr<SVGPropertyTearOff<FloatPoint> > v = V8SVGPoint::HasInstance(value) ? V8SVGPoint::toNative(v8::Handle<v8::Object>::Cast(value)) : 0;
924     imp->setMutablePoint(WTF::getPtr(v));
925     return;
926 }
927
928 static v8::Handle<v8::Value> immutablePointAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
929 {
930     INC_STATS("DOM.TestObj.immutablePoint._get");
931     TestObj* imp = V8TestObj::toNative(info.Holder());
932     return toV8(WTF::getPtr(SVGPropertyTearOff<FloatPoint>::create(imp->immutablePoint())));
933 }
934
935 static void immutablePointAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
936 {
937     INC_STATS("DOM.TestObj.immutablePoint._set");
938     TestObj* imp = V8TestObj::toNative(info.Holder());
939     RefPtr<SVGPropertyTearOff<FloatPoint> > v = V8SVGPoint::HasInstance(value) ? V8SVGPoint::toNative(v8::Handle<v8::Object>::Cast(value)) : 0;
940     imp->setImmutablePoint(WTF::getPtr(v));
941     return;
942 }
943
944 static v8::Handle<v8::Value> strawberryAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
945 {
946     INC_STATS("DOM.TestObj.strawberry._get");
947     TestObj* imp = V8TestObj::toNative(info.Holder());
948     return v8::Integer::New(imp->blueberry());
949 }
950
951 static void strawberryAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
952 {
953     INC_STATS("DOM.TestObj.strawberry._set");
954     TestObj* imp = V8TestObj::toNative(info.Holder());
955     int v = V8int::HasInstance(value) ? V8int::toNative(v8::Handle<v8::Object>::Cast(value)) : 0;
956     imp->setBlueberry(v);
957     return;
958 }
959
960 static v8::Handle<v8::Value> strictFloatAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
961 {
962     INC_STATS("DOM.TestObj.strictFloat._get");
963     TestObj* imp = V8TestObj::toNative(info.Holder());
964     return v8::Number::New(imp->strictFloat());
965 }
966
967 static void strictFloatAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
968 {
969     INC_STATS("DOM.TestObj.strictFloat._set");
970     TestObj* imp = V8TestObj::toNative(info.Holder());
971     float v = static_cast<float>(value->NumberValue());
972     imp->setStrictFloat(v);
973     return;
974 }
975
976 static v8::Handle<v8::Value> descriptionAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
977 {
978     INC_STATS("DOM.TestObj.description._get");
979     TestObj* imp = V8TestObj::toNative(info.Holder());
980     return v8::Integer::New(imp->description());
981 }
982
983 static v8::Handle<v8::Value> idAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
984 {
985     INC_STATS("DOM.TestObj.id._get");
986     TestObj* imp = V8TestObj::toNative(info.Holder());
987     return v8::Integer::New(imp->id());
988 }
989
990 static void idAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
991 {
992     INC_STATS("DOM.TestObj.id._set");
993     TestObj* imp = V8TestObj::toNative(info.Holder());
994     int v = toInt32(value);
995     imp->setId(v);
996     return;
997 }
998
999 static v8::Handle<v8::Value> hashAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
1000 {
1001     INC_STATS("DOM.TestObj.hash._get");
1002     TestObj* imp = V8TestObj::toNative(info.Holder());
1003     return v8String(imp->hash());
1004 }
1005
1006 static v8::Handle<v8::Value> TestObjConstructorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
1007 {
1008     INC_STATS("DOM.TestObj.constructors._get");
1009     v8::Handle<v8::Value> data = info.Data();
1010     ASSERT(data->IsExternal() || data->IsNumber());
1011     WrapperTypeInfo* type = WrapperTypeInfo::unwrap(data);
1012     return v8::Handle<v8::Value>();}
1013
1014 static v8::Handle<v8::Value> voidMethodCallback(const v8::Arguments& args)
1015 {
1016     INC_STATS("DOM.TestObj.voidMethod");
1017     TestObj* imp = V8TestObj::toNative(args.Holder());
1018     imp->voidMethod();
1019     return v8::Handle<v8::Value>();
1020 }
1021
1022 static v8::Handle<v8::Value> voidMethodWithArgsCallback(const v8::Arguments& args)
1023 {
1024     INC_STATS("DOM.TestObj.voidMethodWithArgs");
1025     if (args.Length() < 3)
1026         return throwError("Not enough arguments", V8Proxy::TypeError);
1027     TestObj* imp = V8TestObj::toNative(args.Holder());
1028     EXCEPTION_BLOCK(int, intArg, toInt32(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)));
1029     STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, strArg, MAYBE_MISSING_PARAMETER(args, 1, DefaultIsUndefined));
1030     EXCEPTION_BLOCK(TestObj*, objArg, V8TestObj::HasInstance(MAYBE_MISSING_PARAMETER(args, 2, DefaultIsUndefined)) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(MAYBE_MISSING_PARAMETER(args, 2, DefaultIsUndefined))) : 0);
1031     imp->voidMethodWithArgs(intArg, strArg, objArg);
1032     return v8::Handle<v8::Value>();
1033 }
1034
1035 static v8::Handle<v8::Value> intMethodCallback(const v8::Arguments& args)
1036 {
1037     INC_STATS("DOM.TestObj.intMethod");
1038     TestObj* imp = V8TestObj::toNative(args.Holder());
1039     return v8::Integer::New(imp->intMethod());
1040 }
1041
1042 static v8::Handle<v8::Value> intMethodWithArgsCallback(const v8::Arguments& args)
1043 {
1044     INC_STATS("DOM.TestObj.intMethodWithArgs");
1045     if (args.Length() < 3)
1046         return throwError("Not enough arguments", V8Proxy::TypeError);
1047     TestObj* imp = V8TestObj::toNative(args.Holder());
1048     EXCEPTION_BLOCK(int, intArg, toInt32(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)));
1049     STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, strArg, MAYBE_MISSING_PARAMETER(args, 1, DefaultIsUndefined));
1050     EXCEPTION_BLOCK(TestObj*, objArg, V8TestObj::HasInstance(MAYBE_MISSING_PARAMETER(args, 2, DefaultIsUndefined)) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(MAYBE_MISSING_PARAMETER(args, 2, DefaultIsUndefined))) : 0);
1051     return v8::Integer::New(imp->intMethodWithArgs(intArg, strArg, objArg));
1052 }
1053
1054 static v8::Handle<v8::Value> objMethodCallback(const v8::Arguments& args)
1055 {
1056     INC_STATS("DOM.TestObj.objMethod");
1057     TestObj* imp = V8TestObj::toNative(args.Holder());
1058     return toV8(imp->objMethod());
1059 }
1060
1061 static v8::Handle<v8::Value> objMethodWithArgsCallback(const v8::Arguments& args)
1062 {
1063     INC_STATS("DOM.TestObj.objMethodWithArgs");
1064     if (args.Length() < 3)
1065         return throwError("Not enough arguments", V8Proxy::TypeError);
1066     TestObj* imp = V8TestObj::toNative(args.Holder());
1067     EXCEPTION_BLOCK(int, intArg, toInt32(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)));
1068     STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, strArg, MAYBE_MISSING_PARAMETER(args, 1, DefaultIsUndefined));
1069     EXCEPTION_BLOCK(TestObj*, objArg, V8TestObj::HasInstance(MAYBE_MISSING_PARAMETER(args, 2, DefaultIsUndefined)) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(MAYBE_MISSING_PARAMETER(args, 2, DefaultIsUndefined))) : 0);
1070     return toV8(imp->objMethodWithArgs(intArg, strArg, objArg));
1071 }
1072
1073 static v8::Handle<v8::Value> methodWithSequenceArgCallback(const v8::Arguments& args)
1074 {
1075     INC_STATS("DOM.TestObj.methodWithSequenceArg");
1076     if (args.Length() < 1)
1077         return throwError("Not enough arguments", V8Proxy::TypeError);
1078     TestObj* imp = V8TestObj::toNative(args.Holder());
1079     EXCEPTION_BLOCK(sequence*, , V8sequence::HasInstance(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)) ? V8sequence::toNative(v8::Handle<v8::Object>::Cast(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined))) : 0);
1080     imp->methodWithSequenceArg();
1081     return v8::Handle<v8::Value>();
1082 }
1083
1084 static v8::Handle<v8::Value> methodReturningSequenceCallback(const v8::Arguments& args)
1085 {
1086     INC_STATS("DOM.TestObj.methodReturningSequence");
1087     if (args.Length() < 1)
1088         return throwError("Not enough arguments", V8Proxy::TypeError);
1089     TestObj* imp = V8TestObj::toNative(args.Holder());
1090     EXCEPTION_BLOCK(int, intArg, toInt32(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)));
1091     return v8Array(imp->methodReturningSequence(intArg));
1092 }
1093
1094 static v8::Handle<v8::Value> methodThatRequiresAllArgsAndThrowsCallback(const v8::Arguments& args)
1095 {
1096     INC_STATS("DOM.TestObj.methodThatRequiresAllArgsAndThrows");
1097     if (args.Length() < 2)
1098         return throwError("Not enough arguments", V8Proxy::TypeError);
1099     TestObj* imp = V8TestObj::toNative(args.Holder());
1100     ExceptionCode ec = 0;
1101     {
1102     STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, strArg, MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined));
1103     EXCEPTION_BLOCK(TestObj*, objArg, V8TestObj::HasInstance(MAYBE_MISSING_PARAMETER(args, 1, DefaultIsUndefined)) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(MAYBE_MISSING_PARAMETER(args, 1, DefaultIsUndefined))) : 0);
1104     RefPtr<TestObj> result = imp->methodThatRequiresAllArgsAndThrows(strArg, objArg, ec);
1105     if (UNLIKELY(ec))
1106         goto fail;
1107     return toV8(result.release());
1108     }
1109     fail:
1110     V8Proxy::setDOMException(ec);
1111     return v8::Handle<v8::Value>();
1112 }
1113
1114 static v8::Handle<v8::Value> serializedValueCallback(const v8::Arguments& args)
1115 {
1116     INC_STATS("DOM.TestObj.serializedValue");
1117     if (args.Length() < 1)
1118         return throwError("Not enough arguments", V8Proxy::TypeError);
1119     TestObj* imp = V8TestObj::toNative(args.Holder());
1120     bool serializedArgDidThrow = false;
1121     RefPtr<SerializedScriptValue> serializedArg = SerializedScriptValue::create(args[0], 0, 0, serializedArgDidThrow);
1122     if (serializedArgDidThrow)
1123         return v8::Undefined();
1124     imp->serializedValue(serializedArg);
1125     return v8::Handle<v8::Value>();
1126 }
1127
1128 static v8::Handle<v8::Value> idbKeyCallback(const v8::Arguments& args)
1129 {
1130     INC_STATS("DOM.TestObj.idbKey");
1131     if (args.Length() < 1)
1132         return throwError("Not enough arguments", V8Proxy::TypeError);
1133     TestObj* imp = V8TestObj::toNative(args.Holder());
1134     EXCEPTION_BLOCK(RefPtr<IDBKey>, key, createIDBKeyFromValue(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)));
1135     imp->idbKey(key.get());
1136     return v8::Handle<v8::Value>();
1137 }
1138
1139 static v8::Handle<v8::Value> optionsObjectCallback(const v8::Arguments& args)
1140 {
1141     INC_STATS("DOM.TestObj.optionsObject");
1142     if (args.Length() < 1)
1143         return throwError("Not enough arguments", V8Proxy::TypeError);
1144     TestObj* imp = V8TestObj::toNative(args.Holder());
1145     EXCEPTION_BLOCK(Dictionary, oo, MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined));
1146     if (args.Length() > 0 && !oo.isUndefinedOrNull() && !oo.isObject()) {
1147         ec = TYPE_MISMATCH_ERR;
1148         V8Proxy::setDOMException(ec);
1149         return throwError("Not an object.", V8Proxy::TypeError);
1150     }
1151     if (args.Length() <= 1) {
1152         imp->optionsObject(oo);
1153         return v8::Handle<v8::Value>();
1154     }
1155     EXCEPTION_BLOCK(Dictionary, ooo, MAYBE_MISSING_PARAMETER(args, 1, DefaultIsUndefined));
1156     if (args.Length() > 1 && !ooo.isUndefinedOrNull() && !ooo.isObject()) {
1157         ec = TYPE_MISMATCH_ERR;
1158         V8Proxy::setDOMException(ec);
1159         return throwError("Not an object.", V8Proxy::TypeError);
1160     }
1161     imp->optionsObject(oo, ooo);
1162     return v8::Handle<v8::Value>();
1163 }
1164
1165 static v8::Handle<v8::Value> methodWithExceptionCallback(const v8::Arguments& args)
1166 {
1167     INC_STATS("DOM.TestObj.methodWithException");
1168     TestObj* imp = V8TestObj::toNative(args.Holder());
1169     ExceptionCode ec = 0;
1170     {
1171     imp->methodWithException(ec);
1172     if (UNLIKELY(ec))
1173         goto fail;
1174     return v8::Handle<v8::Value>();
1175     }
1176     fail:
1177     V8Proxy::setDOMException(ec);
1178     return v8::Handle<v8::Value>();
1179 }
1180
1181 static v8::Handle<v8::Value> addEventListenerCallback(const v8::Arguments& args)
1182 {
1183     INC_STATS("DOM.TestObj.addEventListener()");
1184     RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(args[1], false, ListenerFindOrCreate);
1185     if (listener) {
1186         V8TestObj::toNative(args.Holder())->addEventListener(v8ValueToAtomicWebCoreString(args[0]), listener, args[2]->BooleanValue());
1187         createHiddenDependency(args.Holder(), args[1], V8TestObj::eventListenerCacheIndex);
1188     }
1189     return v8::Undefined();
1190 }
1191
1192 static v8::Handle<v8::Value> removeEventListenerCallback(const v8::Arguments& args)
1193 {
1194     INC_STATS("DOM.TestObj.removeEventListener()");
1195     RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(args[1], false, ListenerFindOnly);
1196     if (listener) {
1197         V8TestObj::toNative(args.Holder())->removeEventListener(v8ValueToAtomicWebCoreString(args[0]), listener.get(), args[2]->BooleanValue());
1198         removeHiddenDependency(args.Holder(), args[1], V8TestObj::eventListenerCacheIndex);
1199     }
1200     return v8::Undefined();
1201 }
1202
1203 static v8::Handle<v8::Value> withScriptStateVoidCallback(const v8::Arguments& args)
1204 {
1205     INC_STATS("DOM.TestObj.withScriptStateVoid");
1206     TestObj* imp = V8TestObj::toNative(args.Holder());
1207     EmptyScriptState state;
1208     imp->withScriptStateVoid(&state);
1209     if (state.hadException())
1210         return throwError(state.exception());
1211     return v8::Handle<v8::Value>();
1212 }
1213
1214 static v8::Handle<v8::Value> withScriptStateObjCallback(const v8::Arguments& args)
1215 {
1216     INC_STATS("DOM.TestObj.withScriptStateObj");
1217     TestObj* imp = V8TestObj::toNative(args.Holder());
1218     EmptyScriptState state;
1219     RefPtr<TestObj> result = imp->withScriptStateObj(&state);
1220     if (state.hadException())
1221         return throwError(state.exception());
1222     return toV8(result.release());
1223 }
1224
1225 static v8::Handle<v8::Value> withScriptStateVoidExceptionCallback(const v8::Arguments& args)
1226 {
1227     INC_STATS("DOM.TestObj.withScriptStateVoidException");
1228     TestObj* imp = V8TestObj::toNative(args.Holder());
1229     ExceptionCode ec = 0;
1230     {
1231     EmptyScriptState state;
1232     imp->withScriptStateVoidException(&state, ec);
1233     if (UNLIKELY(ec))
1234         goto fail;
1235     if (state.hadException())
1236         return throwError(state.exception());
1237     return v8::Handle<v8::Value>();
1238     }
1239     fail:
1240     V8Proxy::setDOMException(ec);
1241     return v8::Handle<v8::Value>();
1242 }
1243
1244 static v8::Handle<v8::Value> withScriptStateObjExceptionCallback(const v8::Arguments& args)
1245 {
1246     INC_STATS("DOM.TestObj.withScriptStateObjException");
1247     TestObj* imp = V8TestObj::toNative(args.Holder());
1248     ExceptionCode ec = 0;
1249     {
1250     EmptyScriptState state;
1251     RefPtr<TestObj> result = imp->withScriptStateObjException(&state, ec);
1252     if (UNLIKELY(ec))
1253         goto fail;
1254     if (state.hadException())
1255         return throwError(state.exception());
1256     return toV8(result.release());
1257     }
1258     fail:
1259     V8Proxy::setDOMException(ec);
1260     return v8::Handle<v8::Value>();
1261 }
1262
1263 static v8::Handle<v8::Value> withScriptExecutionContextCallback(const v8::Arguments& args)
1264 {
1265     INC_STATS("DOM.TestObj.withScriptExecutionContext");
1266     TestObj* imp = V8TestObj::toNative(args.Holder());
1267     ScriptExecutionContext* scriptContext = getScriptExecutionContext();
1268     if (!scriptContext)
1269         return v8::Undefined();
1270     imp->withScriptExecutionContext(scriptContext);
1271     return v8::Handle<v8::Value>();
1272 }
1273
1274 static v8::Handle<v8::Value> withScriptExecutionContextAndScriptStateCallback(const v8::Arguments& args)
1275 {
1276     INC_STATS("DOM.TestObj.withScriptExecutionContextAndScriptState");
1277     TestObj* imp = V8TestObj::toNative(args.Holder());
1278     EmptyScriptState state;
1279     ScriptExecutionContext* scriptContext = getScriptExecutionContext();
1280     if (!scriptContext)
1281         return v8::Undefined();
1282     imp->withScriptExecutionContextAndScriptState(&state, scriptContext);
1283     if (state.hadException())
1284         return throwError(state.exception());
1285     return v8::Handle<v8::Value>();
1286 }
1287
1288 static v8::Handle<v8::Value> withScriptExecutionContextAndScriptStateObjExceptionCallback(const v8::Arguments& args)
1289 {
1290     INC_STATS("DOM.TestObj.withScriptExecutionContextAndScriptStateObjException");
1291     TestObj* imp = V8TestObj::toNative(args.Holder());
1292     ExceptionCode ec = 0;
1293     {
1294     EmptyScriptState state;
1295     ScriptExecutionContext* scriptContext = getScriptExecutionContext();
1296     if (!scriptContext)
1297         return v8::Undefined();
1298     RefPtr<TestObj> result = imp->withScriptExecutionContextAndScriptStateObjException(&state, scriptContext, ec);
1299     if (UNLIKELY(ec))
1300         goto fail;
1301     if (state.hadException())
1302         return throwError(state.exception());
1303     return toV8(result.release());
1304     }
1305     fail:
1306     V8Proxy::setDOMException(ec);
1307     return v8::Handle<v8::Value>();
1308 }
1309
1310 static v8::Handle<v8::Value> withScriptExecutionContextAndScriptStateWithSpacesCallback(const v8::Arguments& args)
1311 {
1312     INC_STATS("DOM.TestObj.withScriptExecutionContextAndScriptStateWithSpaces");
1313     TestObj* imp = V8TestObj::toNative(args.Holder());
1314     EmptyScriptState state;
1315     ScriptExecutionContext* scriptContext = getScriptExecutionContext();
1316     if (!scriptContext)
1317         return v8::Undefined();
1318     RefPtr<TestObj> result = imp->withScriptExecutionContextAndScriptStateWithSpaces(&state, scriptContext);
1319     if (state.hadException())
1320         return throwError(state.exception());
1321     return toV8(result.release());
1322 }
1323
1324 static v8::Handle<v8::Value> withScriptArgumentsAndCallStackCallback(const v8::Arguments& args)
1325 {
1326     INC_STATS("DOM.TestObj.withScriptArgumentsAndCallStack");
1327     TestObj* imp = V8TestObj::toNative(args.Holder());
1328     RefPtr<ScriptArguments> scriptArguments(createScriptArguments(args, 0));
1329     RefPtr<ScriptCallStack> callStack(createScriptCallStackForInspector());
1330     if (!callStack)
1331         return v8::Undefined();
1332     imp->withScriptArgumentsAndCallStack(scriptArguments, callStack);
1333     return v8::Handle<v8::Value>();
1334 }
1335
1336 static v8::Handle<v8::Value> methodWithOptionalArgCallback(const v8::Arguments& args)
1337 {
1338     INC_STATS("DOM.TestObj.methodWithOptionalArg");
1339     TestObj* imp = V8TestObj::toNative(args.Holder());
1340     if (args.Length() <= 0) {
1341         imp->methodWithOptionalArg();
1342         return v8::Handle<v8::Value>();
1343     }
1344     EXCEPTION_BLOCK(int, opt, toInt32(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)));
1345     imp->methodWithOptionalArg(opt);
1346     return v8::Handle<v8::Value>();
1347 }
1348
1349 static v8::Handle<v8::Value> methodWithNonOptionalArgAndOptionalArgCallback(const v8::Arguments& args)
1350 {
1351     INC_STATS("DOM.TestObj.methodWithNonOptionalArgAndOptionalArg");
1352     if (args.Length() < 1)
1353         return throwError("Not enough arguments", V8Proxy::TypeError);
1354     TestObj* imp = V8TestObj::toNative(args.Holder());
1355     EXCEPTION_BLOCK(int, nonOpt, toInt32(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)));
1356     if (args.Length() <= 1) {
1357         imp->methodWithNonOptionalArgAndOptionalArg(nonOpt);
1358         return v8::Handle<v8::Value>();
1359     }
1360     EXCEPTION_BLOCK(int, opt, toInt32(MAYBE_MISSING_PARAMETER(args, 1, DefaultIsUndefined)));
1361     imp->methodWithNonOptionalArgAndOptionalArg(nonOpt, opt);
1362     return v8::Handle<v8::Value>();
1363 }
1364
1365 static v8::Handle<v8::Value> methodWithNonOptionalArgAndTwoOptionalArgsCallback(const v8::Arguments& args)
1366 {
1367     INC_STATS("DOM.TestObj.methodWithNonOptionalArgAndTwoOptionalArgs");
1368     if (args.Length() < 1)
1369         return throwError("Not enough arguments", V8Proxy::TypeError);
1370     TestObj* imp = V8TestObj::toNative(args.Holder());
1371     EXCEPTION_BLOCK(int, nonOpt, toInt32(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)));
1372     if (args.Length() <= 1) {
1373         imp->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt);
1374         return v8::Handle<v8::Value>();
1375     }
1376     EXCEPTION_BLOCK(int, opt1, toInt32(MAYBE_MISSING_PARAMETER(args, 1, DefaultIsUndefined)));
1377     if (args.Length() <= 2) {
1378         imp->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt, opt1);
1379         return v8::Handle<v8::Value>();
1380     }
1381     EXCEPTION_BLOCK(int, opt2, toInt32(MAYBE_MISSING_PARAMETER(args, 2, DefaultIsUndefined)));
1382     imp->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt, opt1, opt2);
1383     return v8::Handle<v8::Value>();
1384 }
1385
1386 static v8::Handle<v8::Value> methodWithOptionalStringCallback(const v8::Arguments& args)
1387 {
1388     INC_STATS("DOM.TestObj.methodWithOptionalString");
1389     TestObj* imp = V8TestObj::toNative(args.Holder());
1390     if (args.Length() <= 0) {
1391         imp->methodWithOptionalString();
1392         return v8::Handle<v8::Value>();
1393     }
1394     STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, str, MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined));
1395     imp->methodWithOptionalString(str);
1396     return v8::Handle<v8::Value>();
1397 }
1398
1399 static v8::Handle<v8::Value> methodWithOptionalStringIsUndefinedCallback(const v8::Arguments& args)
1400 {
1401     INC_STATS("DOM.TestObj.methodWithOptionalStringIsUndefined");
1402     TestObj* imp = V8TestObj::toNative(args.Holder());
1403     STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, str, MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined));
1404     imp->methodWithOptionalStringIsUndefined(str);
1405     return v8::Handle<v8::Value>();
1406 }
1407
1408 static v8::Handle<v8::Value> methodWithOptionalStringIsNullStringCallback(const v8::Arguments& args)
1409 {
1410     INC_STATS("DOM.TestObj.methodWithOptionalStringIsNullString");
1411     TestObj* imp = V8TestObj::toNative(args.Holder());
1412     STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, str, MAYBE_MISSING_PARAMETER(args, 0, DefaultIsNullString));
1413     imp->methodWithOptionalStringIsNullString(str);
1414     return v8::Handle<v8::Value>();
1415 }
1416
1417 static v8::Handle<v8::Value> methodWithCallbackArgCallback(const v8::Arguments& args)
1418 {
1419     INC_STATS("DOM.TestObj.methodWithCallbackArg");
1420     if (args.Length() < 1)
1421         return throwError("Not enough arguments", V8Proxy::TypeError);
1422     TestObj* imp = V8TestObj::toNative(args.Holder());
1423     if (args.Length() <= 0 || !args[0]->IsFunction())
1424         return throwError(TYPE_MISMATCH_ERR);
1425     RefPtr<TestCallback> callback = V8TestCallback::create(args[0], getScriptExecutionContext());
1426     imp->methodWithCallbackArg(callback);
1427     return v8::Handle<v8::Value>();
1428 }
1429
1430 static v8::Handle<v8::Value> methodWithNonCallbackArgAndCallbackArgCallback(const v8::Arguments& args)
1431 {
1432     INC_STATS("DOM.TestObj.methodWithNonCallbackArgAndCallbackArg");
1433     if (args.Length() < 2)
1434         return throwError("Not enough arguments", V8Proxy::TypeError);
1435     TestObj* imp = V8TestObj::toNative(args.Holder());
1436     EXCEPTION_BLOCK(int, nonCallback, toInt32(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)));
1437     if (args.Length() <= 1 || !args[1]->IsFunction())
1438         return throwError(TYPE_MISMATCH_ERR);
1439     RefPtr<TestCallback> callback = V8TestCallback::create(args[1], getScriptExecutionContext());
1440     imp->methodWithNonCallbackArgAndCallbackArg(nonCallback, callback);
1441     return v8::Handle<v8::Value>();
1442 }
1443
1444 static v8::Handle<v8::Value> methodWithCallbackAndOptionalArgCallback(const v8::Arguments& args)
1445 {
1446     INC_STATS("DOM.TestObj.methodWithCallbackAndOptionalArg");
1447     TestObj* imp = V8TestObj::toNative(args.Holder());
1448     RefPtr<TestCallback> callback;
1449     if (args.Length() > 0 && !args[0]->IsNull() && !args[0]->IsUndefined()) {
1450         if (!args[0]->IsFunction())
1451             return throwError(TYPE_MISMATCH_ERR);
1452         callback = V8TestCallback::create(args[0], getScriptExecutionContext());
1453     }
1454     imp->methodWithCallbackAndOptionalArg(callback);
1455     return v8::Handle<v8::Value>();
1456 }
1457
1458 #if ENABLE(Condition1)
1459
1460 static v8::Handle<v8::Value> conditionalMethod1Callback(const v8::Arguments& args)
1461 {
1462     INC_STATS("DOM.TestObj.conditionalMethod1");
1463     TestObj* imp = V8TestObj::toNative(args.Holder());
1464     return v8String(imp->conditionalMethod1());
1465 }
1466
1467 #endif // ENABLE(Condition1)
1468
1469 #if ENABLE(Condition1) && ENABLE(Condition2)
1470
1471 static v8::Handle<v8::Value> conditionalMethod2Callback(const v8::Arguments& args)
1472 {
1473     INC_STATS("DOM.TestObj.conditionalMethod2");
1474     TestObj* imp = V8TestObj::toNative(args.Holder());
1475     imp->conditionalMethod2();
1476     return v8::Handle<v8::Value>();
1477 }
1478
1479 #endif // ENABLE(Condition1) && ENABLE(Condition2)
1480
1481 #if ENABLE(Condition1) || ENABLE(Condition2)
1482
1483 static v8::Handle<v8::Value> conditionalMethod3Callback(const v8::Arguments& args)
1484 {
1485     INC_STATS("DOM.TestObj.conditionalMethod3");
1486     TestObj* imp = V8TestObj::toNative(args.Holder());
1487     imp->conditionalMethod3();
1488     return v8::Handle<v8::Value>();
1489 }
1490
1491 #endif // ENABLE(Condition1) || ENABLE(Condition2)
1492
1493 static v8::Handle<v8::Value> overloadedMethod1Callback(const v8::Arguments& args)
1494 {
1495     INC_STATS("DOM.TestObj.overloadedMethod1");
1496     if (args.Length() < 2)
1497         return throwError("Not enough arguments", V8Proxy::TypeError);
1498     TestObj* imp = V8TestObj::toNative(args.Holder());
1499     EXCEPTION_BLOCK(TestObj*, objArg, V8TestObj::HasInstance(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined))) : 0);
1500     STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, strArg, MAYBE_MISSING_PARAMETER(args, 1, DefaultIsUndefined));
1501     imp->overloadedMethod(objArg, strArg);
1502     return v8::Handle<v8::Value>();
1503 }
1504
1505 static v8::Handle<v8::Value> overloadedMethod2Callback(const v8::Arguments& args)
1506 {
1507     INC_STATS("DOM.TestObj.overloadedMethod2");
1508     if (args.Length() < 1)
1509         return throwError("Not enough arguments", V8Proxy::TypeError);
1510     TestObj* imp = V8TestObj::toNative(args.Holder());
1511     EXCEPTION_BLOCK(TestObj*, objArg, V8TestObj::HasInstance(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined))) : 0);
1512     if (args.Length() <= 1) {
1513         imp->overloadedMethod(objArg);
1514         return v8::Handle<v8::Value>();
1515     }
1516     EXCEPTION_BLOCK(int, intArg, toInt32(MAYBE_MISSING_PARAMETER(args, 1, DefaultIsUndefined)));
1517     imp->overloadedMethod(objArg, intArg);
1518     return v8::Handle<v8::Value>();
1519 }
1520
1521 static v8::Handle<v8::Value> overloadedMethod3Callback(const v8::Arguments& args)
1522 {
1523     INC_STATS("DOM.TestObj.overloadedMethod3");
1524     if (args.Length() < 1)
1525         return throwError("Not enough arguments", V8Proxy::TypeError);
1526     TestObj* imp = V8TestObj::toNative(args.Holder());
1527     STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, strArg, MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined));
1528     imp->overloadedMethod(strArg);
1529     return v8::Handle<v8::Value>();
1530 }
1531
1532 static v8::Handle<v8::Value> overloadedMethod4Callback(const v8::Arguments& args)
1533 {
1534     INC_STATS("DOM.TestObj.overloadedMethod4");
1535     if (args.Length() < 1)
1536         return throwError("Not enough arguments", V8Proxy::TypeError);
1537     TestObj* imp = V8TestObj::toNative(args.Holder());
1538     EXCEPTION_BLOCK(int, intArg, toInt32(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)));
1539     imp->overloadedMethod(intArg);
1540     return v8::Handle<v8::Value>();
1541 }
1542
1543 static v8::Handle<v8::Value> overloadedMethod5Callback(const v8::Arguments& args)
1544 {
1545     INC_STATS("DOM.TestObj.overloadedMethod5");
1546     if (args.Length() < 1)
1547         return throwError("Not enough arguments", V8Proxy::TypeError);
1548     TestObj* imp = V8TestObj::toNative(args.Holder());
1549     if (args.Length() <= 0 || !args[0]->IsFunction())
1550         return throwError(TYPE_MISMATCH_ERR);
1551     RefPtr<TestCallback> callback = V8TestCallback::create(args[0], getScriptExecutionContext());
1552     imp->overloadedMethod(callback);
1553     return v8::Handle<v8::Value>();
1554 }
1555
1556 static v8::Handle<v8::Value> overloadedMethod6Callback(const v8::Arguments& args)
1557 {
1558     INC_STATS("DOM.TestObj.overloadedMethod6");
1559     if (args.Length() < 1)
1560         return throwError("Not enough arguments", V8Proxy::TypeError);
1561     TestObj* imp = V8TestObj::toNative(args.Holder());
1562     EXCEPTION_BLOCK(RefPtr<DOMStringList>, listArg, v8ValueToWebCoreDOMStringList(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)));
1563     imp->overloadedMethod(listArg);
1564     return v8::Handle<v8::Value>();
1565 }
1566
1567 static v8::Handle<v8::Value> overloadedMethod7Callback(const v8::Arguments& args)
1568 {
1569     INC_STATS("DOM.TestObj.overloadedMethod7");
1570     if (args.Length() < 1)
1571         return throwError("Not enough arguments", V8Proxy::TypeError);
1572     TestObj* imp = V8TestObj::toNative(args.Holder());
1573     EXCEPTION_BLOCK(RefPtr<DOMStringList>, arrayArg, v8ValueToWebCoreDOMStringList(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)));
1574     imp->overloadedMethod(arrayArg);
1575     return v8::Handle<v8::Value>();
1576 }
1577
1578 static v8::Handle<v8::Value> overloadedMethodCallback(const v8::Arguments& args)
1579 {
1580     INC_STATS("DOM.TestObj.overloadedMethod");
1581     if ((args.Length() == 2 && (args[0]->IsNull() || V8TestObj::HasInstance(args[0])) && (args[1]->IsNull() || args[1]->IsUndefined() || args[1]->IsString() || args[1]->IsObject())))
1582         return overloadedMethod1Callback(args);
1583     if ((args.Length() == 1 && (args[0]->IsNull() || V8TestObj::HasInstance(args[0]))) || (args.Length() == 2 && (args[0]->IsNull() || V8TestObj::HasInstance(args[0]))))
1584         return overloadedMethod2Callback(args);
1585     if ((args.Length() == 1 && (args[0]->IsNull() || args[0]->IsUndefined() || args[0]->IsString() || args[0]->IsObject())))
1586         return overloadedMethod3Callback(args);
1587     if (args.Length() == 1)
1588         return overloadedMethod4Callback(args);
1589     if ((args.Length() == 1 && (args[0]->IsNull() || args[0]->IsFunction())))
1590         return overloadedMethod5Callback(args);
1591     if ((args.Length() == 1 && (args[0]->IsNull() || V8DOMStringList::HasInstance(args[0]))))
1592         return overloadedMethod6Callback(args);
1593     if ((args.Length() == 1 && (args[0]->IsNull() || args[0]->IsArray())))
1594         return overloadedMethod7Callback(args);
1595     V8Proxy::throwTypeError();
1596     return notHandledByInterceptor();
1597 }
1598
1599 static v8::Handle<v8::Value> classMethodCallback(const v8::Arguments& args)
1600 {
1601     INC_STATS("DOM.TestObj.classMethod");
1602     TestObj::classMethod();
1603     return v8::Handle<v8::Value>();
1604 }
1605
1606 static v8::Handle<v8::Value> classMethodWithOptionalCallback(const v8::Arguments& args)
1607 {
1608     INC_STATS("DOM.TestObj.classMethodWithOptional");
1609     if (args.Length() <= 0) {
1610         return v8::Integer::New(TestObj::classMethodWithOptional());
1611     }
1612     EXCEPTION_BLOCK(int, arg, toInt32(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)));
1613     return v8::Integer::New(TestObj::classMethodWithOptional(arg));
1614 }
1615
1616 #if ENABLE(Condition1)
1617
1618 static v8::Handle<v8::Value> overloadedMethod11Callback(const v8::Arguments& args)
1619 {
1620     INC_STATS("DOM.TestObj.overloadedMethod11");
1621     if (args.Length() < 1)
1622         return throwError("Not enough arguments", V8Proxy::TypeError);
1623     EXCEPTION_BLOCK(int, arg, toInt32(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)));
1624     TestObj::overloadedMethod1(arg);
1625     return v8::Handle<v8::Value>();
1626 }
1627
1628 #endif // ENABLE(Condition1)
1629
1630 #if ENABLE(Condition1)
1631
1632 static v8::Handle<v8::Value> overloadedMethod12Callback(const v8::Arguments& args)
1633 {
1634     INC_STATS("DOM.TestObj.overloadedMethod12");
1635     if (args.Length() < 1)
1636         return throwError("Not enough arguments", V8Proxy::TypeError);
1637     STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, type, MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined));
1638     TestObj::overloadedMethod1(type);
1639     return v8::Handle<v8::Value>();
1640 }
1641
1642 #endif // ENABLE(Condition1)
1643
1644 #if ENABLE(Condition1)
1645
1646 static v8::Handle<v8::Value> overloadedMethod1Callback(const v8::Arguments& args)
1647 {
1648     INC_STATS("DOM.TestObj.overloadedMethod1");
1649     if (args.Length() == 1)
1650         return overloadedMethod11Callback(args);
1651     if ((args.Length() == 1 && (args[0]->IsNull() || args[0]->IsUndefined() || args[0]->IsString() || args[0]->IsObject())))
1652         return overloadedMethod12Callback(args);
1653     V8Proxy::throwTypeError();
1654     return notHandledByInterceptor();
1655 }
1656
1657 #endif // ENABLE(Condition1)
1658
1659 static v8::Handle<v8::Value> enabledAtRuntimeMethod1Callback(const v8::Arguments& args)
1660 {
1661     INC_STATS("DOM.TestObj.enabledAtRuntimeMethod1");
1662     if (args.Length() < 1)
1663         return throwError("Not enough arguments", V8Proxy::TypeError);
1664     TestObj* imp = V8TestObj::toNative(args.Holder());
1665     EXCEPTION_BLOCK(int, intArg, V8int::HasInstance(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)) ? V8int::toNative(v8::Handle<v8::Object>::Cast(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined))) : 0);
1666     imp->enabledAtRuntimeMethod1(intArg);
1667     return v8::Handle<v8::Value>();
1668 }
1669
1670 static v8::Handle<v8::Value> enabledAtRuntimeMethod2Callback(const v8::Arguments& args)
1671 {
1672     INC_STATS("DOM.TestObj.enabledAtRuntimeMethod2");
1673     if (args.Length() < 1)
1674         return throwError("Not enough arguments", V8Proxy::TypeError);
1675     TestObj* imp = V8TestObj::toNative(args.Holder());
1676     EXCEPTION_BLOCK(int, intArg, V8int::HasInstance(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)) ? V8int::toNative(v8::Handle<v8::Object>::Cast(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined))) : 0);
1677     imp->enabledAtRuntimeMethod2(intArg);
1678     return v8::Handle<v8::Value>();
1679 }
1680
1681 static v8::Handle<v8::Value> getSVGDocumentCallback(const v8::Arguments& args)
1682 {
1683     INC_STATS("DOM.TestObj.getSVGDocument");
1684     TestObj* imp = V8TestObj::toNative(args.Holder());
1685     ExceptionCode ec = 0;
1686     {
1687     if (!V8BindingSecurity::shouldAllowAccessToNode(V8BindingState::Only(), imp->getSVGDocument(ec)))
1688         return v8::Handle<v8::Value>(v8::Null());
1689     RefPtr<SVGDocument> result = imp->getSVGDocument(ec);
1690     if (UNLIKELY(ec))
1691         goto fail;
1692     return toV8(result.release());
1693     }
1694     fail:
1695     V8Proxy::setDOMException(ec);
1696     return v8::Handle<v8::Value>();
1697 }
1698
1699 static v8::Handle<v8::Value> convert1Callback(const v8::Arguments& args)
1700 {
1701     INC_STATS("DOM.TestObj.convert1");
1702     if (args.Length() < 1)
1703         return throwError("Not enough arguments", V8Proxy::TypeError);
1704     TestObj* imp = V8TestObj::toNative(args.Holder());
1705     EXCEPTION_BLOCK(a*, , V8a::HasInstance(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)) ? V8a::toNative(v8::Handle<v8::Object>::Cast(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined))) : 0);
1706     imp->convert1();
1707     return v8::Handle<v8::Value>();
1708 }
1709
1710 static v8::Handle<v8::Value> convert2Callback(const v8::Arguments& args)
1711 {
1712     INC_STATS("DOM.TestObj.convert2");
1713     if (args.Length() < 1)
1714         return throwError("Not enough arguments", V8Proxy::TypeError);
1715     TestObj* imp = V8TestObj::toNative(args.Holder());
1716     EXCEPTION_BLOCK(b*, , V8b::HasInstance(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)) ? V8b::toNative(v8::Handle<v8::Object>::Cast(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined))) : 0);
1717     imp->convert2();
1718     return v8::Handle<v8::Value>();
1719 }
1720
1721 static v8::Handle<v8::Value> convert3Callback(const v8::Arguments& args)
1722 {
1723     INC_STATS("DOM.TestObj.convert3");
1724     if (args.Length() < 1)
1725         return throwError("Not enough arguments", V8Proxy::TypeError);
1726     TestObj* imp = V8TestObj::toNative(args.Holder());
1727     EXCEPTION_BLOCK(c*, , V8c::HasInstance(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)) ? V8c::toNative(v8::Handle<v8::Object>::Cast(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined))) : 0);
1728     imp->convert3();
1729     return v8::Handle<v8::Value>();
1730 }
1731
1732 static v8::Handle<v8::Value> convert4Callback(const v8::Arguments& args)
1733 {
1734     INC_STATS("DOM.TestObj.convert4");
1735     if (args.Length() < 1)
1736         return throwError("Not enough arguments", V8Proxy::TypeError);
1737     TestObj* imp = V8TestObj::toNative(args.Holder());
1738     EXCEPTION_BLOCK(d*, , V8d::HasInstance(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)) ? V8d::toNative(v8::Handle<v8::Object>::Cast(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined))) : 0);
1739     imp->convert4();
1740     return v8::Handle<v8::Value>();
1741 }
1742
1743 static v8::Handle<v8::Value> convert5Callback(const v8::Arguments& args)
1744 {
1745     INC_STATS("DOM.TestObj.convert5");
1746     if (args.Length() < 1)
1747         return throwError("Not enough arguments", V8Proxy::TypeError);
1748     TestObj* imp = V8TestObj::toNative(args.Holder());
1749     EXCEPTION_BLOCK(e*, , V8e::HasInstance(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)) ? V8e::toNative(v8::Handle<v8::Object>::Cast(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined))) : 0);
1750     imp->convert5();
1751     return v8::Handle<v8::Value>();
1752 }
1753
1754 static v8::Handle<v8::Value> mutablePointFunctionCallback(const v8::Arguments& args)
1755 {
1756     INC_STATS("DOM.TestObj.mutablePointFunction");
1757     TestObj* imp = V8TestObj::toNative(args.Holder());
1758     return toV8(WTF::getPtr(SVGPropertyTearOff<FloatPoint>::create(imp->mutablePointFunction())));
1759 }
1760
1761 static v8::Handle<v8::Value> immutablePointFunctionCallback(const v8::Arguments& args)
1762 {
1763     INC_STATS("DOM.TestObj.immutablePointFunction");
1764     TestObj* imp = V8TestObj::toNative(args.Holder());
1765     return toV8(WTF::getPtr(SVGPropertyTearOff<FloatPoint>::create(imp->immutablePointFunction())));
1766 }
1767
1768 static v8::Handle<v8::Value> orangeCallback(const v8::Arguments& args)
1769 {
1770     INC_STATS("DOM.TestObj.orange");
1771     TestObj* imp = V8TestObj::toNative(args.Holder());
1772     imp->banana();
1773     return v8::Handle<v8::Value>();
1774 }
1775
1776 static v8::Handle<v8::Value> strictFunctionCallback(const v8::Arguments& args)
1777 {
1778     INC_STATS("DOM.TestObj.strictFunction");
1779     if (args.Length() < 3)
1780         return throwError("Not enough arguments", V8Proxy::TypeError);
1781     TestObj* imp = V8TestObj::toNative(args.Holder());
1782     ExceptionCode ec = 0;
1783     {
1784     STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, str, MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined));
1785     EXCEPTION_BLOCK(float, a, static_cast<float>(MAYBE_MISSING_PARAMETER(args, 1, DefaultIsUndefined)->NumberValue()));
1786     EXCEPTION_BLOCK(int, b, V8int::HasInstance(MAYBE_MISSING_PARAMETER(args, 2, DefaultIsUndefined)) ? V8int::toNative(v8::Handle<v8::Object>::Cast(MAYBE_MISSING_PARAMETER(args, 2, DefaultIsUndefined))) : 0);
1787     RefPtr<bool> result = imp->strictFunction(str, a, b, ec);
1788     if (UNLIKELY(ec))
1789         goto fail;
1790     return toV8(result.release());
1791     }
1792     fail:
1793     V8Proxy::setDOMException(ec);
1794     return v8::Handle<v8::Value>();
1795 }
1796
1797 } // namespace TestObjInternal
1798
1799 static const BatchedAttribute TestObjAttrs[] = {
1800     // Attribute 'readOnlyIntAttr' (Type: 'readonly attribute' ExtAttr: '')
1801     {"readOnlyIntAttr", TestObjInternal::readOnlyIntAttrAttrGetter, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1802     // Attribute 'readOnlyStringAttr' (Type: 'readonly attribute' ExtAttr: '')
1803     {"readOnlyStringAttr", TestObjInternal::readOnlyStringAttrAttrGetter, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1804     // Attribute 'readOnlyTestObjAttr' (Type: 'readonly attribute' ExtAttr: '')
1805     {"readOnlyTestObjAttr", TestObjInternal::readOnlyTestObjAttrAttrGetter, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1806     // Attribute 'shortAttr' (Type: 'attribute' ExtAttr: '')
1807     {"shortAttr", TestObjInternal::shortAttrAttrGetter, TestObjInternal::shortAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1808     // Attribute 'unsignedShortAttr' (Type: 'attribute' ExtAttr: '')
1809     {"unsignedShortAttr", TestObjInternal::unsignedShortAttrAttrGetter, TestObjInternal::unsignedShortAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1810     // Attribute 'intAttr' (Type: 'attribute' ExtAttr: '')
1811     {"intAttr", TestObjInternal::intAttrAttrGetter, TestObjInternal::intAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1812     // Attribute 'longLongAttr' (Type: 'attribute' ExtAttr: '')
1813     {"longLongAttr", TestObjInternal::longLongAttrAttrGetter, TestObjInternal::longLongAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1814     // Attribute 'unsignedLongLongAttr' (Type: 'attribute' ExtAttr: '')
1815     {"unsignedLongLongAttr", TestObjInternal::unsignedLongLongAttrAttrGetter, TestObjInternal::unsignedLongLongAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1816     // Attribute 'stringAttr' (Type: 'attribute' ExtAttr: '')
1817     {"stringAttr", TestObjInternal::stringAttrAttrGetter, TestObjInternal::stringAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1818     // Attribute 'testObjAttr' (Type: 'attribute' ExtAttr: '')
1819     {"testObjAttr", TestObjInternal::testObjAttrAttrGetter, TestObjInternal::testObjAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1820     // Attribute 'sequenceAttr' (Type: 'attribute' ExtAttr: '')
1821     {"sequenceAttr", TestObjInternal::sequenceAttrAttrGetter, TestObjInternal::sequenceAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1822     // Attribute 'XMLObjAttr' (Type: 'attribute' ExtAttr: '')
1823     {"XMLObjAttr", TestObjInternal::XMLObjAttrAttrGetter, TestObjInternal::XMLObjAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1824     // Attribute 'create' (Type: 'attribute' ExtAttr: '')
1825     {"create", TestObjInternal::createAttrGetter, TestObjInternal::createAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1826     // Attribute 'reflectedStringAttr' (Type: 'attribute' ExtAttr: 'Reflect')
1827     {"reflectedStringAttr", TestObjInternal::reflectedStringAttrAttrGetter, TestObjInternal::reflectedStringAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1828     // Attribute 'reflectedIntegralAttr' (Type: 'attribute' ExtAttr: 'Reflect')
1829     {"reflectedIntegralAttr", TestObjInternal::reflectedIntegralAttrAttrGetter, TestObjInternal::reflectedIntegralAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1830     // Attribute 'reflectedUnsignedIntegralAttr' (Type: 'attribute' ExtAttr: 'Reflect')
1831     {"reflectedUnsignedIntegralAttr", TestObjInternal::reflectedUnsignedIntegralAttrAttrGetter, TestObjInternal::reflectedUnsignedIntegralAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1832     // Attribute 'reflectedBooleanAttr' (Type: 'attribute' ExtAttr: 'Reflect')
1833     {"reflectedBooleanAttr", TestObjInternal::reflectedBooleanAttrAttrGetter, TestObjInternal::reflectedBooleanAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1834     // Attribute 'reflectedURLAttr' (Type: 'attribute' ExtAttr: 'URL Reflect')
1835     {"reflectedURLAttr", TestObjInternal::reflectedURLAttrAttrGetter, TestObjInternal::reflectedURLAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1836     // Attribute 'reflectedStringAttr' (Type: 'attribute' ExtAttr: 'Reflect')
1837     {"reflectedStringAttr", TestObjInternal::reflectedStringAttrAttrGetter, TestObjInternal::reflectedStringAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1838     // Attribute 'reflectedCustomIntegralAttr' (Type: 'attribute' ExtAttr: 'Reflect')
1839     {"reflectedCustomIntegralAttr", TestObjInternal::reflectedCustomIntegralAttrAttrGetter, TestObjInternal::reflectedCustomIntegralAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1840     // Attribute 'reflectedCustomBooleanAttr' (Type: 'attribute' ExtAttr: 'Reflect')
1841     {"reflectedCustomBooleanAttr", TestObjInternal::reflectedCustomBooleanAttrAttrGetter, TestObjInternal::reflectedCustomBooleanAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1842     // Attribute 'reflectedCustomURLAttr' (Type: 'attribute' ExtAttr: 'URL Reflect')
1843     {"reflectedCustomURLAttr", TestObjInternal::reflectedCustomURLAttrAttrGetter, TestObjInternal::reflectedCustomURLAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1844     // Attribute 'attrWithGetterException' (Type: 'attribute' ExtAttr: '')
1845     {"attrWithGetterException", TestObjInternal::attrWithGetterExceptionAttrGetter, TestObjInternal::attrWithGetterExceptionAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1846     // Attribute 'attrWithSetterException' (Type: 'attribute' ExtAttr: '')
1847     {"attrWithSetterException", TestObjInternal::attrWithSetterExceptionAttrGetter, TestObjInternal::attrWithSetterExceptionAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1848     // Attribute 'stringAttrWithGetterException' (Type: 'attribute' ExtAttr: '')
1849     {"stringAttrWithGetterException", TestObjInternal::stringAttrWithGetterExceptionAttrGetter, TestObjInternal::stringAttrWithGetterExceptionAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1850     // Attribute 'stringAttrWithSetterException' (Type: 'attribute' ExtAttr: '')
1851     {"stringAttrWithSetterException", TestObjInternal::stringAttrWithSetterExceptionAttrGetter, TestObjInternal::stringAttrWithSetterExceptionAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1852     // Attribute 'customAttr' (Type: 'attribute' ExtAttr: 'Custom')
1853     {"customAttr", V8TestObj::customAttrAccessorGetter, V8TestObj::customAttrAccessorSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1854     // Attribute 'withScriptStateAttribute' (Type: 'attribute' ExtAttr: 'CallWith')
1855     {"withScriptStateAttribute", TestObjInternal::withScriptStateAttributeAttrGetter, TestObjInternal::withScriptStateAttributeAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1856     // Attribute 'withScriptExecutionContextAttribute' (Type: 'attribute' ExtAttr: 'CallWith')
1857     {"withScriptExecutionContextAttribute", TestObjInternal::withScriptExecutionContextAttributeAttrGetter, TestObjInternal::withScriptExecutionContextAttributeAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1858     // Attribute 'withScriptStateAttributeRaises' (Type: 'attribute' ExtAttr: 'CallWith')
1859     {"withScriptStateAttributeRaises", TestObjInternal::withScriptStateAttributeRaisesAttrGetter, TestObjInternal::withScriptStateAttributeRaisesAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1860     // Attribute 'withScriptExecutionContextAttributeRaises' (Type: 'attribute' ExtAttr: 'CallWith')
1861     {"withScriptExecutionContextAttributeRaises", TestObjInternal::withScriptExecutionContextAttributeRaisesAttrGetter, TestObjInternal::withScriptExecutionContextAttributeRaisesAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1862     // Attribute 'withScriptExecutionContextAndScriptStateAttribute' (Type: 'attribute' ExtAttr: 'CallWith')
1863     {"withScriptExecutionContextAndScriptStateAttribute", TestObjInternal::withScriptExecutionContextAndScriptStateAttributeAttrGetter, TestObjInternal::withScriptExecutionContextAndScriptStateAttributeAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1864     // Attribute 'withScriptExecutionContextAndScriptStateAttributeRaises' (Type: 'attribute' ExtAttr: 'CallWith')
1865     {"withScriptExecutionContextAndScriptStateAttributeRaises", TestObjInternal::withScriptExecutionContextAndScriptStateAttributeRaisesAttrGetter, TestObjInternal::withScriptExecutionContextAndScriptStateAttributeRaisesAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1866     // Attribute 'withScriptExecutionContextAndScriptStateWithSpacesAttribute' (Type: 'attribute' ExtAttr: 'CallWith')
1867     {"withScriptExecutionContextAndScriptStateWithSpacesAttribute", TestObjInternal::withScriptExecutionContextAndScriptStateWithSpacesAttributeAttrGetter, TestObjInternal::withScriptExecutionContextAndScriptStateWithSpacesAttributeAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1868     // Attribute 'withScriptArgumentsAndCallStackAttribute' (Type: 'attribute' ExtAttr: 'CallWith')
1869     {"withScriptArgumentsAndCallStackAttribute", TestObjInternal::withScriptArgumentsAndCallStackAttributeAttrGetter, TestObjInternal::withScriptArgumentsAndCallStackAttributeAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1870 #if ENABLE(Condition1)
1871     // Attribute 'conditionalAttr1' (Type: 'attribute' ExtAttr: 'Conditional')
1872     {"conditionalAttr1", TestObjInternal::conditionalAttr1AttrGetter, TestObjInternal::conditionalAttr1AttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1873 #endif // ENABLE(Condition1)
1874 #if ENABLE(Condition1) && ENABLE(Condition2)
1875     // Attribute 'conditionalAttr2' (Type: 'attribute' ExtAttr: 'Conditional')
1876     {"conditionalAttr2", TestObjInternal::conditionalAttr2AttrGetter, TestObjInternal::conditionalAttr2AttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1877 #endif // ENABLE(Condition1) && ENABLE(Condition2)
1878 #if ENABLE(Condition1) || ENABLE(Condition2)
1879     // Attribute 'conditionalAttr3' (Type: 'attribute' ExtAttr: 'Conditional')
1880     {"conditionalAttr3", TestObjInternal::conditionalAttr3AttrGetter, TestObjInternal::conditionalAttr3AttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1881 #endif // ENABLE(Condition1) || ENABLE(Condition2)
1882 #if ENABLE(Condition1)
1883     // Attribute 'conditionalAttr4' (Type: 'attribute' ExtAttr: 'Conditional')
1884     {"conditionalAttr4", TestObjInternal::TestObjConstructorGetter, 0, &V8TestObjectA::info, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::ReadOnly), 0 /* on instance */},
1885 #endif // ENABLE(Condition1)
1886 #if ENABLE(Condition1) && ENABLE(Condition2)
1887     // Attribute 'conditionalAttr5' (Type: 'attribute' ExtAttr: 'Conditional')
1888     {"conditionalAttr5", TestObjInternal::TestObjConstructorGetter, 0, &V8TestObjectB::info, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::ReadOnly), 0 /* on instance */},
1889 #endif // ENABLE(Condition1) && ENABLE(Condition2)
1890 #if ENABLE(Condition1) || ENABLE(Condition2)
1891     // Attribute 'conditionalAttr6' (Type: 'attribute' ExtAttr: 'Conditional')
1892     {"conditionalAttr6", TestObjInternal::TestObjConstructorGetter, 0, &V8TestObjectC::info, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::ReadOnly), 0 /* on instance */},
1893 #endif // ENABLE(Condition1) || ENABLE(Condition2)
1894     // Attribute 'cachedAttribute1' (Type: 'readonly attribute' ExtAttr: 'CachedAttribute')
1895     {"cachedAttribute1", TestObjInternal::cachedAttribute1AttrGetter, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1896     // Attribute 'cachedAttribute2' (Type: 'readonly attribute' ExtAttr: 'CachedAttribute')
1897     {"cachedAttribute2", TestObjInternal::cachedAttribute2AttrGetter, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1898     // Attribute 'floatArray' (Type: 'attribute' ExtAttr: '')
1899     {"floatArray", TestObjInternal::floatArrayAttrGetter, TestObjInternal::floatArrayAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1900     // Attribute 'doubleArray' (Type: 'attribute' ExtAttr: '')
1901     {"doubleArray", TestObjInternal::doubleArrayAttrGetter, TestObjInternal::doubleArrayAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1902     // Attribute 'contentDocument' (Type: 'readonly attribute' ExtAttr: 'CheckSecurityForNode')
1903     {"contentDocument", TestObjInternal::contentDocumentAttrGetter, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1904     // Attribute 'mutablePoint' (Type: 'attribute' ExtAttr: '')
1905     {"mutablePoint", TestObjInternal::mutablePointAttrGetter, TestObjInternal::mutablePointAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1906     // Attribute 'immutablePoint' (Type: 'attribute' ExtAttr: 'Immutable')
1907     {"immutablePoint", TestObjInternal::immutablePointAttrGetter, TestObjInternal::immutablePointAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1908     // Attribute 'strawberry' (Type: 'attribute' ExtAttr: 'ImplementedAs')
1909     {"strawberry", TestObjInternal::strawberryAttrGetter, TestObjInternal::strawberryAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1910     // Attribute 'strictFloat' (Type: 'attribute' ExtAttr: 'StrictTypeChecking')
1911     {"strictFloat", TestObjInternal::strictFloatAttrGetter, TestObjInternal::strictFloatAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1912     // Attribute 'description' (Type: 'readonly attribute' ExtAttr: '')
1913     {"description", TestObjInternal::descriptionAttrGetter, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1914     // Attribute 'id' (Type: 'attribute' ExtAttr: '')
1915     {"id", TestObjInternal::idAttrGetter, TestObjInternal::idAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1916     // Attribute 'hash' (Type: 'readonly attribute' ExtAttr: '')
1917     {"hash", TestObjInternal::hashAttrGetter, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1918 };
1919
1920 static const BatchedCallback TestObjCallbacks[] = {
1921     {"voidMethod", TestObjInternal::voidMethodCallback},
1922     {"intMethod", TestObjInternal::intMethodCallback},
1923     {"objMethod", TestObjInternal::objMethodCallback},
1924     {"methodReturningSequence", TestObjInternal::methodReturningSequenceCallback},
1925     {"serializedValue", TestObjInternal::serializedValueCallback},
1926     {"idbKey", TestObjInternal::idbKeyCallback},
1927     {"optionsObject", TestObjInternal::optionsObjectCallback},
1928     {"methodWithException", TestObjInternal::methodWithExceptionCallback},
1929     {"customMethod", V8TestObj::customMethodCallback},
1930     {"customMethodWithArgs", V8TestObj::customMethodWithArgsCallback},
1931     {"addEventListener", TestObjInternal::addEventListenerCallback},
1932     {"removeEventListener", TestObjInternal::removeEventListenerCallback},
1933     {"withScriptStateVoid", TestObjInternal::withScriptStateVoidCallback},
1934     {"withScriptStateObj", TestObjInternal::withScriptStateObjCallback},
1935     {"withScriptStateVoidException", TestObjInternal::withScriptStateVoidExceptionCallback},
1936     {"withScriptStateObjException", TestObjInternal::withScriptStateObjExceptionCallback},
1937     {"withScriptExecutionContext", TestObjInternal::withScriptExecutionContextCallback},
1938     {"withScriptExecutionContextAndScriptState", TestObjInternal::withScriptExecutionContextAndScriptStateCallback},
1939     {"withScriptExecutionContextAndScriptStateObjException", TestObjInternal::withScriptExecutionContextAndScriptStateObjExceptionCallback},
1940     {"withScriptExecutionContextAndScriptStateWithSpaces", TestObjInternal::withScriptExecutionContextAndScriptStateWithSpacesCallback},
1941     {"withScriptArgumentsAndCallStack", TestObjInternal::withScriptArgumentsAndCallStackCallback},
1942     {"methodWithOptionalArg", TestObjInternal::methodWithOptionalArgCallback},
1943     {"methodWithNonOptionalArgAndOptionalArg", TestObjInternal::methodWithNonOptionalArgAndOptionalArgCallback},
1944     {"methodWithNonOptionalArgAndTwoOptionalArgs", TestObjInternal::methodWithNonOptionalArgAndTwoOptionalArgsCallback},
1945     {"methodWithOptionalString", TestObjInternal::methodWithOptionalStringCallback},
1946     {"methodWithOptionalStringIsUndefined", TestObjInternal::methodWithOptionalStringIsUndefinedCallback},
1947     {"methodWithOptionalStringIsNullString", TestObjInternal::methodWithOptionalStringIsNullStringCallback},
1948     {"methodWithCallbackArg", TestObjInternal::methodWithCallbackArgCallback},
1949     {"methodWithNonCallbackArgAndCallbackArg", TestObjInternal::methodWithNonCallbackArgAndCallbackArgCallback},
1950     {"methodWithCallbackAndOptionalArg", TestObjInternal::methodWithCallbackAndOptionalArgCallback},
1951 #if ENABLE(Condition1)
1952     {"conditionalMethod1", TestObjInternal::conditionalMethod1Callback},
1953 #endif
1954 #if ENABLE(Condition1) && ENABLE(Condition2)
1955     {"conditionalMethod2", TestObjInternal::conditionalMethod2Callback},
1956 #endif
1957 #if ENABLE(Condition1) || ENABLE(Condition2)
1958     {"conditionalMethod3", TestObjInternal::conditionalMethod3Callback},
1959 #endif
1960     {"overloadedMethod", TestObjInternal::overloadedMethodCallback},
1961     {"getSVGDocument", TestObjInternal::getSVGDocumentCallback},
1962     {"mutablePointFunction", TestObjInternal::mutablePointFunctionCallback},
1963     {"immutablePointFunction", TestObjInternal::immutablePointFunctionCallback},
1964     {"orange", TestObjInternal::orangeCallback},
1965     {"strictFunction", TestObjInternal::strictFunctionCallback},
1966 };
1967
1968 static const BatchedConstant TestObjConsts[] = {
1969 #if ENABLE(Condition1)
1970     {"CONDITIONAL_CONST", static_cast<signed int>(0)},
1971 #endif
1972     {"CONST_VALUE_0", static_cast<signed int>(0)},
1973     {"CONST_VALUE_1", static_cast<signed int>(1)},
1974     {"CONST_VALUE_2", static_cast<signed int>(2)},
1975     {"CONST_VALUE_4", static_cast<signed int>(4)},
1976     {"CONST_VALUE_8", static_cast<signed int>(8)},
1977     {"CONST_VALUE_9", static_cast<signed int>(-1)},
1978     {"CONST_VALUE_10", static_cast<signed int>("my constant string")},
1979     {"CONST_VALUE_11", static_cast<signed int>(0xffffffff)},
1980     {"CONST_VALUE_12", static_cast<signed int>(0x01)},
1981     {"CONST_VALUE_13", static_cast<signed int>(0X20)},
1982     {"CONST_VALUE_14", static_cast<signed int>(0x1abc)},
1983     {"CONST_JAVASCRIPT", static_cast<signed int>(15)},
1984 };
1985
1986
1987 #if ENABLE(Condition1)
1988 COMPILE_ASSERT(0 == TestObj::CONDITIONAL_CONST, TestObjEnumCONDITIONAL_CONSTIsWrongUseDoNotCheckConstants);
1989 #endif
1990 COMPILE_ASSERT(0 == TestObj::CONST_VALUE_0, TestObjEnumCONST_VALUE_0IsWrongUseDoNotCheckConstants);
1991 COMPILE_ASSERT(1 == TestObj::CONST_VALUE_1, TestObjEnumCONST_VALUE_1IsWrongUseDoNotCheckConstants);
1992 COMPILE_ASSERT(2 == TestObj::CONST_VALUE_2, TestObjEnumCONST_VALUE_2IsWrongUseDoNotCheckConstants);
1993 COMPILE_ASSERT(4 == TestObj::CONST_VALUE_4, TestObjEnumCONST_VALUE_4IsWrongUseDoNotCheckConstants);
1994 COMPILE_ASSERT(8 == TestObj::CONST_VALUE_8, TestObjEnumCONST_VALUE_8IsWrongUseDoNotCheckConstants);
1995 COMPILE_ASSERT(-1 == TestObj::CONST_VALUE_9, TestObjEnumCONST_VALUE_9IsWrongUseDoNotCheckConstants);
1996 COMPILE_ASSERT("my constant string" == TestObj::CONST_VALUE_10, TestObjEnumCONST_VALUE_10IsWrongUseDoNotCheckConstants);
1997 COMPILE_ASSERT(0xffffffff == TestObj::CONST_VALUE_11, TestObjEnumCONST_VALUE_11IsWrongUseDoNotCheckConstants);
1998 COMPILE_ASSERT(0x01 == TestObj::CONST_VALUE_12, TestObjEnumCONST_VALUE_12IsWrongUseDoNotCheckConstants);
1999 COMPILE_ASSERT(0X20 == TestObj::CONST_VALUE_13, TestObjEnumCONST_VALUE_13IsWrongUseDoNotCheckConstants);
2000 COMPILE_ASSERT(0x1abc == TestObj::CONST_VALUE_14, TestObjEnumCONST_VALUE_14IsWrongUseDoNotCheckConstants);
2001 COMPILE_ASSERT(15 == TestObj::CONST_IMPL, TestObjEnumCONST_IMPLIsWrongUseDoNotCheckConstants);
2002
2003 v8::Handle<v8::Value> V8TestObj::constructorCallback(const v8::Arguments& args)
2004 {
2005     INC_STATS("DOM.TestObj.Constructor");
2006
2007     if (!args.IsConstructCall())
2008         return throwError("DOM object constructor cannot be called as a function.", V8Proxy::TypeError);
2009
2010     if (ConstructorMode::current() == ConstructorMode::WrapExistingObject)
2011         return args.Holder();
2012     if (args.Length() < 1)
2013         return throwError("Not enough arguments", V8Proxy::TypeError);
2014     if (args.Length() <= 0 || !args[0]->IsFunction())
2015         return throwError(TYPE_MISMATCH_ERR);
2016     RefPtr<TestCallback> testCallback = V8TestCallback::create(args[0], getScriptExecutionContext());
2017
2018     RefPtr<TestObj> impl = TestObj::create(testCallback);
2019     v8::Handle<v8::Object> wrapper = args.Holder();
2020
2021     V8DOMWrapper::setDOMWrapper(wrapper, &info, impl.get());
2022     V8DOMWrapper::setJSWrapperForDOMObject(impl.release(), v8::Persistent<v8::Object>::New(wrapper));
2023     return args.Holder();
2024 }
2025
2026 static v8::Persistent<v8::FunctionTemplate> ConfigureV8TestObjTemplate(v8::Persistent<v8::FunctionTemplate> desc)
2027 {
2028     desc->ReadOnlyPrototype();
2029
2030     v8::Local<v8::Signature> defaultSignature;
2031     defaultSignature = configureTemplate(desc, "TestObject", v8::Persistent<v8::FunctionTemplate>(), V8TestObj::internalFieldCount,
2032         TestObjAttrs, WTF_ARRAY_LENGTH(TestObjAttrs),
2033         TestObjCallbacks, WTF_ARRAY_LENGTH(TestObjCallbacks));
2034     UNUSED_PARAM(defaultSignature); // In some cases, it will not be used.
2035     desc->SetCallHandler(V8TestObj::constructorCallback);
2036     v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate();
2037     v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate();
2038     UNUSED_PARAM(instance); // In some cases, it will not be used.
2039     UNUSED_PARAM(proto); // In some cases, it will not be used.
2040     
2041     if (RuntimeEnabledFeatures::enabledAtRuntimeAttr1Enabled()) {
2042         static const BatchedAttribute attrData =\
2043         // Attribute 'enabledAtRuntimeAttr1' (Type: 'attribute' ExtAttr: 'V8EnabledAtRuntime')
2044         {"enabledAtRuntimeAttr1", TestObjInternal::enabledAtRuntimeAttr1AttrGetter, TestObjInternal::enabledAtRuntimeAttr1AttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */};
2045         configureAttribute(instance, proto, attrData);
2046     }
2047     if (RuntimeEnabledFeatures::featureNameEnabled()) {
2048         static const BatchedAttribute attrData =\
2049         // Attribute 'enabledAtRuntimeAttr2' (Type: 'attribute' ExtAttr: 'V8EnabledAtRuntime')
2050         {"enabledAtRuntimeAttr2", TestObjInternal::enabledAtRuntimeAttr2AttrGetter, TestObjInternal::enabledAtRuntimeAttr2AttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */};
2051         configureAttribute(instance, proto, attrData);
2052     }
2053
2054     // Custom Signature 'voidMethodWithArgs'
2055     const int voidMethodWithArgsArgc = 3;
2056     v8::Handle<v8::FunctionTemplate> voidMethodWithArgsArgv[voidMethodWithArgsArgc] = { v8::Handle<v8::FunctionTemplate>(), v8::Handle<v8::FunctionTemplate>(), V8TestObj::GetRawTemplate() };
2057     v8::Handle<v8::Signature> voidMethodWithArgsSignature = v8::Signature::New(desc, voidMethodWithArgsArgc, voidMethodWithArgsArgv);
2058     proto->Set(v8::String::New("voidMethodWithArgs"), v8::FunctionTemplate::New(TestObjInternal::voidMethodWithArgsCallback, v8::Handle<v8::Value>(), voidMethodWithArgsSignature));
2059
2060     // Custom Signature 'intMethodWithArgs'
2061     const int intMethodWithArgsArgc = 3;
2062     v8::Handle<v8::FunctionTemplate> intMethodWithArgsArgv[intMethodWithArgsArgc] = { v8::Handle<v8::FunctionTemplate>(), v8::Handle<v8::FunctionTemplate>(), V8TestObj::GetRawTemplate() };
2063     v8::Handle<v8::Signature> intMethodWithArgsSignature = v8::Signature::New(desc, intMethodWithArgsArgc, intMethodWithArgsArgv);
2064     proto->Set(v8::String::New("intMethodWithArgs"), v8::FunctionTemplate::New(TestObjInternal::intMethodWithArgsCallback, v8::Handle<v8::Value>(), intMethodWithArgsSignature));
2065
2066     // Custom Signature 'objMethodWithArgs'
2067     const int objMethodWithArgsArgc = 3;
2068     v8::Handle<v8::FunctionTemplate> objMethodWithArgsArgv[objMethodWithArgsArgc] = { v8::Handle<v8::FunctionTemplate>(), v8::Handle<v8::FunctionTemplate>(), V8TestObj::GetRawTemplate() };
2069     v8::Handle<v8::Signature> objMethodWithArgsSignature = v8::Signature::New(desc, objMethodWithArgsArgc, objMethodWithArgsArgv);
2070     proto->Set(v8::String::New("objMethodWithArgs"), v8::FunctionTemplate::New(TestObjInternal::objMethodWithArgsCallback, v8::Handle<v8::Value>(), objMethodWithArgsSignature));
2071
2072     // Custom Signature 'methodWithSequenceArg'
2073     const int methodWithSequenceArgArgc = 1;
2074     v8::Handle<v8::FunctionTemplate> methodWithSequenceArgArgv[methodWithSequenceArgArgc] = { V8sequence::GetRawTemplate() };
2075     v8::Handle<v8::Signature> methodWithSequenceArgSignature = v8::Signature::New(desc, methodWithSequenceArgArgc, methodWithSequenceArgArgv);
2076     proto->Set(v8::String::New("methodWithSequenceArg"), v8::FunctionTemplate::New(TestObjInternal::methodWithSequenceArgCallback, v8::Handle<v8::Value>(), methodWithSequenceArgSignature));
2077
2078     // Custom Signature 'methodThatRequiresAllArgsAndThrows'
2079     const int methodThatRequiresAllArgsAndThrowsArgc = 2;
2080     v8::Handle<v8::FunctionTemplate> methodThatRequiresAllArgsAndThrowsArgv[methodThatRequiresAllArgsAndThrowsArgc] = { v8::Handle<v8::FunctionTemplate>(), V8TestObj::GetRawTemplate() };
2081     v8::Handle<v8::Signature> methodThatRequiresAllArgsAndThrowsSignature = v8::Signature::New(desc, methodThatRequiresAllArgsAndThrowsArgc, methodThatRequiresAllArgsAndThrowsArgv);
2082     proto->Set(v8::String::New("methodThatRequiresAllArgsAndThrows"), v8::FunctionTemplate::New(TestObjInternal::methodThatRequiresAllArgsAndThrowsCallback, v8::Handle<v8::Value>(), methodThatRequiresAllArgsAndThrowsSignature));
2083     desc->Set(v8::String::New("classMethod"), v8::FunctionTemplate::New(TestObjInternal::classMethodCallback, v8::Handle<v8::Value>(), v8::Local<v8::Signature>()));
2084     desc->Set(v8::String::New("classMethodWithOptional"), v8::FunctionTemplate::New(TestObjInternal::classMethodWithOptionalCallback, v8::Handle<v8::Value>(), v8::Local<v8::Signature>()));
2085     desc->Set(v8::String::New("classMethod2"), v8::FunctionTemplate::New(V8TestObj::classMethod2Callback, v8::Handle<v8::Value>(), v8::Local<v8::Signature>()));
2086 #if ENABLE(Condition1)
2087     desc->Set(v8::String::New("overloadedMethod1"), v8::FunctionTemplate::New(TestObjInternal::overloadedMethod1Callback, v8::Handle<v8::Value>(), v8::Local<v8::Signature>()));
2088 #endif // ENABLE(Condition1)
2089     if (RuntimeEnabledFeatures::enabledAtRuntimeMethod1Enabled())
2090         proto->Set(v8::String::New("enabledAtRuntimeMethod1"), v8::FunctionTemplate::New(TestObjInternal::enabledAtRuntimeMethod1Callback, v8::Handle<v8::Value>(), defaultSignature));
2091     if (RuntimeEnabledFeatures::featureNameEnabled())
2092         proto->Set(v8::String::New("enabledAtRuntimeMethod2"), v8::FunctionTemplate::New(TestObjInternal::enabledAtRuntimeMethod2Callback, v8::Handle<v8::Value>(), defaultSignature));
2093
2094     // Custom Signature 'convert1'
2095     const int convert1Argc = 1;
2096     v8::Handle<v8::FunctionTemplate> convert1Argv[convert1Argc] = { V8a::GetRawTemplate() };
2097     v8::Handle<v8::Signature> convert1Signature = v8::Signature::New(desc, convert1Argc, convert1Argv);
2098     proto->Set(v8::String::New("convert1"), v8::FunctionTemplate::New(TestObjInternal::convert1Callback, v8::Handle<v8::Value>(), convert1Signature));
2099
2100     // Custom Signature 'convert2'
2101     const int convert2Argc = 1;
2102     v8::Handle<v8::FunctionTemplate> convert2Argv[convert2Argc] = { V8b::GetRawTemplate() };
2103     v8::Handle<v8::Signature> convert2Signature = v8::Signature::New(desc, convert2Argc, convert2Argv);
2104     proto->Set(v8::String::New("convert2"), v8::FunctionTemplate::New(TestObjInternal::convert2Callback, v8::Handle<v8::Value>(), convert2Signature));
2105
2106     // Custom Signature 'convert3'
2107     const int convert3Argc = 1;
2108     v8::Handle<v8::FunctionTemplate> convert3Argv[convert3Argc] = { V8c::GetRawTemplate() };
2109     v8::Handle<v8::Signature> convert3Signature = v8::Signature::New(desc, convert3Argc, convert3Argv);
2110     proto->Set(v8::String::New("convert3"), v8::FunctionTemplate::New(TestObjInternal::convert3Callback, v8::Handle<v8::Value>(), convert3Signature));
2111
2112     // Custom Signature 'convert4'
2113     const int convert4Argc = 1;
2114     v8::Handle<v8::FunctionTemplate> convert4Argv[convert4Argc] = { V8d::GetRawTemplate() };
2115     v8::Handle<v8::Signature> convert4Signature = v8::Signature::New(desc, convert4Argc, convert4Argv);
2116     proto->Set(v8::String::New("convert4"), v8::FunctionTemplate::New(TestObjInternal::convert4Callback, v8::Handle<v8::Value>(), convert4Signature));
2117
2118     // Custom Signature 'convert5'
2119     const int convert5Argc = 1;
2120     v8::Handle<v8::FunctionTemplate> convert5Argv[convert5Argc] = { V8e::GetRawTemplate() };
2121     v8::Handle<v8::Signature> convert5Signature = v8::Signature::New(desc, convert5Argc, convert5Argv);
2122     proto->Set(v8::String::New("convert5"), v8::FunctionTemplate::New(TestObjInternal::convert5Callback, v8::Handle<v8::Value>(), convert5Signature));
2123     batchConfigureConstants(desc, proto, TestObjConsts, WTF_ARRAY_LENGTH(TestObjConsts));
2124
2125     // Custom toString template
2126     desc->Set(getToStringName(), getToStringTemplate());
2127     return desc;
2128 }
2129
2130 v8::Persistent<v8::FunctionTemplate> V8TestObj::GetRawTemplate()
2131 {
2132     V8BindingPerIsolateData* data = V8BindingPerIsolateData::current();
2133     V8BindingPerIsolateData::TemplateMap::iterator result = data->rawTemplateMap().find(&info);
2134     if (result != data->rawTemplateMap().end())
2135         return result->second;
2136
2137     v8::HandleScope handleScope;
2138     v8::Persistent<v8::FunctionTemplate> templ = createRawTemplate();
2139     data->rawTemplateMap().add(&info, templ);
2140     return templ;
2141 }
2142
2143 v8::Persistent<v8::FunctionTemplate> V8TestObj::GetTemplate()
2144 {
2145     V8BindingPerIsolateData* data = V8BindingPerIsolateData::current();
2146     V8BindingPerIsolateData::TemplateMap::iterator result = data->templateMap().find(&info);
2147     if (result != data->templateMap().end())
2148         return result->second;
2149
2150     v8::HandleScope handleScope;
2151     v8::Persistent<v8::FunctionTemplate> templ =
2152         ConfigureV8TestObjTemplate(GetRawTemplate());
2153     data->templateMap().add(&info, templ);
2154     return templ;
2155 }
2156
2157 bool V8TestObj::HasInstance(v8::Handle<v8::Value> value)
2158 {
2159     return GetRawTemplate()->HasInstance(value);
2160 }
2161
2162
2163 v8::Handle<v8::Object> V8TestObj::wrapSlow(PassRefPtr<TestObj> impl)
2164 {
2165     v8::Handle<v8::Object> wrapper;
2166     V8Proxy* proxy = 0;
2167     wrapper = V8DOMWrapper::instantiateV8Object(proxy, &info, impl.get());
2168     if (UNLIKELY(wrapper.IsEmpty()))
2169         return wrapper;
2170
2171     v8::Persistent<v8::Object> wrapperHandle = v8::Persistent<v8::Object>::New(wrapper);
2172
2173     if (!hasDependentLifetime)
2174         wrapperHandle.MarkIndependent();
2175     V8DOMWrapper::setJSWrapperForDOMObject(impl, wrapperHandle);
2176     return wrapper;
2177 }
2178
2179 void V8TestObj::derefObject(void* object)
2180 {
2181     static_cast<TestObj*>(object)->deref();
2182 }
2183
2184 } // namespace WebCore