98c6eebfab72fc9887ccda68b7aaf01904108f35
[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> strictFloatAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
945 {
946     INC_STATS("DOM.TestObj.strictFloat._get");
947     TestObj* imp = V8TestObj::toNative(info.Holder());
948     return v8::Number::New(imp->strictFloat());
949 }
950
951 static void strictFloatAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
952 {
953     INC_STATS("DOM.TestObj.strictFloat._set");
954     TestObj* imp = V8TestObj::toNative(info.Holder());
955     float v = static_cast<float>(value->NumberValue());
956     imp->setStrictFloat(v);
957     return;
958 }
959
960 static v8::Handle<v8::Value> descriptionAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
961 {
962     INC_STATS("DOM.TestObj.description._get");
963     TestObj* imp = V8TestObj::toNative(info.Holder());
964     return v8::Integer::New(imp->description());
965 }
966
967 static v8::Handle<v8::Value> idAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
968 {
969     INC_STATS("DOM.TestObj.id._get");
970     TestObj* imp = V8TestObj::toNative(info.Holder());
971     return v8::Integer::New(imp->id());
972 }
973
974 static void idAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
975 {
976     INC_STATS("DOM.TestObj.id._set");
977     TestObj* imp = V8TestObj::toNative(info.Holder());
978     int v = toInt32(value);
979     imp->setId(v);
980     return;
981 }
982
983 static v8::Handle<v8::Value> hashAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
984 {
985     INC_STATS("DOM.TestObj.hash._get");
986     TestObj* imp = V8TestObj::toNative(info.Holder());
987     return v8String(imp->hash());
988 }
989
990 static v8::Handle<v8::Value> TestObjConstructorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
991 {
992     INC_STATS("DOM.TestObj.constructors._get");
993     v8::Handle<v8::Value> data = info.Data();
994     ASSERT(data->IsExternal() || data->IsNumber());
995     WrapperTypeInfo* type = WrapperTypeInfo::unwrap(data);
996     return v8::Handle<v8::Value>();}
997
998 static v8::Handle<v8::Value> voidMethodCallback(const v8::Arguments& args)
999 {
1000     INC_STATS("DOM.TestObj.voidMethod");
1001     TestObj* imp = V8TestObj::toNative(args.Holder());
1002     imp->voidMethod();
1003     return v8::Handle<v8::Value>();
1004 }
1005
1006 static v8::Handle<v8::Value> voidMethodWithArgsCallback(const v8::Arguments& args)
1007 {
1008     INC_STATS("DOM.TestObj.voidMethodWithArgs");
1009     if (args.Length() < 3)
1010         return throwError("Not enough arguments", V8Proxy::TypeError);
1011     TestObj* imp = V8TestObj::toNative(args.Holder());
1012     EXCEPTION_BLOCK(int, intArg, toInt32(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)));
1013     STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, strArg, MAYBE_MISSING_PARAMETER(args, 1, DefaultIsUndefined));
1014     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);
1015     imp->voidMethodWithArgs(intArg, strArg, objArg);
1016     return v8::Handle<v8::Value>();
1017 }
1018
1019 static v8::Handle<v8::Value> intMethodCallback(const v8::Arguments& args)
1020 {
1021     INC_STATS("DOM.TestObj.intMethod");
1022     TestObj* imp = V8TestObj::toNative(args.Holder());
1023     return v8::Integer::New(imp->intMethod());
1024 }
1025
1026 static v8::Handle<v8::Value> intMethodWithArgsCallback(const v8::Arguments& args)
1027 {
1028     INC_STATS("DOM.TestObj.intMethodWithArgs");
1029     if (args.Length() < 3)
1030         return throwError("Not enough arguments", V8Proxy::TypeError);
1031     TestObj* imp = V8TestObj::toNative(args.Holder());
1032     EXCEPTION_BLOCK(int, intArg, toInt32(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)));
1033     STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, strArg, MAYBE_MISSING_PARAMETER(args, 1, DefaultIsUndefined));
1034     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);
1035     return v8::Integer::New(imp->intMethodWithArgs(intArg, strArg, objArg));
1036 }
1037
1038 static v8::Handle<v8::Value> objMethodCallback(const v8::Arguments& args)
1039 {
1040     INC_STATS("DOM.TestObj.objMethod");
1041     TestObj* imp = V8TestObj::toNative(args.Holder());
1042     return toV8(imp->objMethod());
1043 }
1044
1045 static v8::Handle<v8::Value> objMethodWithArgsCallback(const v8::Arguments& args)
1046 {
1047     INC_STATS("DOM.TestObj.objMethodWithArgs");
1048     if (args.Length() < 3)
1049         return throwError("Not enough arguments", V8Proxy::TypeError);
1050     TestObj* imp = V8TestObj::toNative(args.Holder());
1051     EXCEPTION_BLOCK(int, intArg, toInt32(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)));
1052     STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, strArg, MAYBE_MISSING_PARAMETER(args, 1, DefaultIsUndefined));
1053     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);
1054     return toV8(imp->objMethodWithArgs(intArg, strArg, objArg));
1055 }
1056
1057 static v8::Handle<v8::Value> methodWithSequenceArgCallback(const v8::Arguments& args)
1058 {
1059     INC_STATS("DOM.TestObj.methodWithSequenceArg");
1060     if (args.Length() < 1)
1061         return throwError("Not enough arguments", V8Proxy::TypeError);
1062     TestObj* imp = V8TestObj::toNative(args.Holder());
1063     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);
1064     imp->methodWithSequenceArg();
1065     return v8::Handle<v8::Value>();
1066 }
1067
1068 static v8::Handle<v8::Value> methodReturningSequenceCallback(const v8::Arguments& args)
1069 {
1070     INC_STATS("DOM.TestObj.methodReturningSequence");
1071     if (args.Length() < 1)
1072         return throwError("Not enough arguments", V8Proxy::TypeError);
1073     TestObj* imp = V8TestObj::toNative(args.Holder());
1074     EXCEPTION_BLOCK(int, intArg, toInt32(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)));
1075     return v8Array(imp->methodReturningSequence(intArg));
1076 }
1077
1078 static v8::Handle<v8::Value> methodThatRequiresAllArgsAndThrowsCallback(const v8::Arguments& args)
1079 {
1080     INC_STATS("DOM.TestObj.methodThatRequiresAllArgsAndThrows");
1081     if (args.Length() < 2)
1082         return throwError("Not enough arguments", V8Proxy::TypeError);
1083     TestObj* imp = V8TestObj::toNative(args.Holder());
1084     ExceptionCode ec = 0;
1085     {
1086     STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, strArg, MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined));
1087     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);
1088     RefPtr<TestObj> result = imp->methodThatRequiresAllArgsAndThrows(strArg, objArg, ec);
1089     if (UNLIKELY(ec))
1090         goto fail;
1091     return toV8(result.release());
1092     }
1093     fail:
1094     V8Proxy::setDOMException(ec);
1095     return v8::Handle<v8::Value>();
1096 }
1097
1098 static v8::Handle<v8::Value> serializedValueCallback(const v8::Arguments& args)
1099 {
1100     INC_STATS("DOM.TestObj.serializedValue");
1101     if (args.Length() < 1)
1102         return throwError("Not enough arguments", V8Proxy::TypeError);
1103     TestObj* imp = V8TestObj::toNative(args.Holder());
1104     bool serializedArgDidThrow = false;
1105     RefPtr<SerializedScriptValue> serializedArg = SerializedScriptValue::create(args[0], 0, 0, serializedArgDidThrow);
1106     if (serializedArgDidThrow)
1107         return v8::Undefined();
1108     imp->serializedValue(serializedArg);
1109     return v8::Handle<v8::Value>();
1110 }
1111
1112 static v8::Handle<v8::Value> idbKeyCallback(const v8::Arguments& args)
1113 {
1114     INC_STATS("DOM.TestObj.idbKey");
1115     if (args.Length() < 1)
1116         return throwError("Not enough arguments", V8Proxy::TypeError);
1117     TestObj* imp = V8TestObj::toNative(args.Holder());
1118     EXCEPTION_BLOCK(RefPtr<IDBKey>, key, createIDBKeyFromValue(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)));
1119     imp->idbKey(key.get());
1120     return v8::Handle<v8::Value>();
1121 }
1122
1123 static v8::Handle<v8::Value> optionsObjectCallback(const v8::Arguments& args)
1124 {
1125     INC_STATS("DOM.TestObj.optionsObject");
1126     if (args.Length() < 1)
1127         return throwError("Not enough arguments", V8Proxy::TypeError);
1128     TestObj* imp = V8TestObj::toNative(args.Holder());
1129     EXCEPTION_BLOCK(Dictionary, oo, MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined));
1130     if (args.Length() > 0 && !oo.isUndefinedOrNull() && !oo.isObject()) {
1131         ec = TYPE_MISMATCH_ERR;
1132         V8Proxy::setDOMException(ec);
1133         return throwError("Not an object.", V8Proxy::TypeError);
1134     }
1135     if (args.Length() <= 1) {
1136         imp->optionsObject(oo);
1137         return v8::Handle<v8::Value>();
1138     }
1139     EXCEPTION_BLOCK(Dictionary, ooo, MAYBE_MISSING_PARAMETER(args, 1, DefaultIsUndefined));
1140     if (args.Length() > 1 && !ooo.isUndefinedOrNull() && !ooo.isObject()) {
1141         ec = TYPE_MISMATCH_ERR;
1142         V8Proxy::setDOMException(ec);
1143         return throwError("Not an object.", V8Proxy::TypeError);
1144     }
1145     imp->optionsObject(oo, ooo);
1146     return v8::Handle<v8::Value>();
1147 }
1148
1149 static v8::Handle<v8::Value> methodWithExceptionCallback(const v8::Arguments& args)
1150 {
1151     INC_STATS("DOM.TestObj.methodWithException");
1152     TestObj* imp = V8TestObj::toNative(args.Holder());
1153     ExceptionCode ec = 0;
1154     {
1155     imp->methodWithException(ec);
1156     if (UNLIKELY(ec))
1157         goto fail;
1158     return v8::Handle<v8::Value>();
1159     }
1160     fail:
1161     V8Proxy::setDOMException(ec);
1162     return v8::Handle<v8::Value>();
1163 }
1164
1165 static v8::Handle<v8::Value> addEventListenerCallback(const v8::Arguments& args)
1166 {
1167     INC_STATS("DOM.TestObj.addEventListener()");
1168     RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(args[1], false, ListenerFindOrCreate);
1169     if (listener) {
1170         V8TestObj::toNative(args.Holder())->addEventListener(v8ValueToAtomicWebCoreString(args[0]), listener, args[2]->BooleanValue());
1171         createHiddenDependency(args.Holder(), args[1], V8TestObj::eventListenerCacheIndex);
1172     }
1173     return v8::Undefined();
1174 }
1175
1176 static v8::Handle<v8::Value> removeEventListenerCallback(const v8::Arguments& args)
1177 {
1178     INC_STATS("DOM.TestObj.removeEventListener()");
1179     RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(args[1], false, ListenerFindOnly);
1180     if (listener) {
1181         V8TestObj::toNative(args.Holder())->removeEventListener(v8ValueToAtomicWebCoreString(args[0]), listener.get(), args[2]->BooleanValue());
1182         removeHiddenDependency(args.Holder(), args[1], V8TestObj::eventListenerCacheIndex);
1183     }
1184     return v8::Undefined();
1185 }
1186
1187 static v8::Handle<v8::Value> withScriptStateVoidCallback(const v8::Arguments& args)
1188 {
1189     INC_STATS("DOM.TestObj.withScriptStateVoid");
1190     TestObj* imp = V8TestObj::toNative(args.Holder());
1191     EmptyScriptState state;
1192     imp->withScriptStateVoid(&state);
1193     if (state.hadException())
1194         return throwError(state.exception());
1195     return v8::Handle<v8::Value>();
1196 }
1197
1198 static v8::Handle<v8::Value> withScriptStateObjCallback(const v8::Arguments& args)
1199 {
1200     INC_STATS("DOM.TestObj.withScriptStateObj");
1201     TestObj* imp = V8TestObj::toNative(args.Holder());
1202     EmptyScriptState state;
1203     RefPtr<TestObj> result = imp->withScriptStateObj(&state);
1204     if (state.hadException())
1205         return throwError(state.exception());
1206     return toV8(result.release());
1207 }
1208
1209 static v8::Handle<v8::Value> withScriptStateVoidExceptionCallback(const v8::Arguments& args)
1210 {
1211     INC_STATS("DOM.TestObj.withScriptStateVoidException");
1212     TestObj* imp = V8TestObj::toNative(args.Holder());
1213     ExceptionCode ec = 0;
1214     {
1215     EmptyScriptState state;
1216     imp->withScriptStateVoidException(&state, ec);
1217     if (UNLIKELY(ec))
1218         goto fail;
1219     if (state.hadException())
1220         return throwError(state.exception());
1221     return v8::Handle<v8::Value>();
1222     }
1223     fail:
1224     V8Proxy::setDOMException(ec);
1225     return v8::Handle<v8::Value>();
1226 }
1227
1228 static v8::Handle<v8::Value> withScriptStateObjExceptionCallback(const v8::Arguments& args)
1229 {
1230     INC_STATS("DOM.TestObj.withScriptStateObjException");
1231     TestObj* imp = V8TestObj::toNative(args.Holder());
1232     ExceptionCode ec = 0;
1233     {
1234     EmptyScriptState state;
1235     RefPtr<TestObj> result = imp->withScriptStateObjException(&state, ec);
1236     if (UNLIKELY(ec))
1237         goto fail;
1238     if (state.hadException())
1239         return throwError(state.exception());
1240     return toV8(result.release());
1241     }
1242     fail:
1243     V8Proxy::setDOMException(ec);
1244     return v8::Handle<v8::Value>();
1245 }
1246
1247 static v8::Handle<v8::Value> withScriptExecutionContextCallback(const v8::Arguments& args)
1248 {
1249     INC_STATS("DOM.TestObj.withScriptExecutionContext");
1250     TestObj* imp = V8TestObj::toNative(args.Holder());
1251     ScriptExecutionContext* scriptContext = getScriptExecutionContext();
1252     if (!scriptContext)
1253         return v8::Undefined();
1254     imp->withScriptExecutionContext(scriptContext);
1255     return v8::Handle<v8::Value>();
1256 }
1257
1258 static v8::Handle<v8::Value> withScriptExecutionContextAndScriptStateCallback(const v8::Arguments& args)
1259 {
1260     INC_STATS("DOM.TestObj.withScriptExecutionContextAndScriptState");
1261     TestObj* imp = V8TestObj::toNative(args.Holder());
1262     EmptyScriptState state;
1263     ScriptExecutionContext* scriptContext = getScriptExecutionContext();
1264     if (!scriptContext)
1265         return v8::Undefined();
1266     imp->withScriptExecutionContextAndScriptState(&state, scriptContext);
1267     if (state.hadException())
1268         return throwError(state.exception());
1269     return v8::Handle<v8::Value>();
1270 }
1271
1272 static v8::Handle<v8::Value> withScriptExecutionContextAndScriptStateObjExceptionCallback(const v8::Arguments& args)
1273 {
1274     INC_STATS("DOM.TestObj.withScriptExecutionContextAndScriptStateObjException");
1275     TestObj* imp = V8TestObj::toNative(args.Holder());
1276     ExceptionCode ec = 0;
1277     {
1278     EmptyScriptState state;
1279     ScriptExecutionContext* scriptContext = getScriptExecutionContext();
1280     if (!scriptContext)
1281         return v8::Undefined();
1282     RefPtr<TestObj> result = imp->withScriptExecutionContextAndScriptStateObjException(&state, scriptContext, ec);
1283     if (UNLIKELY(ec))
1284         goto fail;
1285     if (state.hadException())
1286         return throwError(state.exception());
1287     return toV8(result.release());
1288     }
1289     fail:
1290     V8Proxy::setDOMException(ec);
1291     return v8::Handle<v8::Value>();
1292 }
1293
1294 static v8::Handle<v8::Value> withScriptExecutionContextAndScriptStateWithSpacesCallback(const v8::Arguments& args)
1295 {
1296     INC_STATS("DOM.TestObj.withScriptExecutionContextAndScriptStateWithSpaces");
1297     TestObj* imp = V8TestObj::toNative(args.Holder());
1298     EmptyScriptState state;
1299     ScriptExecutionContext* scriptContext = getScriptExecutionContext();
1300     if (!scriptContext)
1301         return v8::Undefined();
1302     RefPtr<TestObj> result = imp->withScriptExecutionContextAndScriptStateWithSpaces(&state, scriptContext);
1303     if (state.hadException())
1304         return throwError(state.exception());
1305     return toV8(result.release());
1306 }
1307
1308 static v8::Handle<v8::Value> withScriptArgumentsAndCallStackCallback(const v8::Arguments& args)
1309 {
1310     INC_STATS("DOM.TestObj.withScriptArgumentsAndCallStack");
1311     TestObj* imp = V8TestObj::toNative(args.Holder());
1312     RefPtr<ScriptArguments> scriptArguments(createScriptArguments(args, 0));
1313     RefPtr<ScriptCallStack> callStack(createScriptCallStackForInspector());
1314     if (!callStack)
1315         return v8::Undefined();
1316     imp->withScriptArgumentsAndCallStack(scriptArguments, callStack);
1317     return v8::Handle<v8::Value>();
1318 }
1319
1320 static v8::Handle<v8::Value> methodWithOptionalArgCallback(const v8::Arguments& args)
1321 {
1322     INC_STATS("DOM.TestObj.methodWithOptionalArg");
1323     TestObj* imp = V8TestObj::toNative(args.Holder());
1324     if (args.Length() <= 0) {
1325         imp->methodWithOptionalArg();
1326         return v8::Handle<v8::Value>();
1327     }
1328     EXCEPTION_BLOCK(int, opt, toInt32(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)));
1329     imp->methodWithOptionalArg(opt);
1330     return v8::Handle<v8::Value>();
1331 }
1332
1333 static v8::Handle<v8::Value> methodWithNonOptionalArgAndOptionalArgCallback(const v8::Arguments& args)
1334 {
1335     INC_STATS("DOM.TestObj.methodWithNonOptionalArgAndOptionalArg");
1336     if (args.Length() < 1)
1337         return throwError("Not enough arguments", V8Proxy::TypeError);
1338     TestObj* imp = V8TestObj::toNative(args.Holder());
1339     EXCEPTION_BLOCK(int, nonOpt, toInt32(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)));
1340     if (args.Length() <= 1) {
1341         imp->methodWithNonOptionalArgAndOptionalArg(nonOpt);
1342         return v8::Handle<v8::Value>();
1343     }
1344     EXCEPTION_BLOCK(int, opt, toInt32(MAYBE_MISSING_PARAMETER(args, 1, DefaultIsUndefined)));
1345     imp->methodWithNonOptionalArgAndOptionalArg(nonOpt, opt);
1346     return v8::Handle<v8::Value>();
1347 }
1348
1349 static v8::Handle<v8::Value> methodWithNonOptionalArgAndTwoOptionalArgsCallback(const v8::Arguments& args)
1350 {
1351     INC_STATS("DOM.TestObj.methodWithNonOptionalArgAndTwoOptionalArgs");
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->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt);
1358         return v8::Handle<v8::Value>();
1359     }
1360     EXCEPTION_BLOCK(int, opt1, toInt32(MAYBE_MISSING_PARAMETER(args, 1, DefaultIsUndefined)));
1361     if (args.Length() <= 2) {
1362         imp->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt, opt1);
1363         return v8::Handle<v8::Value>();
1364     }
1365     EXCEPTION_BLOCK(int, opt2, toInt32(MAYBE_MISSING_PARAMETER(args, 2, DefaultIsUndefined)));
1366     imp->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt, opt1, opt2);
1367     return v8::Handle<v8::Value>();
1368 }
1369
1370 static v8::Handle<v8::Value> methodWithOptionalStringCallback(const v8::Arguments& args)
1371 {
1372     INC_STATS("DOM.TestObj.methodWithOptionalString");
1373     TestObj* imp = V8TestObj::toNative(args.Holder());
1374     if (args.Length() <= 0) {
1375         imp->methodWithOptionalString();
1376         return v8::Handle<v8::Value>();
1377     }
1378     STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, str, MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined));
1379     imp->methodWithOptionalString(str);
1380     return v8::Handle<v8::Value>();
1381 }
1382
1383 static v8::Handle<v8::Value> methodWithOptionalStringIsUndefinedCallback(const v8::Arguments& args)
1384 {
1385     INC_STATS("DOM.TestObj.methodWithOptionalStringIsUndefined");
1386     TestObj* imp = V8TestObj::toNative(args.Holder());
1387     STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, str, MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined));
1388     imp->methodWithOptionalStringIsUndefined(str);
1389     return v8::Handle<v8::Value>();
1390 }
1391
1392 static v8::Handle<v8::Value> methodWithOptionalStringIsNullStringCallback(const v8::Arguments& args)
1393 {
1394     INC_STATS("DOM.TestObj.methodWithOptionalStringIsNullString");
1395     TestObj* imp = V8TestObj::toNative(args.Holder());
1396     STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, str, MAYBE_MISSING_PARAMETER(args, 0, DefaultIsNullString));
1397     imp->methodWithOptionalStringIsNullString(str);
1398     return v8::Handle<v8::Value>();
1399 }
1400
1401 static v8::Handle<v8::Value> methodWithCallbackArgCallback(const v8::Arguments& args)
1402 {
1403     INC_STATS("DOM.TestObj.methodWithCallbackArg");
1404     if (args.Length() < 1)
1405         return throwError("Not enough arguments", V8Proxy::TypeError);
1406     TestObj* imp = V8TestObj::toNative(args.Holder());
1407     if (args.Length() <= 0 || !args[0]->IsFunction())
1408         return throwError(TYPE_MISMATCH_ERR);
1409     RefPtr<TestCallback> callback = V8TestCallback::create(args[0], getScriptExecutionContext());
1410     imp->methodWithCallbackArg(callback);
1411     return v8::Handle<v8::Value>();
1412 }
1413
1414 static v8::Handle<v8::Value> methodWithNonCallbackArgAndCallbackArgCallback(const v8::Arguments& args)
1415 {
1416     INC_STATS("DOM.TestObj.methodWithNonCallbackArgAndCallbackArg");
1417     if (args.Length() < 2)
1418         return throwError("Not enough arguments", V8Proxy::TypeError);
1419     TestObj* imp = V8TestObj::toNative(args.Holder());
1420     EXCEPTION_BLOCK(int, nonCallback, toInt32(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)));
1421     if (args.Length() <= 1 || !args[1]->IsFunction())
1422         return throwError(TYPE_MISMATCH_ERR);
1423     RefPtr<TestCallback> callback = V8TestCallback::create(args[1], getScriptExecutionContext());
1424     imp->methodWithNonCallbackArgAndCallbackArg(nonCallback, callback);
1425     return v8::Handle<v8::Value>();
1426 }
1427
1428 static v8::Handle<v8::Value> methodWithCallbackAndOptionalArgCallback(const v8::Arguments& args)
1429 {
1430     INC_STATS("DOM.TestObj.methodWithCallbackAndOptionalArg");
1431     TestObj* imp = V8TestObj::toNative(args.Holder());
1432     RefPtr<TestCallback> callback;
1433     if (args.Length() > 0 && !args[0]->IsNull() && !args[0]->IsUndefined()) {
1434         if (!args[0]->IsFunction())
1435             return throwError(TYPE_MISMATCH_ERR);
1436         callback = V8TestCallback::create(args[0], getScriptExecutionContext());
1437     }
1438     imp->methodWithCallbackAndOptionalArg(callback);
1439     return v8::Handle<v8::Value>();
1440 }
1441
1442 #if ENABLE(Condition1)
1443
1444 static v8::Handle<v8::Value> conditionalMethod1Callback(const v8::Arguments& args)
1445 {
1446     INC_STATS("DOM.TestObj.conditionalMethod1");
1447     TestObj* imp = V8TestObj::toNative(args.Holder());
1448     return v8String(imp->conditionalMethod1());
1449 }
1450
1451 #endif // ENABLE(Condition1)
1452
1453 #if ENABLE(Condition1) && ENABLE(Condition2)
1454
1455 static v8::Handle<v8::Value> conditionalMethod2Callback(const v8::Arguments& args)
1456 {
1457     INC_STATS("DOM.TestObj.conditionalMethod2");
1458     TestObj* imp = V8TestObj::toNative(args.Holder());
1459     imp->conditionalMethod2();
1460     return v8::Handle<v8::Value>();
1461 }
1462
1463 #endif // ENABLE(Condition1) && ENABLE(Condition2)
1464
1465 #if ENABLE(Condition1) || ENABLE(Condition2)
1466
1467 static v8::Handle<v8::Value> conditionalMethod3Callback(const v8::Arguments& args)
1468 {
1469     INC_STATS("DOM.TestObj.conditionalMethod3");
1470     TestObj* imp = V8TestObj::toNative(args.Holder());
1471     imp->conditionalMethod3();
1472     return v8::Handle<v8::Value>();
1473 }
1474
1475 #endif // ENABLE(Condition1) || ENABLE(Condition2)
1476
1477 static v8::Handle<v8::Value> overloadedMethod1Callback(const v8::Arguments& args)
1478 {
1479     INC_STATS("DOM.TestObj.overloadedMethod1");
1480     if (args.Length() < 2)
1481         return throwError("Not enough arguments", V8Proxy::TypeError);
1482     TestObj* imp = V8TestObj::toNative(args.Holder());
1483     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);
1484     STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, strArg, MAYBE_MISSING_PARAMETER(args, 1, DefaultIsUndefined));
1485     imp->overloadedMethod(objArg, strArg);
1486     return v8::Handle<v8::Value>();
1487 }
1488
1489 static v8::Handle<v8::Value> overloadedMethod2Callback(const v8::Arguments& args)
1490 {
1491     INC_STATS("DOM.TestObj.overloadedMethod2");
1492     if (args.Length() < 1)
1493         return throwError("Not enough arguments", V8Proxy::TypeError);
1494     TestObj* imp = V8TestObj::toNative(args.Holder());
1495     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);
1496     if (args.Length() <= 1) {
1497         imp->overloadedMethod(objArg);
1498         return v8::Handle<v8::Value>();
1499     }
1500     EXCEPTION_BLOCK(int, intArg, toInt32(MAYBE_MISSING_PARAMETER(args, 1, DefaultIsUndefined)));
1501     imp->overloadedMethod(objArg, intArg);
1502     return v8::Handle<v8::Value>();
1503 }
1504
1505 static v8::Handle<v8::Value> overloadedMethod3Callback(const v8::Arguments& args)
1506 {
1507     INC_STATS("DOM.TestObj.overloadedMethod3");
1508     if (args.Length() < 1)
1509         return throwError("Not enough arguments", V8Proxy::TypeError);
1510     TestObj* imp = V8TestObj::toNative(args.Holder());
1511     STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, strArg, MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined));
1512     imp->overloadedMethod(strArg);
1513     return v8::Handle<v8::Value>();
1514 }
1515
1516 static v8::Handle<v8::Value> overloadedMethod4Callback(const v8::Arguments& args)
1517 {
1518     INC_STATS("DOM.TestObj.overloadedMethod4");
1519     if (args.Length() < 1)
1520         return throwError("Not enough arguments", V8Proxy::TypeError);
1521     TestObj* imp = V8TestObj::toNative(args.Holder());
1522     EXCEPTION_BLOCK(int, intArg, toInt32(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)));
1523     imp->overloadedMethod(intArg);
1524     return v8::Handle<v8::Value>();
1525 }
1526
1527 static v8::Handle<v8::Value> overloadedMethod5Callback(const v8::Arguments& args)
1528 {
1529     INC_STATS("DOM.TestObj.overloadedMethod5");
1530     if (args.Length() < 1)
1531         return throwError("Not enough arguments", V8Proxy::TypeError);
1532     TestObj* imp = V8TestObj::toNative(args.Holder());
1533     if (args.Length() <= 0 || !args[0]->IsFunction())
1534         return throwError(TYPE_MISMATCH_ERR);
1535     RefPtr<TestCallback> callback = V8TestCallback::create(args[0], getScriptExecutionContext());
1536     imp->overloadedMethod(callback);
1537     return v8::Handle<v8::Value>();
1538 }
1539
1540 static v8::Handle<v8::Value> overloadedMethod6Callback(const v8::Arguments& args)
1541 {
1542     INC_STATS("DOM.TestObj.overloadedMethod6");
1543     if (args.Length() < 1)
1544         return throwError("Not enough arguments", V8Proxy::TypeError);
1545     TestObj* imp = V8TestObj::toNative(args.Holder());
1546     EXCEPTION_BLOCK(RefPtr<DOMStringList>, listArg, v8ValueToWebCoreDOMStringList(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)));
1547     imp->overloadedMethod(listArg);
1548     return v8::Handle<v8::Value>();
1549 }
1550
1551 static v8::Handle<v8::Value> overloadedMethod7Callback(const v8::Arguments& args)
1552 {
1553     INC_STATS("DOM.TestObj.overloadedMethod7");
1554     if (args.Length() < 1)
1555         return throwError("Not enough arguments", V8Proxy::TypeError);
1556     TestObj* imp = V8TestObj::toNative(args.Holder());
1557     EXCEPTION_BLOCK(RefPtr<DOMStringList>, arrayArg, v8ValueToWebCoreDOMStringList(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)));
1558     imp->overloadedMethod(arrayArg);
1559     return v8::Handle<v8::Value>();
1560 }
1561
1562 static v8::Handle<v8::Value> overloadedMethodCallback(const v8::Arguments& args)
1563 {
1564     INC_STATS("DOM.TestObj.overloadedMethod");
1565     if ((args.Length() == 2 && (args[0]->IsNull() || V8TestObj::HasInstance(args[0])) && (args[1]->IsNull() || args[1]->IsUndefined() || args[1]->IsString() || args[1]->IsObject())))
1566         return overloadedMethod1Callback(args);
1567     if ((args.Length() == 1 && (args[0]->IsNull() || V8TestObj::HasInstance(args[0]))) || (args.Length() == 2 && (args[0]->IsNull() || V8TestObj::HasInstance(args[0]))))
1568         return overloadedMethod2Callback(args);
1569     if ((args.Length() == 1 && (args[0]->IsNull() || args[0]->IsUndefined() || args[0]->IsString() || args[0]->IsObject())))
1570         return overloadedMethod3Callback(args);
1571     if (args.Length() == 1)
1572         return overloadedMethod4Callback(args);
1573     if ((args.Length() == 1 && (args[0]->IsNull() || args[0]->IsFunction())))
1574         return overloadedMethod5Callback(args);
1575     if ((args.Length() == 1 && (args[0]->IsNull() || V8DOMStringList::HasInstance(args[0]))))
1576         return overloadedMethod6Callback(args);
1577     if ((args.Length() == 1 && (args[0]->IsNull() || args[0]->IsArray())))
1578         return overloadedMethod7Callback(args);
1579     V8Proxy::throwTypeError();
1580     return notHandledByInterceptor();
1581 }
1582
1583 static v8::Handle<v8::Value> classMethodCallback(const v8::Arguments& args)
1584 {
1585     INC_STATS("DOM.TestObj.classMethod");
1586     TestObj::classMethod();
1587     return v8::Handle<v8::Value>();
1588 }
1589
1590 static v8::Handle<v8::Value> classMethodWithOptionalCallback(const v8::Arguments& args)
1591 {
1592     INC_STATS("DOM.TestObj.classMethodWithOptional");
1593     if (args.Length() <= 0) {
1594         return v8::Integer::New(TestObj::classMethodWithOptional());
1595     }
1596     EXCEPTION_BLOCK(int, arg, toInt32(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)));
1597     return v8::Integer::New(TestObj::classMethodWithOptional(arg));
1598 }
1599
1600 #if ENABLE(Condition1)
1601
1602 static v8::Handle<v8::Value> overloadedMethod11Callback(const v8::Arguments& args)
1603 {
1604     INC_STATS("DOM.TestObj.overloadedMethod11");
1605     if (args.Length() < 1)
1606         return throwError("Not enough arguments", V8Proxy::TypeError);
1607     EXCEPTION_BLOCK(int, arg, toInt32(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)));
1608     TestObj::overloadedMethod1(arg);
1609     return v8::Handle<v8::Value>();
1610 }
1611
1612 #endif // ENABLE(Condition1)
1613
1614 #if ENABLE(Condition1)
1615
1616 static v8::Handle<v8::Value> overloadedMethod12Callback(const v8::Arguments& args)
1617 {
1618     INC_STATS("DOM.TestObj.overloadedMethod12");
1619     if (args.Length() < 1)
1620         return throwError("Not enough arguments", V8Proxy::TypeError);
1621     STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, type, MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined));
1622     TestObj::overloadedMethod1(type);
1623     return v8::Handle<v8::Value>();
1624 }
1625
1626 #endif // ENABLE(Condition1)
1627
1628 #if ENABLE(Condition1)
1629
1630 static v8::Handle<v8::Value> overloadedMethod1Callback(const v8::Arguments& args)
1631 {
1632     INC_STATS("DOM.TestObj.overloadedMethod1");
1633     if (args.Length() == 1)
1634         return overloadedMethod11Callback(args);
1635     if ((args.Length() == 1 && (args[0]->IsNull() || args[0]->IsUndefined() || args[0]->IsString() || args[0]->IsObject())))
1636         return overloadedMethod12Callback(args);
1637     V8Proxy::throwTypeError();
1638     return notHandledByInterceptor();
1639 }
1640
1641 #endif // ENABLE(Condition1)
1642
1643 static v8::Handle<v8::Value> enabledAtRuntimeMethod1Callback(const v8::Arguments& args)
1644 {
1645     INC_STATS("DOM.TestObj.enabledAtRuntimeMethod1");
1646     if (args.Length() < 1)
1647         return throwError("Not enough arguments", V8Proxy::TypeError);
1648     TestObj* imp = V8TestObj::toNative(args.Holder());
1649     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);
1650     imp->enabledAtRuntimeMethod1(intArg);
1651     return v8::Handle<v8::Value>();
1652 }
1653
1654 static v8::Handle<v8::Value> enabledAtRuntimeMethod2Callback(const v8::Arguments& args)
1655 {
1656     INC_STATS("DOM.TestObj.enabledAtRuntimeMethod2");
1657     if (args.Length() < 1)
1658         return throwError("Not enough arguments", V8Proxy::TypeError);
1659     TestObj* imp = V8TestObj::toNative(args.Holder());
1660     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);
1661     imp->enabledAtRuntimeMethod2(intArg);
1662     return v8::Handle<v8::Value>();
1663 }
1664
1665 static v8::Handle<v8::Value> getSVGDocumentCallback(const v8::Arguments& args)
1666 {
1667     INC_STATS("DOM.TestObj.getSVGDocument");
1668     TestObj* imp = V8TestObj::toNative(args.Holder());
1669     ExceptionCode ec = 0;
1670     {
1671     if (!V8BindingSecurity::shouldAllowAccessToNode(V8BindingState::Only(), imp->getSVGDocument(ec)))
1672         return v8::Handle<v8::Value>(v8::Null());
1673     RefPtr<SVGDocument> result = imp->getSVGDocument(ec);
1674     if (UNLIKELY(ec))
1675         goto fail;
1676     return toV8(result.release());
1677     }
1678     fail:
1679     V8Proxy::setDOMException(ec);
1680     return v8::Handle<v8::Value>();
1681 }
1682
1683 static v8::Handle<v8::Value> convert1Callback(const v8::Arguments& args)
1684 {
1685     INC_STATS("DOM.TestObj.convert1");
1686     if (args.Length() < 1)
1687         return throwError("Not enough arguments", V8Proxy::TypeError);
1688     TestObj* imp = V8TestObj::toNative(args.Holder());
1689     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);
1690     imp->convert1();
1691     return v8::Handle<v8::Value>();
1692 }
1693
1694 static v8::Handle<v8::Value> convert2Callback(const v8::Arguments& args)
1695 {
1696     INC_STATS("DOM.TestObj.convert2");
1697     if (args.Length() < 1)
1698         return throwError("Not enough arguments", V8Proxy::TypeError);
1699     TestObj* imp = V8TestObj::toNative(args.Holder());
1700     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);
1701     imp->convert2();
1702     return v8::Handle<v8::Value>();
1703 }
1704
1705 static v8::Handle<v8::Value> convert3Callback(const v8::Arguments& args)
1706 {
1707     INC_STATS("DOM.TestObj.convert3");
1708     if (args.Length() < 1)
1709         return throwError("Not enough arguments", V8Proxy::TypeError);
1710     TestObj* imp = V8TestObj::toNative(args.Holder());
1711     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);
1712     imp->convert3();
1713     return v8::Handle<v8::Value>();
1714 }
1715
1716 static v8::Handle<v8::Value> convert4Callback(const v8::Arguments& args)
1717 {
1718     INC_STATS("DOM.TestObj.convert4");
1719     if (args.Length() < 1)
1720         return throwError("Not enough arguments", V8Proxy::TypeError);
1721     TestObj* imp = V8TestObj::toNative(args.Holder());
1722     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);
1723     imp->convert4();
1724     return v8::Handle<v8::Value>();
1725 }
1726
1727 static v8::Handle<v8::Value> convert5Callback(const v8::Arguments& args)
1728 {
1729     INC_STATS("DOM.TestObj.convert5");
1730     if (args.Length() < 1)
1731         return throwError("Not enough arguments", V8Proxy::TypeError);
1732     TestObj* imp = V8TestObj::toNative(args.Holder());
1733     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);
1734     imp->convert5();
1735     return v8::Handle<v8::Value>();
1736 }
1737
1738 static v8::Handle<v8::Value> mutablePointFunctionCallback(const v8::Arguments& args)
1739 {
1740     INC_STATS("DOM.TestObj.mutablePointFunction");
1741     TestObj* imp = V8TestObj::toNative(args.Holder());
1742     return toV8(WTF::getPtr(SVGPropertyTearOff<FloatPoint>::create(imp->mutablePointFunction())));
1743 }
1744
1745 static v8::Handle<v8::Value> immutablePointFunctionCallback(const v8::Arguments& args)
1746 {
1747     INC_STATS("DOM.TestObj.immutablePointFunction");
1748     TestObj* imp = V8TestObj::toNative(args.Holder());
1749     return toV8(WTF::getPtr(SVGPropertyTearOff<FloatPoint>::create(imp->immutablePointFunction())));
1750 }
1751
1752 static v8::Handle<v8::Value> orangeCallback(const v8::Arguments& args)
1753 {
1754     INC_STATS("DOM.TestObj.orange");
1755     TestObj* imp = V8TestObj::toNative(args.Holder());
1756     imp->banana();
1757     return v8::Handle<v8::Value>();
1758 }
1759
1760 static v8::Handle<v8::Value> strictFunctionCallback(const v8::Arguments& args)
1761 {
1762     INC_STATS("DOM.TestObj.strictFunction");
1763     if (args.Length() < 3)
1764         return throwError("Not enough arguments", V8Proxy::TypeError);
1765     TestObj* imp = V8TestObj::toNative(args.Holder());
1766     ExceptionCode ec = 0;
1767     {
1768     STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, str, MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined));
1769     EXCEPTION_BLOCK(float, a, static_cast<float>(MAYBE_MISSING_PARAMETER(args, 1, DefaultIsUndefined)->NumberValue()));
1770     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);
1771     RefPtr<bool> result = imp->strictFunction(str, a, b, ec);
1772     if (UNLIKELY(ec))
1773         goto fail;
1774     return toV8(result.release());
1775     }
1776     fail:
1777     V8Proxy::setDOMException(ec);
1778     return v8::Handle<v8::Value>();
1779 }
1780
1781 } // namespace TestObjInternal
1782
1783 static const BatchedAttribute TestObjAttrs[] = {
1784     // Attribute 'readOnlyIntAttr' (Type: 'readonly attribute' ExtAttr: '')
1785     {"readOnlyIntAttr", TestObjInternal::readOnlyIntAttrAttrGetter, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1786     // Attribute 'readOnlyStringAttr' (Type: 'readonly attribute' ExtAttr: '')
1787     {"readOnlyStringAttr", TestObjInternal::readOnlyStringAttrAttrGetter, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1788     // Attribute 'readOnlyTestObjAttr' (Type: 'readonly attribute' ExtAttr: '')
1789     {"readOnlyTestObjAttr", TestObjInternal::readOnlyTestObjAttrAttrGetter, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1790     // Attribute 'shortAttr' (Type: 'attribute' ExtAttr: '')
1791     {"shortAttr", TestObjInternal::shortAttrAttrGetter, TestObjInternal::shortAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1792     // Attribute 'unsignedShortAttr' (Type: 'attribute' ExtAttr: '')
1793     {"unsignedShortAttr", TestObjInternal::unsignedShortAttrAttrGetter, TestObjInternal::unsignedShortAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1794     // Attribute 'intAttr' (Type: 'attribute' ExtAttr: '')
1795     {"intAttr", TestObjInternal::intAttrAttrGetter, TestObjInternal::intAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1796     // Attribute 'longLongAttr' (Type: 'attribute' ExtAttr: '')
1797     {"longLongAttr", TestObjInternal::longLongAttrAttrGetter, TestObjInternal::longLongAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1798     // Attribute 'unsignedLongLongAttr' (Type: 'attribute' ExtAttr: '')
1799     {"unsignedLongLongAttr", TestObjInternal::unsignedLongLongAttrAttrGetter, TestObjInternal::unsignedLongLongAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1800     // Attribute 'stringAttr' (Type: 'attribute' ExtAttr: '')
1801     {"stringAttr", TestObjInternal::stringAttrAttrGetter, TestObjInternal::stringAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1802     // Attribute 'testObjAttr' (Type: 'attribute' ExtAttr: '')
1803     {"testObjAttr", TestObjInternal::testObjAttrAttrGetter, TestObjInternal::testObjAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1804     // Attribute 'sequenceAttr' (Type: 'attribute' ExtAttr: '')
1805     {"sequenceAttr", TestObjInternal::sequenceAttrAttrGetter, TestObjInternal::sequenceAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1806     // Attribute 'XMLObjAttr' (Type: 'attribute' ExtAttr: '')
1807     {"XMLObjAttr", TestObjInternal::XMLObjAttrAttrGetter, TestObjInternal::XMLObjAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1808     // Attribute 'create' (Type: 'attribute' ExtAttr: '')
1809     {"create", TestObjInternal::createAttrGetter, TestObjInternal::createAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1810     // Attribute 'reflectedStringAttr' (Type: 'attribute' ExtAttr: 'Reflect')
1811     {"reflectedStringAttr", TestObjInternal::reflectedStringAttrAttrGetter, TestObjInternal::reflectedStringAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1812     // Attribute 'reflectedIntegralAttr' (Type: 'attribute' ExtAttr: 'Reflect')
1813     {"reflectedIntegralAttr", TestObjInternal::reflectedIntegralAttrAttrGetter, TestObjInternal::reflectedIntegralAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1814     // Attribute 'reflectedUnsignedIntegralAttr' (Type: 'attribute' ExtAttr: 'Reflect')
1815     {"reflectedUnsignedIntegralAttr", TestObjInternal::reflectedUnsignedIntegralAttrAttrGetter, TestObjInternal::reflectedUnsignedIntegralAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1816     // Attribute 'reflectedBooleanAttr' (Type: 'attribute' ExtAttr: 'Reflect')
1817     {"reflectedBooleanAttr", TestObjInternal::reflectedBooleanAttrAttrGetter, TestObjInternal::reflectedBooleanAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1818     // Attribute 'reflectedURLAttr' (Type: 'attribute' ExtAttr: 'URL Reflect')
1819     {"reflectedURLAttr", TestObjInternal::reflectedURLAttrAttrGetter, TestObjInternal::reflectedURLAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1820     // Attribute 'reflectedStringAttr' (Type: 'attribute' ExtAttr: 'Reflect')
1821     {"reflectedStringAttr", TestObjInternal::reflectedStringAttrAttrGetter, TestObjInternal::reflectedStringAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1822     // Attribute 'reflectedCustomIntegralAttr' (Type: 'attribute' ExtAttr: 'Reflect')
1823     {"reflectedCustomIntegralAttr", TestObjInternal::reflectedCustomIntegralAttrAttrGetter, TestObjInternal::reflectedCustomIntegralAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1824     // Attribute 'reflectedCustomBooleanAttr' (Type: 'attribute' ExtAttr: 'Reflect')
1825     {"reflectedCustomBooleanAttr", TestObjInternal::reflectedCustomBooleanAttrAttrGetter, TestObjInternal::reflectedCustomBooleanAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1826     // Attribute 'reflectedCustomURLAttr' (Type: 'attribute' ExtAttr: 'URL Reflect')
1827     {"reflectedCustomURLAttr", TestObjInternal::reflectedCustomURLAttrAttrGetter, TestObjInternal::reflectedCustomURLAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1828     // Attribute 'attrWithGetterException' (Type: 'attribute' ExtAttr: '')
1829     {"attrWithGetterException", TestObjInternal::attrWithGetterExceptionAttrGetter, TestObjInternal::attrWithGetterExceptionAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1830     // Attribute 'attrWithSetterException' (Type: 'attribute' ExtAttr: '')
1831     {"attrWithSetterException", TestObjInternal::attrWithSetterExceptionAttrGetter, TestObjInternal::attrWithSetterExceptionAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1832     // Attribute 'stringAttrWithGetterException' (Type: 'attribute' ExtAttr: '')
1833     {"stringAttrWithGetterException", TestObjInternal::stringAttrWithGetterExceptionAttrGetter, TestObjInternal::stringAttrWithGetterExceptionAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1834     // Attribute 'stringAttrWithSetterException' (Type: 'attribute' ExtAttr: '')
1835     {"stringAttrWithSetterException", TestObjInternal::stringAttrWithSetterExceptionAttrGetter, TestObjInternal::stringAttrWithSetterExceptionAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1836     // Attribute 'customAttr' (Type: 'attribute' ExtAttr: 'Custom')
1837     {"customAttr", V8TestObj::customAttrAccessorGetter, V8TestObj::customAttrAccessorSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1838     // Attribute 'withScriptStateAttribute' (Type: 'attribute' ExtAttr: 'CallWith')
1839     {"withScriptStateAttribute", TestObjInternal::withScriptStateAttributeAttrGetter, TestObjInternal::withScriptStateAttributeAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1840     // Attribute 'withScriptExecutionContextAttribute' (Type: 'attribute' ExtAttr: 'CallWith')
1841     {"withScriptExecutionContextAttribute", TestObjInternal::withScriptExecutionContextAttributeAttrGetter, TestObjInternal::withScriptExecutionContextAttributeAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1842     // Attribute 'withScriptStateAttributeRaises' (Type: 'attribute' ExtAttr: 'CallWith')
1843     {"withScriptStateAttributeRaises", TestObjInternal::withScriptStateAttributeRaisesAttrGetter, TestObjInternal::withScriptStateAttributeRaisesAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1844     // Attribute 'withScriptExecutionContextAttributeRaises' (Type: 'attribute' ExtAttr: 'CallWith')
1845     {"withScriptExecutionContextAttributeRaises", TestObjInternal::withScriptExecutionContextAttributeRaisesAttrGetter, TestObjInternal::withScriptExecutionContextAttributeRaisesAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1846     // Attribute 'withScriptExecutionContextAndScriptStateAttribute' (Type: 'attribute' ExtAttr: 'CallWith')
1847     {"withScriptExecutionContextAndScriptStateAttribute", TestObjInternal::withScriptExecutionContextAndScriptStateAttributeAttrGetter, TestObjInternal::withScriptExecutionContextAndScriptStateAttributeAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1848     // Attribute 'withScriptExecutionContextAndScriptStateAttributeRaises' (Type: 'attribute' ExtAttr: 'CallWith')
1849     {"withScriptExecutionContextAndScriptStateAttributeRaises", TestObjInternal::withScriptExecutionContextAndScriptStateAttributeRaisesAttrGetter, TestObjInternal::withScriptExecutionContextAndScriptStateAttributeRaisesAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1850     // Attribute 'withScriptExecutionContextAndScriptStateWithSpacesAttribute' (Type: 'attribute' ExtAttr: 'CallWith')
1851     {"withScriptExecutionContextAndScriptStateWithSpacesAttribute", TestObjInternal::withScriptExecutionContextAndScriptStateWithSpacesAttributeAttrGetter, TestObjInternal::withScriptExecutionContextAndScriptStateWithSpacesAttributeAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1852     // Attribute 'withScriptArgumentsAndCallStackAttribute' (Type: 'attribute' ExtAttr: 'CallWith')
1853     {"withScriptArgumentsAndCallStackAttribute", TestObjInternal::withScriptArgumentsAndCallStackAttributeAttrGetter, TestObjInternal::withScriptArgumentsAndCallStackAttributeAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1854 #if ENABLE(Condition1)
1855     // Attribute 'conditionalAttr1' (Type: 'attribute' ExtAttr: 'Conditional')
1856     {"conditionalAttr1", TestObjInternal::conditionalAttr1AttrGetter, TestObjInternal::conditionalAttr1AttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1857 #endif // ENABLE(Condition1)
1858 #if ENABLE(Condition1) && ENABLE(Condition2)
1859     // Attribute 'conditionalAttr2' (Type: 'attribute' ExtAttr: 'Conditional')
1860     {"conditionalAttr2", TestObjInternal::conditionalAttr2AttrGetter, TestObjInternal::conditionalAttr2AttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1861 #endif // ENABLE(Condition1) && ENABLE(Condition2)
1862 #if ENABLE(Condition1) || ENABLE(Condition2)
1863     // Attribute 'conditionalAttr3' (Type: 'attribute' ExtAttr: 'Conditional')
1864     {"conditionalAttr3", TestObjInternal::conditionalAttr3AttrGetter, TestObjInternal::conditionalAttr3AttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1865 #endif // ENABLE(Condition1) || ENABLE(Condition2)
1866 #if ENABLE(Condition1)
1867     // Attribute 'conditionalAttr4' (Type: 'attribute' ExtAttr: 'Conditional')
1868     {"conditionalAttr4", TestObjInternal::TestObjConstructorGetter, 0, &V8TestObjectA::info, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::ReadOnly), 0 /* on instance */},
1869 #endif // ENABLE(Condition1)
1870 #if ENABLE(Condition1) && ENABLE(Condition2)
1871     // Attribute 'conditionalAttr5' (Type: 'attribute' ExtAttr: 'Conditional')
1872     {"conditionalAttr5", TestObjInternal::TestObjConstructorGetter, 0, &V8TestObjectB::info, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::ReadOnly), 0 /* on instance */},
1873 #endif // ENABLE(Condition1) && ENABLE(Condition2)
1874 #if ENABLE(Condition1) || ENABLE(Condition2)
1875     // Attribute 'conditionalAttr6' (Type: 'attribute' ExtAttr: 'Conditional')
1876     {"conditionalAttr6", TestObjInternal::TestObjConstructorGetter, 0, &V8TestObjectC::info, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::ReadOnly), 0 /* on instance */},
1877 #endif // ENABLE(Condition1) || ENABLE(Condition2)
1878     // Attribute 'cachedAttribute1' (Type: 'readonly attribute' ExtAttr: 'CachedAttribute')
1879     {"cachedAttribute1", TestObjInternal::cachedAttribute1AttrGetter, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1880     // Attribute 'cachedAttribute2' (Type: 'readonly attribute' ExtAttr: 'CachedAttribute')
1881     {"cachedAttribute2", TestObjInternal::cachedAttribute2AttrGetter, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1882     // Attribute 'floatArray' (Type: 'attribute' ExtAttr: '')
1883     {"floatArray", TestObjInternal::floatArrayAttrGetter, TestObjInternal::floatArrayAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1884     // Attribute 'doubleArray' (Type: 'attribute' ExtAttr: '')
1885     {"doubleArray", TestObjInternal::doubleArrayAttrGetter, TestObjInternal::doubleArrayAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1886     // Attribute 'contentDocument' (Type: 'readonly attribute' ExtAttr: 'CheckSecurityForNode')
1887     {"contentDocument", TestObjInternal::contentDocumentAttrGetter, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1888     // Attribute 'mutablePoint' (Type: 'attribute' ExtAttr: '')
1889     {"mutablePoint", TestObjInternal::mutablePointAttrGetter, TestObjInternal::mutablePointAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1890     // Attribute 'immutablePoint' (Type: 'attribute' ExtAttr: 'Immutable')
1891     {"immutablePoint", TestObjInternal::immutablePointAttrGetter, TestObjInternal::immutablePointAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1892     // Attribute 'strictFloat' (Type: 'attribute' ExtAttr: 'StrictTypeChecking')
1893     {"strictFloat", TestObjInternal::strictFloatAttrGetter, TestObjInternal::strictFloatAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1894     // Attribute 'description' (Type: 'readonly attribute' ExtAttr: '')
1895     {"description", TestObjInternal::descriptionAttrGetter, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1896     // Attribute 'id' (Type: 'attribute' ExtAttr: '')
1897     {"id", TestObjInternal::idAttrGetter, TestObjInternal::idAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1898     // Attribute 'hash' (Type: 'readonly attribute' ExtAttr: '')
1899     {"hash", TestObjInternal::hashAttrGetter, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1900 };
1901
1902 static const BatchedCallback TestObjCallbacks[] = {
1903     {"voidMethod", TestObjInternal::voidMethodCallback},
1904     {"intMethod", TestObjInternal::intMethodCallback},
1905     {"objMethod", TestObjInternal::objMethodCallback},
1906     {"methodReturningSequence", TestObjInternal::methodReturningSequenceCallback},
1907     {"serializedValue", TestObjInternal::serializedValueCallback},
1908     {"idbKey", TestObjInternal::idbKeyCallback},
1909     {"optionsObject", TestObjInternal::optionsObjectCallback},
1910     {"methodWithException", TestObjInternal::methodWithExceptionCallback},
1911     {"customMethod", V8TestObj::customMethodCallback},
1912     {"customMethodWithArgs", V8TestObj::customMethodWithArgsCallback},
1913     {"addEventListener", TestObjInternal::addEventListenerCallback},
1914     {"removeEventListener", TestObjInternal::removeEventListenerCallback},
1915     {"withScriptStateVoid", TestObjInternal::withScriptStateVoidCallback},
1916     {"withScriptStateObj", TestObjInternal::withScriptStateObjCallback},
1917     {"withScriptStateVoidException", TestObjInternal::withScriptStateVoidExceptionCallback},
1918     {"withScriptStateObjException", TestObjInternal::withScriptStateObjExceptionCallback},
1919     {"withScriptExecutionContext", TestObjInternal::withScriptExecutionContextCallback},
1920     {"withScriptExecutionContextAndScriptState", TestObjInternal::withScriptExecutionContextAndScriptStateCallback},
1921     {"withScriptExecutionContextAndScriptStateObjException", TestObjInternal::withScriptExecutionContextAndScriptStateObjExceptionCallback},
1922     {"withScriptExecutionContextAndScriptStateWithSpaces", TestObjInternal::withScriptExecutionContextAndScriptStateWithSpacesCallback},
1923     {"withScriptArgumentsAndCallStack", TestObjInternal::withScriptArgumentsAndCallStackCallback},
1924     {"methodWithOptionalArg", TestObjInternal::methodWithOptionalArgCallback},
1925     {"methodWithNonOptionalArgAndOptionalArg", TestObjInternal::methodWithNonOptionalArgAndOptionalArgCallback},
1926     {"methodWithNonOptionalArgAndTwoOptionalArgs", TestObjInternal::methodWithNonOptionalArgAndTwoOptionalArgsCallback},
1927     {"methodWithOptionalString", TestObjInternal::methodWithOptionalStringCallback},
1928     {"methodWithOptionalStringIsUndefined", TestObjInternal::methodWithOptionalStringIsUndefinedCallback},
1929     {"methodWithOptionalStringIsNullString", TestObjInternal::methodWithOptionalStringIsNullStringCallback},
1930     {"methodWithCallbackArg", TestObjInternal::methodWithCallbackArgCallback},
1931     {"methodWithNonCallbackArgAndCallbackArg", TestObjInternal::methodWithNonCallbackArgAndCallbackArgCallback},
1932     {"methodWithCallbackAndOptionalArg", TestObjInternal::methodWithCallbackAndOptionalArgCallback},
1933 #if ENABLE(Condition1)
1934     {"conditionalMethod1", TestObjInternal::conditionalMethod1Callback},
1935 #endif
1936 #if ENABLE(Condition1) && ENABLE(Condition2)
1937     {"conditionalMethod2", TestObjInternal::conditionalMethod2Callback},
1938 #endif
1939 #if ENABLE(Condition1) || ENABLE(Condition2)
1940     {"conditionalMethod3", TestObjInternal::conditionalMethod3Callback},
1941 #endif
1942     {"overloadedMethod", TestObjInternal::overloadedMethodCallback},
1943     {"getSVGDocument", TestObjInternal::getSVGDocumentCallback},
1944     {"mutablePointFunction", TestObjInternal::mutablePointFunctionCallback},
1945     {"immutablePointFunction", TestObjInternal::immutablePointFunctionCallback},
1946     {"orange", TestObjInternal::orangeCallback},
1947     {"strictFunction", TestObjInternal::strictFunctionCallback},
1948 };
1949
1950 static const BatchedConstant TestObjConsts[] = {
1951 #if ENABLE(Condition1)
1952     {"CONDITIONAL_CONST", static_cast<signed int>(0)},
1953 #endif
1954     {"CONST_VALUE_0", static_cast<signed int>(0)},
1955     {"CONST_VALUE_1", static_cast<signed int>(1)},
1956     {"CONST_VALUE_2", static_cast<signed int>(2)},
1957     {"CONST_VALUE_4", static_cast<signed int>(4)},
1958     {"CONST_VALUE_8", static_cast<signed int>(8)},
1959     {"CONST_VALUE_9", static_cast<signed int>(-1)},
1960     {"CONST_VALUE_10", static_cast<signed int>("my constant string")},
1961     {"CONST_VALUE_11", static_cast<signed int>(0xffffffff)},
1962     {"CONST_VALUE_12", static_cast<signed int>(0x01)},
1963     {"CONST_VALUE_13", static_cast<signed int>(0X20)},
1964     {"CONST_VALUE_14", static_cast<signed int>(0x1abc)},
1965     {"CONST_JAVASCRIPT", static_cast<signed int>(15)},
1966 };
1967
1968
1969 #if ENABLE(Condition1)
1970 COMPILE_ASSERT(0 == TestObj::CONDITIONAL_CONST, TestObjEnumCONDITIONAL_CONSTIsWrongUseDoNotCheckConstants);
1971 #endif
1972 COMPILE_ASSERT(0 == TestObj::CONST_VALUE_0, TestObjEnumCONST_VALUE_0IsWrongUseDoNotCheckConstants);
1973 COMPILE_ASSERT(1 == TestObj::CONST_VALUE_1, TestObjEnumCONST_VALUE_1IsWrongUseDoNotCheckConstants);
1974 COMPILE_ASSERT(2 == TestObj::CONST_VALUE_2, TestObjEnumCONST_VALUE_2IsWrongUseDoNotCheckConstants);
1975 COMPILE_ASSERT(4 == TestObj::CONST_VALUE_4, TestObjEnumCONST_VALUE_4IsWrongUseDoNotCheckConstants);
1976 COMPILE_ASSERT(8 == TestObj::CONST_VALUE_8, TestObjEnumCONST_VALUE_8IsWrongUseDoNotCheckConstants);
1977 COMPILE_ASSERT(-1 == TestObj::CONST_VALUE_9, TestObjEnumCONST_VALUE_9IsWrongUseDoNotCheckConstants);
1978 COMPILE_ASSERT("my constant string" == TestObj::CONST_VALUE_10, TestObjEnumCONST_VALUE_10IsWrongUseDoNotCheckConstants);
1979 COMPILE_ASSERT(0xffffffff == TestObj::CONST_VALUE_11, TestObjEnumCONST_VALUE_11IsWrongUseDoNotCheckConstants);
1980 COMPILE_ASSERT(0x01 == TestObj::CONST_VALUE_12, TestObjEnumCONST_VALUE_12IsWrongUseDoNotCheckConstants);
1981 COMPILE_ASSERT(0X20 == TestObj::CONST_VALUE_13, TestObjEnumCONST_VALUE_13IsWrongUseDoNotCheckConstants);
1982 COMPILE_ASSERT(0x1abc == TestObj::CONST_VALUE_14, TestObjEnumCONST_VALUE_14IsWrongUseDoNotCheckConstants);
1983 COMPILE_ASSERT(15 == TestObj::CONST_IMPL, TestObjEnumCONST_IMPLIsWrongUseDoNotCheckConstants);
1984
1985 v8::Handle<v8::Value> V8TestObj::constructorCallback(const v8::Arguments& args)
1986 {
1987     INC_STATS("DOM.TestObj.Constructor");
1988
1989     if (!args.IsConstructCall())
1990         return throwError("DOM object constructor cannot be called as a function.", V8Proxy::TypeError);
1991
1992     if (ConstructorMode::current() == ConstructorMode::WrapExistingObject)
1993         return args.Holder();
1994     if (args.Length() < 1)
1995         return throwError("Not enough arguments", V8Proxy::TypeError);
1996     if (args.Length() <= 0 || !args[0]->IsFunction())
1997         return throwError(TYPE_MISMATCH_ERR);
1998     RefPtr<TestCallback> testCallback = V8TestCallback::create(args[0], getScriptExecutionContext());
1999
2000     RefPtr<TestObj> impl = TestObj::create(testCallback);
2001     v8::Handle<v8::Object> wrapper = args.Holder();
2002
2003     V8DOMWrapper::setDOMWrapper(wrapper, &info, impl.get());
2004     impl->ref();
2005     V8DOMWrapper::setJSWrapperForDOMObject(impl.get(), v8::Persistent<v8::Object>::New(wrapper));
2006     return args.Holder();
2007 }
2008
2009 static v8::Persistent<v8::FunctionTemplate> ConfigureV8TestObjTemplate(v8::Persistent<v8::FunctionTemplate> desc)
2010 {
2011     desc->ReadOnlyPrototype();
2012
2013     v8::Local<v8::Signature> defaultSignature;
2014     defaultSignature = configureTemplate(desc, "TestObject", v8::Persistent<v8::FunctionTemplate>(), V8TestObj::internalFieldCount,
2015         TestObjAttrs, WTF_ARRAY_LENGTH(TestObjAttrs),
2016         TestObjCallbacks, WTF_ARRAY_LENGTH(TestObjCallbacks));
2017     UNUSED_PARAM(defaultSignature); // In some cases, it will not be used.
2018     desc->SetCallHandler(V8TestObj::constructorCallback);
2019     v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate();
2020     v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate();
2021     UNUSED_PARAM(instance); // In some cases, it will not be used.
2022     UNUSED_PARAM(proto); // In some cases, it will not be used.
2023     
2024     if (RuntimeEnabledFeatures::enabledAtRuntimeAttr1Enabled()) {
2025         static const BatchedAttribute attrData =\
2026         // Attribute 'enabledAtRuntimeAttr1' (Type: 'attribute' ExtAttr: 'V8EnabledAtRuntime')
2027         {"enabledAtRuntimeAttr1", TestObjInternal::enabledAtRuntimeAttr1AttrGetter, TestObjInternal::enabledAtRuntimeAttr1AttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */};
2028         configureAttribute(instance, proto, attrData);
2029     }
2030     if (RuntimeEnabledFeatures::featureNameEnabled()) {
2031         static const BatchedAttribute attrData =\
2032         // Attribute 'enabledAtRuntimeAttr2' (Type: 'attribute' ExtAttr: 'V8EnabledAtRuntime')
2033         {"enabledAtRuntimeAttr2", TestObjInternal::enabledAtRuntimeAttr2AttrGetter, TestObjInternal::enabledAtRuntimeAttr2AttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */};
2034         configureAttribute(instance, proto, attrData);
2035     }
2036
2037     // Custom Signature 'voidMethodWithArgs'
2038     const int voidMethodWithArgsArgc = 3;
2039     v8::Handle<v8::FunctionTemplate> voidMethodWithArgsArgv[voidMethodWithArgsArgc] = { v8::Handle<v8::FunctionTemplate>(), v8::Handle<v8::FunctionTemplate>(), V8TestObj::GetRawTemplate() };
2040     v8::Handle<v8::Signature> voidMethodWithArgsSignature = v8::Signature::New(desc, voidMethodWithArgsArgc, voidMethodWithArgsArgv);
2041     proto->Set(v8::String::New("voidMethodWithArgs"), v8::FunctionTemplate::New(TestObjInternal::voidMethodWithArgsCallback, v8::Handle<v8::Value>(), voidMethodWithArgsSignature));
2042
2043     // Custom Signature 'intMethodWithArgs'
2044     const int intMethodWithArgsArgc = 3;
2045     v8::Handle<v8::FunctionTemplate> intMethodWithArgsArgv[intMethodWithArgsArgc] = { v8::Handle<v8::FunctionTemplate>(), v8::Handle<v8::FunctionTemplate>(), V8TestObj::GetRawTemplate() };
2046     v8::Handle<v8::Signature> intMethodWithArgsSignature = v8::Signature::New(desc, intMethodWithArgsArgc, intMethodWithArgsArgv);
2047     proto->Set(v8::String::New("intMethodWithArgs"), v8::FunctionTemplate::New(TestObjInternal::intMethodWithArgsCallback, v8::Handle<v8::Value>(), intMethodWithArgsSignature));
2048
2049     // Custom Signature 'objMethodWithArgs'
2050     const int objMethodWithArgsArgc = 3;
2051     v8::Handle<v8::FunctionTemplate> objMethodWithArgsArgv[objMethodWithArgsArgc] = { v8::Handle<v8::FunctionTemplate>(), v8::Handle<v8::FunctionTemplate>(), V8TestObj::GetRawTemplate() };
2052     v8::Handle<v8::Signature> objMethodWithArgsSignature = v8::Signature::New(desc, objMethodWithArgsArgc, objMethodWithArgsArgv);
2053     proto->Set(v8::String::New("objMethodWithArgs"), v8::FunctionTemplate::New(TestObjInternal::objMethodWithArgsCallback, v8::Handle<v8::Value>(), objMethodWithArgsSignature));
2054
2055     // Custom Signature 'methodWithSequenceArg'
2056     const int methodWithSequenceArgArgc = 1;
2057     v8::Handle<v8::FunctionTemplate> methodWithSequenceArgArgv[methodWithSequenceArgArgc] = { V8sequence::GetRawTemplate() };
2058     v8::Handle<v8::Signature> methodWithSequenceArgSignature = v8::Signature::New(desc, methodWithSequenceArgArgc, methodWithSequenceArgArgv);
2059     proto->Set(v8::String::New("methodWithSequenceArg"), v8::FunctionTemplate::New(TestObjInternal::methodWithSequenceArgCallback, v8::Handle<v8::Value>(), methodWithSequenceArgSignature));
2060
2061     // Custom Signature 'methodThatRequiresAllArgsAndThrows'
2062     const int methodThatRequiresAllArgsAndThrowsArgc = 2;
2063     v8::Handle<v8::FunctionTemplate> methodThatRequiresAllArgsAndThrowsArgv[methodThatRequiresAllArgsAndThrowsArgc] = { v8::Handle<v8::FunctionTemplate>(), V8TestObj::GetRawTemplate() };
2064     v8::Handle<v8::Signature> methodThatRequiresAllArgsAndThrowsSignature = v8::Signature::New(desc, methodThatRequiresAllArgsAndThrowsArgc, methodThatRequiresAllArgsAndThrowsArgv);
2065     proto->Set(v8::String::New("methodThatRequiresAllArgsAndThrows"), v8::FunctionTemplate::New(TestObjInternal::methodThatRequiresAllArgsAndThrowsCallback, v8::Handle<v8::Value>(), methodThatRequiresAllArgsAndThrowsSignature));
2066     desc->Set(v8::String::New("classMethod"), v8::FunctionTemplate::New(TestObjInternal::classMethodCallback, v8::Handle<v8::Value>(), v8::Local<v8::Signature>()));
2067     desc->Set(v8::String::New("classMethodWithOptional"), v8::FunctionTemplate::New(TestObjInternal::classMethodWithOptionalCallback, v8::Handle<v8::Value>(), v8::Local<v8::Signature>()));
2068     desc->Set(v8::String::New("classMethod2"), v8::FunctionTemplate::New(V8TestObj::classMethod2Callback, v8::Handle<v8::Value>(), v8::Local<v8::Signature>()));
2069 #if ENABLE(Condition1)
2070     desc->Set(v8::String::New("overloadedMethod1"), v8::FunctionTemplate::New(TestObjInternal::overloadedMethod1Callback, v8::Handle<v8::Value>(), v8::Local<v8::Signature>()));
2071 #endif // ENABLE(Condition1)
2072     if (RuntimeEnabledFeatures::enabledAtRuntimeMethod1Enabled())
2073         proto->Set(v8::String::New("enabledAtRuntimeMethod1"), v8::FunctionTemplate::New(TestObjInternal::enabledAtRuntimeMethod1Callback, v8::Handle<v8::Value>(), defaultSignature));
2074     if (RuntimeEnabledFeatures::featureNameEnabled())
2075         proto->Set(v8::String::New("enabledAtRuntimeMethod2"), v8::FunctionTemplate::New(TestObjInternal::enabledAtRuntimeMethod2Callback, v8::Handle<v8::Value>(), defaultSignature));
2076
2077     // Custom Signature 'convert1'
2078     const int convert1Argc = 1;
2079     v8::Handle<v8::FunctionTemplate> convert1Argv[convert1Argc] = { V8a::GetRawTemplate() };
2080     v8::Handle<v8::Signature> convert1Signature = v8::Signature::New(desc, convert1Argc, convert1Argv);
2081     proto->Set(v8::String::New("convert1"), v8::FunctionTemplate::New(TestObjInternal::convert1Callback, v8::Handle<v8::Value>(), convert1Signature));
2082
2083     // Custom Signature 'convert2'
2084     const int convert2Argc = 1;
2085     v8::Handle<v8::FunctionTemplate> convert2Argv[convert2Argc] = { V8b::GetRawTemplate() };
2086     v8::Handle<v8::Signature> convert2Signature = v8::Signature::New(desc, convert2Argc, convert2Argv);
2087     proto->Set(v8::String::New("convert2"), v8::FunctionTemplate::New(TestObjInternal::convert2Callback, v8::Handle<v8::Value>(), convert2Signature));
2088
2089     // Custom Signature 'convert3'
2090     const int convert3Argc = 1;
2091     v8::Handle<v8::FunctionTemplate> convert3Argv[convert3Argc] = { V8c::GetRawTemplate() };
2092     v8::Handle<v8::Signature> convert3Signature = v8::Signature::New(desc, convert3Argc, convert3Argv);
2093     proto->Set(v8::String::New("convert3"), v8::FunctionTemplate::New(TestObjInternal::convert3Callback, v8::Handle<v8::Value>(), convert3Signature));
2094
2095     // Custom Signature 'convert4'
2096     const int convert4Argc = 1;
2097     v8::Handle<v8::FunctionTemplate> convert4Argv[convert4Argc] = { V8d::GetRawTemplate() };
2098     v8::Handle<v8::Signature> convert4Signature = v8::Signature::New(desc, convert4Argc, convert4Argv);
2099     proto->Set(v8::String::New("convert4"), v8::FunctionTemplate::New(TestObjInternal::convert4Callback, v8::Handle<v8::Value>(), convert4Signature));
2100
2101     // Custom Signature 'convert5'
2102     const int convert5Argc = 1;
2103     v8::Handle<v8::FunctionTemplate> convert5Argv[convert5Argc] = { V8e::GetRawTemplate() };
2104     v8::Handle<v8::Signature> convert5Signature = v8::Signature::New(desc, convert5Argc, convert5Argv);
2105     proto->Set(v8::String::New("convert5"), v8::FunctionTemplate::New(TestObjInternal::convert5Callback, v8::Handle<v8::Value>(), convert5Signature));
2106     batchConfigureConstants(desc, proto, TestObjConsts, WTF_ARRAY_LENGTH(TestObjConsts));
2107
2108     // Custom toString template
2109     desc->Set(getToStringName(), getToStringTemplate());
2110     return desc;
2111 }
2112
2113 v8::Persistent<v8::FunctionTemplate> V8TestObj::GetRawTemplate()
2114 {
2115     V8BindingPerIsolateData* data = V8BindingPerIsolateData::current();
2116     V8BindingPerIsolateData::TemplateMap::iterator result = data->rawTemplateMap().find(&info);
2117     if (result != data->rawTemplateMap().end())
2118         return result->second;
2119
2120     v8::HandleScope handleScope;
2121     v8::Persistent<v8::FunctionTemplate> templ = createRawTemplate();
2122     data->rawTemplateMap().add(&info, templ);
2123     return templ;
2124 }
2125
2126 v8::Persistent<v8::FunctionTemplate> V8TestObj::GetTemplate()
2127 {
2128     V8BindingPerIsolateData* data = V8BindingPerIsolateData::current();
2129     V8BindingPerIsolateData::TemplateMap::iterator result = data->templateMap().find(&info);
2130     if (result != data->templateMap().end())
2131         return result->second;
2132
2133     v8::HandleScope handleScope;
2134     v8::Persistent<v8::FunctionTemplate> templ =
2135         ConfigureV8TestObjTemplate(GetRawTemplate());
2136     data->templateMap().add(&info, templ);
2137     return templ;
2138 }
2139
2140 bool V8TestObj::HasInstance(v8::Handle<v8::Value> value)
2141 {
2142     return GetRawTemplate()->HasInstance(value);
2143 }
2144
2145
2146 v8::Handle<v8::Object> V8TestObj::wrapSlow(PassRefPtr<TestObj> impl)
2147 {
2148     v8::Handle<v8::Object> wrapper;
2149     V8Proxy* proxy = 0;
2150     wrapper = V8DOMWrapper::instantiateV8Object(proxy, &info, impl.get());
2151     if (UNLIKELY(wrapper.IsEmpty()))
2152         return wrapper;
2153
2154     v8::Persistent<v8::Object> wrapperHandle = v8::Persistent<v8::Object>::New(wrapper);
2155
2156     if (!hasDependentLifetime)
2157         wrapperHandle.MarkIndependent();
2158     getDOMObjectMap().set(impl.leakRef(), wrapperHandle);
2159     return wrapper;
2160 }
2161
2162 void V8TestObj::derefObject(void* object)
2163 {
2164     static_cast<TestObj*>(object)->deref();
2165 }
2166
2167 } // namespace WebCore