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