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