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