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