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