OLD | NEW |
| (Empty) |
1 /* | |
2 This file is part of the Blink open source project. | |
3 This file has been auto-generated by CodeGeneratorV8.pm. 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 "HTMLNames.h" | |
25 #include "RuntimeEnabledFeatures.h" | |
26 #include "ScriptProfile.h" | |
27 #include "V8DOMStringList.h" | |
28 #include "V8Document.h" | |
29 #include "V8Float32Array.h" | |
30 #include "V8Node.h" | |
31 #include "V8SVGDocument.h" | |
32 #include "V8SVGPoint.h" | |
33 #include "V8ScriptProfile.h" | |
34 #include "V8TestCallback.h" | |
35 #include "V8TestNode.h" | |
36 #include "V8TestSubObj.h" | |
37 #include "bindings/v8/BindingSecurity.h" | |
38 #include "bindings/v8/Dictionary.h" | |
39 #include "bindings/v8/ScriptController.h" | |
40 #include "bindings/v8/ScriptValue.h" | |
41 #include "bindings/v8/SerializedScriptValue.h" | |
42 #include "bindings/v8/V8Binding.h" | |
43 #include "bindings/v8/V8Collection.h" | |
44 #include "bindings/v8/V8DOMActivityLogger.h" | |
45 #include "bindings/v8/V8DOMConfiguration.h" | |
46 #include "bindings/v8/V8DOMWrapper.h" | |
47 #include "bindings/v8/V8EventListenerList.h" | |
48 #include "bindings/v8/V8HiddenPropertyName.h" | |
49 #include "bindings/v8/V8ObjectConstructor.h" | |
50 #include "core/dom/ContextFeatures.h" | |
51 #include "core/dom/DOMStringList.h" | |
52 #include "core/dom/Document.h" | |
53 #include "core/dom/ExceptionCode.h" | |
54 #include "core/page/Frame.h" | |
55 #include "core/page/PageConsole.h" | |
56 #include "core/page/UseCounter.h" | |
57 #include "core/svg/properties/SVGPropertyTearOff.h" | |
58 #include "core/svg/properties/SVGStaticPropertyTearOff.h" | |
59 #include "wtf/Float32Array.h" | |
60 #include "wtf/GetPtr.h" | |
61 #include "wtf/RefCounted.h" | |
62 #include "wtf/RefPtr.h" | |
63 #include "wtf/UnusedParam.h" | |
64 #include "wtf/Vector.h" | |
65 | |
66 #if ENABLE(Condition1) | |
67 #include "V8TestObjectA.h" | |
68 #endif | |
69 | |
70 #if ENABLE(Condition1) && ENABLE(Condition2) | |
71 #include "V8TestObjectB.h" | |
72 #endif | |
73 | |
74 #if ENABLE(Condition1) || ENABLE(Condition2) | |
75 #include "V8TestObjectC.h" | |
76 #endif | |
77 | |
78 #if ENABLE(BINDING_INTEGRITY) | |
79 #if defined(OS_WIN) | |
80 #pragma warning(disable: 4483) | |
81 extern "C" { extern void (*const __identifier("??_7TestObj@WebCore@@6B@")[])();
} | |
82 #else | |
83 extern "C" { extern void* _ZTVN7WebCore7TestObjE[]; } | |
84 #endif | |
85 #endif // ENABLE(BINDING_INTEGRITY) | |
86 | |
87 namespace WebCore { | |
88 | |
89 #if ENABLE(BINDING_INTEGRITY) | |
90 // This checks if a DOM object that is about to be wrapped is valid. | |
91 // Specifically, it checks that a vtable of the DOM object is equal to | |
92 // a vtable of an expected class. | |
93 // Due to a dangling pointer, the DOM object you are wrapping might be | |
94 // already freed or realloced. If freed, the check will fail because | |
95 // a free list pointer should be stored at the head of the DOM object. | |
96 // If realloced, the check will fail because the vtable of the DOM object | |
97 // differs from the expected vtable (unless the same class of DOM object | |
98 // is realloced on the slot). | |
99 inline void checkTypeOrDieTrying(TestObj* object) | |
100 { | |
101 void* actualVTablePointer = *(reinterpret_cast<void**>(object)); | |
102 #if defined(OS_WIN) | |
103 void* expectedVTablePointer = reinterpret_cast<void*>(__identifier("??_7Test
Obj@WebCore@@6B@")); | |
104 #else | |
105 void* expectedVTablePointer = &_ZTVN7WebCore7TestObjE[2]; | |
106 #endif | |
107 if (actualVTablePointer != expectedVTablePointer) | |
108 CRASH(); | |
109 } | |
110 #endif // ENABLE(BINDING_INTEGRITY) | |
111 | |
112 #if defined(OS_WIN) | |
113 // In ScriptWrappable, the use of extern function prototypes inside templated st
atic methods has an issue on windows. | |
114 // These prototypes do not pick up the surrounding namespace, so drop out of Web
Core as a workaround. | |
115 } // namespace WebCore | |
116 using WebCore::ScriptWrappable; | |
117 using WebCore::V8TestObj; | |
118 using WebCore::TestObj; | |
119 #endif | |
120 void initializeScriptWrappableForInterface(TestObj* object) | |
121 { | |
122 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) | |
123 ScriptWrappable::setTypeInfoInObject(object, &V8TestObj::info); | |
124 } | |
125 #if defined(OS_WIN) | |
126 namespace WebCore { | |
127 #endif | |
128 WrapperTypeInfo V8TestObj::info = { V8TestObj::GetTemplate, V8TestObj::derefObje
ct, 0, 0, 0, V8TestObj::installPerContextPrototypeProperties, 0, WrapperTypeObje
ctPrototype }; | |
129 | |
130 namespace TestObjV8Internal { | |
131 | |
132 template <typename T> void V8_USE(T) { } | |
133 | |
134 static v8::Handle<v8::Value> readOnlyLongAttrAttrGetter(v8::Local<v8::String> na
me, const v8::AccessorInfo& info) | |
135 { | |
136 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
137 return v8Integer(imp->readOnlyLongAttr(), info.GetIsolate()); | |
138 } | |
139 | |
140 static v8::Handle<v8::Value> readOnlyLongAttrAttrGetterCallback(v8::Local<v8::St
ring> name, const v8::AccessorInfo& info) | |
141 { | |
142 return TestObjV8Internal::readOnlyLongAttrAttrGetter(name, info); | |
143 } | |
144 | |
145 static v8::Handle<v8::Value> readOnlyStringAttrAttrGetter(v8::Local<v8::String>
name, const v8::AccessorInfo& info) | |
146 { | |
147 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
148 return v8String(imp->readOnlyStringAttr(), info.GetIsolate(), ReturnUnsafeHa
ndle); | |
149 } | |
150 | |
151 static v8::Handle<v8::Value> readOnlyStringAttrAttrGetterCallback(v8::Local<v8::
String> name, const v8::AccessorInfo& info) | |
152 { | |
153 return TestObjV8Internal::readOnlyStringAttrAttrGetter(name, info); | |
154 } | |
155 | |
156 static v8::Handle<v8::Value> readOnlyTestObjAttrAttrGetter(v8::Local<v8::String>
name, const v8::AccessorInfo& info) | |
157 { | |
158 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
159 RefPtr<TestObj> result = imp->readOnlyTestObjAttr(); | |
160 v8::Handle<v8::Value> wrapper = result.get() ? v8::Handle<v8::Value>(DOMData
Store::getWrapper(result.get(), info.GetIsolate())) : v8Undefined(); | |
161 if (wrapper.IsEmpty()) { | |
162 wrapper = toV8(result.get(), info.Holder(), info.GetIsolate()); | |
163 if (!wrapper.IsEmpty()) | |
164 V8HiddenPropertyName::setNamedHiddenReference(info.Holder(), "readOn
lyTestObjAttr", wrapper); | |
165 } | |
166 return wrapper; | |
167 } | |
168 | |
169 static v8::Handle<v8::Value> readOnlyTestObjAttrAttrGetterCallback(v8::Local<v8:
:String> name, const v8::AccessorInfo& info) | |
170 { | |
171 return TestObjV8Internal::readOnlyTestObjAttrAttrGetter(name, info); | |
172 } | |
173 | |
174 static v8::Handle<v8::Value> staticReadOnlyLongAttrAttrGetter(v8::Local<v8::Stri
ng> name, const v8::AccessorInfo& info) | |
175 { | |
176 return v8Integer(TestObj::staticReadOnlyLongAttr(), info.GetIsolate()); | |
177 } | |
178 | |
179 static v8::Handle<v8::Value> staticReadOnlyLongAttrAttrGetterCallback(v8::Local<
v8::String> name, const v8::AccessorInfo& info) | |
180 { | |
181 return TestObjV8Internal::staticReadOnlyLongAttrAttrGetter(name, info); | |
182 } | |
183 | |
184 static v8::Handle<v8::Value> staticStringAttrAttrGetter(v8::Local<v8::String> na
me, const v8::AccessorInfo& info) | |
185 { | |
186 return v8String(TestObj::staticStringAttr(), info.GetIsolate(), ReturnUnsafe
Handle); | |
187 } | |
188 | |
189 static v8::Handle<v8::Value> staticStringAttrAttrGetterCallback(v8::Local<v8::St
ring> name, const v8::AccessorInfo& info) | |
190 { | |
191 return TestObjV8Internal::staticStringAttrAttrGetter(name, info); | |
192 } | |
193 | |
194 static void staticStringAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8:
:Value> value, const v8::AccessorInfo& info) | |
195 { | |
196 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, v, value); | |
197 TestObj::setStaticStringAttr(v); | |
198 return; | |
199 } | |
200 | |
201 static void staticStringAttrAttrSetterCallback(v8::Local<v8::String> name, v8::L
ocal<v8::Value> value, const v8::AccessorInfo& info) | |
202 { | |
203 TestObjV8Internal::staticStringAttrAttrSetter(name, value, info); | |
204 } | |
205 | |
206 static v8::Handle<v8::Value> enumAttrAttrGetter(v8::Local<v8::String> name, cons
t v8::AccessorInfo& info) | |
207 { | |
208 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
209 return v8String(imp->enumAttr(), info.GetIsolate(), ReturnUnsafeHandle); | |
210 } | |
211 | |
212 static v8::Handle<v8::Value> enumAttrAttrGetterCallback(v8::Local<v8::String> na
me, const v8::AccessorInfo& info) | |
213 { | |
214 return TestObjV8Internal::enumAttrAttrGetter(name, info); | |
215 } | |
216 | |
217 static void enumAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value>
value, const v8::AccessorInfo& info) | |
218 { | |
219 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
220 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, v, value); | |
221 String string = v; | |
222 if (!(string == "" || string == "EnumValue1" || string == "EnumValue2" || st
ring == "EnumValue3")) | |
223 return; | |
224 imp->setEnumAttr(v); | |
225 return; | |
226 } | |
227 | |
228 static void enumAttrAttrSetterCallback(v8::Local<v8::String> name, v8::Local<v8:
:Value> value, const v8::AccessorInfo& info) | |
229 { | |
230 TestObjV8Internal::enumAttrAttrSetter(name, value, info); | |
231 } | |
232 | |
233 static v8::Handle<v8::Value> readOnlyEnumAttrAttrGetter(v8::Local<v8::String> na
me, const v8::AccessorInfo& info) | |
234 { | |
235 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
236 return v8String(imp->readOnlyEnumAttr(), info.GetIsolate(), ReturnUnsafeHand
le); | |
237 } | |
238 | |
239 static v8::Handle<v8::Value> readOnlyEnumAttrAttrGetterCallback(v8::Local<v8::St
ring> name, const v8::AccessorInfo& info) | |
240 { | |
241 return TestObjV8Internal::readOnlyEnumAttrAttrGetter(name, info); | |
242 } | |
243 | |
244 static v8::Handle<v8::Value> shortAttrAttrGetter(v8::Local<v8::String> name, con
st v8::AccessorInfo& info) | |
245 { | |
246 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
247 return v8Integer(imp->shortAttr(), info.GetIsolate()); | |
248 } | |
249 | |
250 static v8::Handle<v8::Value> shortAttrAttrGetterCallback(v8::Local<v8::String> n
ame, const v8::AccessorInfo& info) | |
251 { | |
252 return TestObjV8Internal::shortAttrAttrGetter(name, info); | |
253 } | |
254 | |
255 static void shortAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value>
value, const v8::AccessorInfo& info) | |
256 { | |
257 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
258 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
259 imp->setShortAttr(v); | |
260 return; | |
261 } | |
262 | |
263 static void shortAttrAttrSetterCallback(v8::Local<v8::String> name, v8::Local<v8
::Value> value, const v8::AccessorInfo& info) | |
264 { | |
265 TestObjV8Internal::shortAttrAttrSetter(name, value, info); | |
266 } | |
267 | |
268 static v8::Handle<v8::Value> unsignedShortAttrAttrGetter(v8::Local<v8::String> n
ame, const v8::AccessorInfo& info) | |
269 { | |
270 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
271 return v8Integer(imp->unsignedShortAttr(), info.GetIsolate()); | |
272 } | |
273 | |
274 static v8::Handle<v8::Value> unsignedShortAttrAttrGetterCallback(v8::Local<v8::S
tring> name, const v8::AccessorInfo& info) | |
275 { | |
276 return TestObjV8Internal::unsignedShortAttrAttrGetter(name, info); | |
277 } | |
278 | |
279 static void unsignedShortAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8
::Value> value, const v8::AccessorInfo& info) | |
280 { | |
281 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
282 V8TRYCATCH_VOID(int, v, toUInt32(value)); | |
283 imp->setUnsignedShortAttr(v); | |
284 return; | |
285 } | |
286 | |
287 static void unsignedShortAttrAttrSetterCallback(v8::Local<v8::String> name, v8::
Local<v8::Value> value, const v8::AccessorInfo& info) | |
288 { | |
289 TestObjV8Internal::unsignedShortAttrAttrSetter(name, value, info); | |
290 } | |
291 | |
292 static v8::Handle<v8::Value> longAttrAttrGetter(v8::Local<v8::String> name, cons
t v8::AccessorInfo& info) | |
293 { | |
294 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
295 return v8Integer(imp->longAttr(), info.GetIsolate()); | |
296 } | |
297 | |
298 static v8::Handle<v8::Value> longAttrAttrGetterCallback(v8::Local<v8::String> na
me, const v8::AccessorInfo& info) | |
299 { | |
300 return TestObjV8Internal::longAttrAttrGetter(name, info); | |
301 } | |
302 | |
303 static void longAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value>
value, const v8::AccessorInfo& info) | |
304 { | |
305 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
306 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
307 imp->setLongAttr(v); | |
308 return; | |
309 } | |
310 | |
311 static void longAttrAttrSetterCallback(v8::Local<v8::String> name, v8::Local<v8:
:Value> value, const v8::AccessorInfo& info) | |
312 { | |
313 TestObjV8Internal::longAttrAttrSetter(name, value, info); | |
314 } | |
315 | |
316 static v8::Handle<v8::Value> longLongAttrAttrGetter(v8::Local<v8::String> name,
const v8::AccessorInfo& info) | |
317 { | |
318 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
319 return v8::Number::New(static_cast<double>(imp->longLongAttr())); | |
320 } | |
321 | |
322 static v8::Handle<v8::Value> longLongAttrAttrGetterCallback(v8::Local<v8::String
> name, const v8::AccessorInfo& info) | |
323 { | |
324 return TestObjV8Internal::longLongAttrAttrGetter(name, info); | |
325 } | |
326 | |
327 static void longLongAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Val
ue> value, const v8::AccessorInfo& info) | |
328 { | |
329 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
330 V8TRYCATCH_VOID(long long, v, toInt64(value)); | |
331 imp->setLongLongAttr(v); | |
332 return; | |
333 } | |
334 | |
335 static void longLongAttrAttrSetterCallback(v8::Local<v8::String> name, v8::Local
<v8::Value> value, const v8::AccessorInfo& info) | |
336 { | |
337 TestObjV8Internal::longLongAttrAttrSetter(name, value, info); | |
338 } | |
339 | |
340 static v8::Handle<v8::Value> unsignedLongLongAttrAttrGetter(v8::Local<v8::String
> name, const v8::AccessorInfo& info) | |
341 { | |
342 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
343 return v8::Number::New(static_cast<double>(imp->unsignedLongLongAttr())); | |
344 } | |
345 | |
346 static v8::Handle<v8::Value> unsignedLongLongAttrAttrGetterCallback(v8::Local<v8
::String> name, const v8::AccessorInfo& info) | |
347 { | |
348 return TestObjV8Internal::unsignedLongLongAttrAttrGetter(name, info); | |
349 } | |
350 | |
351 static void unsignedLongLongAttrAttrSetter(v8::Local<v8::String> name, v8::Local
<v8::Value> value, const v8::AccessorInfo& info) | |
352 { | |
353 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
354 V8TRYCATCH_VOID(unsigned long long, v, toUInt64(value)); | |
355 imp->setUnsignedLongLongAttr(v); | |
356 return; | |
357 } | |
358 | |
359 static void unsignedLongLongAttrAttrSetterCallback(v8::Local<v8::String> name, v
8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
360 { | |
361 TestObjV8Internal::unsignedLongLongAttrAttrSetter(name, value, info); | |
362 } | |
363 | |
364 static v8::Handle<v8::Value> stringAttrAttrGetter(v8::Local<v8::String> name, co
nst v8::AccessorInfo& info) | |
365 { | |
366 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
367 return v8String(imp->stringAttr(), info.GetIsolate(), ReturnUnsafeHandle); | |
368 } | |
369 | |
370 static v8::Handle<v8::Value> stringAttrAttrGetterCallback(v8::Local<v8::String>
name, const v8::AccessorInfo& info) | |
371 { | |
372 return TestObjV8Internal::stringAttrAttrGetter(name, info); | |
373 } | |
374 | |
375 static void stringAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value
> value, const v8::AccessorInfo& info) | |
376 { | |
377 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
378 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, v, value); | |
379 imp->setStringAttr(v); | |
380 return; | |
381 } | |
382 | |
383 static void stringAttrAttrSetterCallback(v8::Local<v8::String> name, v8::Local<v
8::Value> value, const v8::AccessorInfo& info) | |
384 { | |
385 TestObjV8Internal::stringAttrAttrSetter(name, value, info); | |
386 } | |
387 | |
388 static v8::Handle<v8::Value> testObjAttrAttrGetter(v8::Local<v8::String> name, c
onst v8::AccessorInfo& info) | |
389 { | |
390 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
391 return toV8Fast(imp->testObjAttr(), info, imp); | |
392 } | |
393 | |
394 static v8::Handle<v8::Value> testObjAttrAttrGetterCallback(v8::Local<v8::String>
name, const v8::AccessorInfo& info) | |
395 { | |
396 UseCounter::count(activeDOMWindow(), UseCounter::TestFeature); | |
397 return TestObjV8Internal::testObjAttrAttrGetter(name, info); | |
398 } | |
399 | |
400 static void testObjAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Valu
e> value, const v8::AccessorInfo& info) | |
401 { | |
402 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
403 V8TRYCATCH_VOID(TestObj*, v, V8TestObj::HasInstance(value, info.GetIsolate()
, worldType(info.GetIsolate())) ? V8TestObj::toNative(v8::Handle<v8::Object>::Ca
st(value)) : 0); | |
404 imp->setTestObjAttr(WTF::getPtr(v)); | |
405 return; | |
406 } | |
407 | |
408 static void testObjAttrAttrSetterCallback(v8::Local<v8::String> name, v8::Local<
v8::Value> value, const v8::AccessorInfo& info) | |
409 { | |
410 UseCounter::count(activeDOMWindow(), UseCounter::TestFeature); | |
411 TestObjV8Internal::testObjAttrAttrSetter(name, value, info); | |
412 } | |
413 | |
414 static v8::Handle<v8::Value> XMLObjAttrAttrGetter(v8::Local<v8::String> name, co
nst v8::AccessorInfo& info) | |
415 { | |
416 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
417 return toV8Fast(imp->xmlObjAttr(), info, imp); | |
418 } | |
419 | |
420 static v8::Handle<v8::Value> XMLObjAttrAttrGetterCallback(v8::Local<v8::String>
name, const v8::AccessorInfo& info) | |
421 { | |
422 return TestObjV8Internal::XMLObjAttrAttrGetter(name, info); | |
423 } | |
424 | |
425 static void XMLObjAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value
> value, const v8::AccessorInfo& info) | |
426 { | |
427 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
428 V8TRYCATCH_VOID(TestObj*, v, V8TestObj::HasInstance(value, info.GetIsolate()
, worldType(info.GetIsolate())) ? V8TestObj::toNative(v8::Handle<v8::Object>::Ca
st(value)) : 0); | |
429 imp->setXMLObjAttr(WTF::getPtr(v)); | |
430 return; | |
431 } | |
432 | |
433 static void XMLObjAttrAttrSetterCallback(v8::Local<v8::String> name, v8::Local<v
8::Value> value, const v8::AccessorInfo& info) | |
434 { | |
435 TestObjV8Internal::XMLObjAttrAttrSetter(name, value, info); | |
436 } | |
437 | |
438 static v8::Handle<v8::Value> createAttrGetter(v8::Local<v8::String> name, const
v8::AccessorInfo& info) | |
439 { | |
440 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
441 return v8Boolean(imp->isCreate(), info.GetIsolate()); | |
442 } | |
443 | |
444 static v8::Handle<v8::Value> createAttrGetterCallback(v8::Local<v8::String> name
, const v8::AccessorInfo& info) | |
445 { | |
446 return TestObjV8Internal::createAttrGetter(name, info); | |
447 } | |
448 | |
449 static void createAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> va
lue, const v8::AccessorInfo& info) | |
450 { | |
451 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
452 V8TRYCATCH_VOID(bool, v, value->BooleanValue()); | |
453 imp->setCreate(v); | |
454 return; | |
455 } | |
456 | |
457 static void createAttrSetterCallback(v8::Local<v8::String> name, v8::Local<v8::V
alue> value, const v8::AccessorInfo& info) | |
458 { | |
459 TestObjV8Internal::createAttrSetter(name, value, info); | |
460 } | |
461 | |
462 static v8::Handle<v8::Value> reflectedStringAttrAttrGetter(v8::Local<v8::String>
name, const v8::AccessorInfo& info) | |
463 { | |
464 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
465 return v8String(imp->fastGetAttribute(WebCore::HTMLNames::reflectedstringatt
rAttr), info.GetIsolate(), ReturnUnsafeHandle); | |
466 } | |
467 | |
468 static v8::Handle<v8::Value> reflectedStringAttrAttrGetterCallback(v8::Local<v8:
:String> name, const v8::AccessorInfo& info) | |
469 { | |
470 return TestObjV8Internal::reflectedStringAttrAttrGetter(name, info); | |
471 } | |
472 | |
473 static void reflectedStringAttrAttrSetter(v8::Local<v8::String> name, v8::Local<
v8::Value> value, const v8::AccessorInfo& info) | |
474 { | |
475 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
476 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, v, val
ue); | |
477 imp->setAttribute(WebCore::HTMLNames::reflectedstringattrAttr, v); | |
478 return; | |
479 } | |
480 | |
481 static void reflectedStringAttrAttrSetterCallback(v8::Local<v8::String> name, v8
::Local<v8::Value> value, const v8::AccessorInfo& info) | |
482 { | |
483 TestObjV8Internal::reflectedStringAttrAttrSetter(name, value, info); | |
484 } | |
485 | |
486 static v8::Handle<v8::Value> reflectedIntegralAttrAttrGetter(v8::Local<v8::Strin
g> name, const v8::AccessorInfo& info) | |
487 { | |
488 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
489 return v8Integer(imp->getIntegralAttribute(WebCore::HTMLNames::reflectedinte
gralattrAttr), info.GetIsolate()); | |
490 } | |
491 | |
492 static v8::Handle<v8::Value> reflectedIntegralAttrAttrGetterCallback(v8::Local<v
8::String> name, const v8::AccessorInfo& info) | |
493 { | |
494 return TestObjV8Internal::reflectedIntegralAttrAttrGetter(name, info); | |
495 } | |
496 | |
497 static void reflectedIntegralAttrAttrSetter(v8::Local<v8::String> name, v8::Loca
l<v8::Value> value, const v8::AccessorInfo& info) | |
498 { | |
499 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
500 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
501 imp->setIntegralAttribute(WebCore::HTMLNames::reflectedintegralattrAttr, v); | |
502 return; | |
503 } | |
504 | |
505 static void reflectedIntegralAttrAttrSetterCallback(v8::Local<v8::String> name,
v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
506 { | |
507 TestObjV8Internal::reflectedIntegralAttrAttrSetter(name, value, info); | |
508 } | |
509 | |
510 static v8::Handle<v8::Value> reflectedUnsignedIntegralAttrAttrGetter(v8::Local<v
8::String> name, const v8::AccessorInfo& info) | |
511 { | |
512 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
513 return v8UnsignedInteger(std::max(0, imp->getIntegralAttribute(WebCore::HTML
Names::reflectedunsignedintegralattrAttr)), info.GetIsolate()); | |
514 } | |
515 | |
516 static v8::Handle<v8::Value> reflectedUnsignedIntegralAttrAttrGetterCallback(v8:
:Local<v8::String> name, const v8::AccessorInfo& info) | |
517 { | |
518 return TestObjV8Internal::reflectedUnsignedIntegralAttrAttrGetter(name, info
); | |
519 } | |
520 | |
521 static void reflectedUnsignedIntegralAttrAttrSetter(v8::Local<v8::String> name,
v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
522 { | |
523 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
524 V8TRYCATCH_VOID(unsigned, v, toUInt32(value)); | |
525 imp->setUnsignedIntegralAttribute(WebCore::HTMLNames::reflectedunsignedinteg
ralattrAttr, v); | |
526 return; | |
527 } | |
528 | |
529 static void reflectedUnsignedIntegralAttrAttrSetterCallback(v8::Local<v8::String
> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
530 { | |
531 TestObjV8Internal::reflectedUnsignedIntegralAttrAttrSetter(name, value, info
); | |
532 } | |
533 | |
534 static v8::Handle<v8::Value> reflectedBooleanAttrAttrGetter(v8::Local<v8::String
> name, const v8::AccessorInfo& info) | |
535 { | |
536 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
537 return v8Boolean(imp->fastHasAttribute(WebCore::HTMLNames::reflectedbooleana
ttrAttr), info.GetIsolate()); | |
538 } | |
539 | |
540 static v8::Handle<v8::Value> reflectedBooleanAttrAttrGetterCallback(v8::Local<v8
::String> name, const v8::AccessorInfo& info) | |
541 { | |
542 return TestObjV8Internal::reflectedBooleanAttrAttrGetter(name, info); | |
543 } | |
544 | |
545 static void reflectedBooleanAttrAttrSetter(v8::Local<v8::String> name, v8::Local
<v8::Value> value, const v8::AccessorInfo& info) | |
546 { | |
547 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
548 V8TRYCATCH_VOID(bool, v, value->BooleanValue()); | |
549 imp->setBooleanAttribute(WebCore::HTMLNames::reflectedbooleanattrAttr, v); | |
550 return; | |
551 } | |
552 | |
553 static void reflectedBooleanAttrAttrSetterCallback(v8::Local<v8::String> name, v
8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
554 { | |
555 TestObjV8Internal::reflectedBooleanAttrAttrSetter(name, value, info); | |
556 } | |
557 | |
558 static v8::Handle<v8::Value> reflectedURLAttrAttrGetter(v8::Local<v8::String> na
me, const v8::AccessorInfo& info) | |
559 { | |
560 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
561 return v8String(imp->getURLAttribute(WebCore::HTMLNames::reflectedurlattrAtt
r), info.GetIsolate(), ReturnUnsafeHandle); | |
562 } | |
563 | |
564 static v8::Handle<v8::Value> reflectedURLAttrAttrGetterCallback(v8::Local<v8::St
ring> name, const v8::AccessorInfo& info) | |
565 { | |
566 return TestObjV8Internal::reflectedURLAttrAttrGetter(name, info); | |
567 } | |
568 | |
569 static void reflectedURLAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8:
:Value> value, const v8::AccessorInfo& info) | |
570 { | |
571 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
572 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, v, val
ue); | |
573 imp->setAttribute(WebCore::HTMLNames::reflectedurlattrAttr, v); | |
574 return; | |
575 } | |
576 | |
577 static void reflectedURLAttrAttrSetterCallback(v8::Local<v8::String> name, v8::L
ocal<v8::Value> value, const v8::AccessorInfo& info) | |
578 { | |
579 TestObjV8Internal::reflectedURLAttrAttrSetter(name, value, info); | |
580 } | |
581 | |
582 static v8::Handle<v8::Value> reflectedStringAttrAttrGetter(v8::Local<v8::String>
name, const v8::AccessorInfo& info) | |
583 { | |
584 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
585 return v8String(imp->fastGetAttribute(WebCore::HTMLNames::customContentStrin
gAttrAttr), info.GetIsolate(), ReturnUnsafeHandle); | |
586 } | |
587 | |
588 static v8::Handle<v8::Value> reflectedStringAttrAttrGetterCallback(v8::Local<v8:
:String> name, const v8::AccessorInfo& info) | |
589 { | |
590 return TestObjV8Internal::reflectedStringAttrAttrGetter(name, info); | |
591 } | |
592 | |
593 static void reflectedStringAttrAttrSetter(v8::Local<v8::String> name, v8::Local<
v8::Value> value, const v8::AccessorInfo& info) | |
594 { | |
595 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
596 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, v, val
ue); | |
597 imp->setAttribute(WebCore::HTMLNames::customContentStringAttrAttr, v); | |
598 return; | |
599 } | |
600 | |
601 static void reflectedStringAttrAttrSetterCallback(v8::Local<v8::String> name, v8
::Local<v8::Value> value, const v8::AccessorInfo& info) | |
602 { | |
603 TestObjV8Internal::reflectedStringAttrAttrSetter(name, value, info); | |
604 } | |
605 | |
606 static v8::Handle<v8::Value> reflectedCustomIntegralAttrAttrGetter(v8::Local<v8:
:String> name, const v8::AccessorInfo& info) | |
607 { | |
608 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
609 return v8Integer(imp->getIntegralAttribute(WebCore::HTMLNames::customContent
IntegralAttrAttr), info.GetIsolate()); | |
610 } | |
611 | |
612 static v8::Handle<v8::Value> reflectedCustomIntegralAttrAttrGetterCallback(v8::L
ocal<v8::String> name, const v8::AccessorInfo& info) | |
613 { | |
614 return TestObjV8Internal::reflectedCustomIntegralAttrAttrGetter(name, info); | |
615 } | |
616 | |
617 static void reflectedCustomIntegralAttrAttrSetter(v8::Local<v8::String> name, v8
::Local<v8::Value> value, const v8::AccessorInfo& info) | |
618 { | |
619 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
620 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
621 imp->setIntegralAttribute(WebCore::HTMLNames::customContentIntegralAttrAttr,
v); | |
622 return; | |
623 } | |
624 | |
625 static void reflectedCustomIntegralAttrAttrSetterCallback(v8::Local<v8::String>
name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
626 { | |
627 TestObjV8Internal::reflectedCustomIntegralAttrAttrSetter(name, value, info); | |
628 } | |
629 | |
630 static v8::Handle<v8::Value> reflectedCustomBooleanAttrAttrGetter(v8::Local<v8::
String> name, const v8::AccessorInfo& info) | |
631 { | |
632 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
633 return v8Boolean(imp->fastHasAttribute(WebCore::HTMLNames::customContentBool
eanAttrAttr), info.GetIsolate()); | |
634 } | |
635 | |
636 static v8::Handle<v8::Value> reflectedCustomBooleanAttrAttrGetterCallback(v8::Lo
cal<v8::String> name, const v8::AccessorInfo& info) | |
637 { | |
638 return TestObjV8Internal::reflectedCustomBooleanAttrAttrGetter(name, info); | |
639 } | |
640 | |
641 static void reflectedCustomBooleanAttrAttrSetter(v8::Local<v8::String> name, v8:
:Local<v8::Value> value, const v8::AccessorInfo& info) | |
642 { | |
643 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
644 V8TRYCATCH_VOID(bool, v, value->BooleanValue()); | |
645 imp->setBooleanAttribute(WebCore::HTMLNames::customContentBooleanAttrAttr, v
); | |
646 return; | |
647 } | |
648 | |
649 static void reflectedCustomBooleanAttrAttrSetterCallback(v8::Local<v8::String> n
ame, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
650 { | |
651 TestObjV8Internal::reflectedCustomBooleanAttrAttrSetter(name, value, info); | |
652 } | |
653 | |
654 static v8::Handle<v8::Value> reflectedCustomURLAttrAttrGetter(v8::Local<v8::Stri
ng> name, const v8::AccessorInfo& info) | |
655 { | |
656 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
657 return v8String(imp->getURLAttribute(WebCore::HTMLNames::customContentURLAtt
rAttr), info.GetIsolate(), ReturnUnsafeHandle); | |
658 } | |
659 | |
660 static v8::Handle<v8::Value> reflectedCustomURLAttrAttrGetterCallback(v8::Local<
v8::String> name, const v8::AccessorInfo& info) | |
661 { | |
662 return TestObjV8Internal::reflectedCustomURLAttrAttrGetter(name, info); | |
663 } | |
664 | |
665 static void reflectedCustomURLAttrAttrSetter(v8::Local<v8::String> name, v8::Loc
al<v8::Value> value, const v8::AccessorInfo& info) | |
666 { | |
667 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
668 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, v, val
ue); | |
669 imp->setAttribute(WebCore::HTMLNames::customContentURLAttrAttr, v); | |
670 return; | |
671 } | |
672 | |
673 static void reflectedCustomURLAttrAttrSetterCallback(v8::Local<v8::String> name,
v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
674 { | |
675 TestObjV8Internal::reflectedCustomURLAttrAttrSetter(name, value, info); | |
676 } | |
677 | |
678 static v8::Handle<v8::Value> typedArrayAttrAttrGetter(v8::Local<v8::String> name
, const v8::AccessorInfo& info) | |
679 { | |
680 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
681 return toV8Fast(imp->typedArrayAttr(), info, imp); | |
682 } | |
683 | |
684 static v8::Handle<v8::Value> typedArrayAttrAttrGetterCallback(v8::Local<v8::Stri
ng> name, const v8::AccessorInfo& info) | |
685 { | |
686 return TestObjV8Internal::typedArrayAttrAttrGetter(name, info); | |
687 } | |
688 | |
689 static void typedArrayAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::V
alue> value, const v8::AccessorInfo& info) | |
690 { | |
691 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
692 V8TRYCATCH_VOID(Float32Array*, v, V8Float32Array::HasInstance(value, info.Ge
tIsolate(), worldType(info.GetIsolate())) ? V8Float32Array::toNative(v8::Handle<
v8::Object>::Cast(value)) : 0); | |
693 imp->setTypedArrayAttr(WTF::getPtr(v)); | |
694 return; | |
695 } | |
696 | |
697 static void typedArrayAttrAttrSetterCallback(v8::Local<v8::String> name, v8::Loc
al<v8::Value> value, const v8::AccessorInfo& info) | |
698 { | |
699 TestObjV8Internal::typedArrayAttrAttrSetter(name, value, info); | |
700 } | |
701 | |
702 static v8::Handle<v8::Value> attrWithGetterExceptionAttrGetter(v8::Local<v8::Str
ing> name, const v8::AccessorInfo& info) | |
703 { | |
704 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
705 ExceptionCode ec = 0; | |
706 int v = imp->attrWithGetterException(ec); | |
707 if (UNLIKELY(ec)) | |
708 return setDOMException(ec, info.GetIsolate()); | |
709 return v8Integer(v, info.GetIsolate()); | |
710 } | |
711 | |
712 static v8::Handle<v8::Value> attrWithGetterExceptionAttrGetterCallback(v8::Local
<v8::String> name, const v8::AccessorInfo& info) | |
713 { | |
714 return TestObjV8Internal::attrWithGetterExceptionAttrGetter(name, info); | |
715 } | |
716 | |
717 static void attrWithGetterExceptionAttrSetter(v8::Local<v8::String> name, v8::Lo
cal<v8::Value> value, const v8::AccessorInfo& info) | |
718 { | |
719 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
720 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
721 imp->setAttrWithGetterException(v); | |
722 return; | |
723 } | |
724 | |
725 static void attrWithGetterExceptionAttrSetterCallback(v8::Local<v8::String> name
, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
726 { | |
727 TestObjV8Internal::attrWithGetterExceptionAttrSetter(name, value, info); | |
728 } | |
729 | |
730 static v8::Handle<v8::Value> attrWithSetterExceptionAttrGetter(v8::Local<v8::Str
ing> name, const v8::AccessorInfo& info) | |
731 { | |
732 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
733 return v8Integer(imp->attrWithSetterException(), info.GetIsolate()); | |
734 } | |
735 | |
736 static v8::Handle<v8::Value> attrWithSetterExceptionAttrGetterCallback(v8::Local
<v8::String> name, const v8::AccessorInfo& info) | |
737 { | |
738 return TestObjV8Internal::attrWithSetterExceptionAttrGetter(name, info); | |
739 } | |
740 | |
741 static void attrWithSetterExceptionAttrSetter(v8::Local<v8::String> name, v8::Lo
cal<v8::Value> value, const v8::AccessorInfo& info) | |
742 { | |
743 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
744 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
745 ExceptionCode ec = 0; | |
746 imp->setAttrWithSetterException(v, ec); | |
747 if (UNLIKELY(ec)) | |
748 setDOMException(ec, info.GetIsolate()); | |
749 return; | |
750 } | |
751 | |
752 static void attrWithSetterExceptionAttrSetterCallback(v8::Local<v8::String> name
, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
753 { | |
754 TestObjV8Internal::attrWithSetterExceptionAttrSetter(name, value, info); | |
755 } | |
756 | |
757 static v8::Handle<v8::Value> stringAttrWithGetterExceptionAttrGetter(v8::Local<v
8::String> name, const v8::AccessorInfo& info) | |
758 { | |
759 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
760 ExceptionCode ec = 0; | |
761 String v = imp->stringAttrWithGetterException(ec); | |
762 if (UNLIKELY(ec)) | |
763 return setDOMException(ec, info.GetIsolate()); | |
764 return v8String(v, info.GetIsolate(), ReturnUnsafeHandle); | |
765 } | |
766 | |
767 static v8::Handle<v8::Value> stringAttrWithGetterExceptionAttrGetterCallback(v8:
:Local<v8::String> name, const v8::AccessorInfo& info) | |
768 { | |
769 return TestObjV8Internal::stringAttrWithGetterExceptionAttrGetter(name, info
); | |
770 } | |
771 | |
772 static void stringAttrWithGetterExceptionAttrSetter(v8::Local<v8::String> name,
v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
773 { | |
774 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
775 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, v, value); | |
776 imp->setStringAttrWithGetterException(v); | |
777 return; | |
778 } | |
779 | |
780 static void stringAttrWithGetterExceptionAttrSetterCallback(v8::Local<v8::String
> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
781 { | |
782 TestObjV8Internal::stringAttrWithGetterExceptionAttrSetter(name, value, info
); | |
783 } | |
784 | |
785 static v8::Handle<v8::Value> stringAttrWithSetterExceptionAttrGetter(v8::Local<v
8::String> name, const v8::AccessorInfo& info) | |
786 { | |
787 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
788 return v8String(imp->stringAttrWithSetterException(), info.GetIsolate(), Ret
urnUnsafeHandle); | |
789 } | |
790 | |
791 static v8::Handle<v8::Value> stringAttrWithSetterExceptionAttrGetterCallback(v8:
:Local<v8::String> name, const v8::AccessorInfo& info) | |
792 { | |
793 return TestObjV8Internal::stringAttrWithSetterExceptionAttrGetter(name, info
); | |
794 } | |
795 | |
796 static void stringAttrWithSetterExceptionAttrSetter(v8::Local<v8::String> name,
v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
797 { | |
798 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
799 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, v, value); | |
800 ExceptionCode ec = 0; | |
801 imp->setStringAttrWithSetterException(v, ec); | |
802 if (UNLIKELY(ec)) | |
803 setDOMException(ec, info.GetIsolate()); | |
804 return; | |
805 } | |
806 | |
807 static void stringAttrWithSetterExceptionAttrSetterCallback(v8::Local<v8::String
> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
808 { | |
809 TestObjV8Internal::stringAttrWithSetterExceptionAttrSetter(name, value, info
); | |
810 } | |
811 | |
812 static v8::Handle<v8::Value> customAttrAttrGetterCallback(v8::Local<v8::String>
name, const v8::AccessorInfo& info) | |
813 { | |
814 return V8TestObj::customAttrAttrGetterCustom(name, info); | |
815 } | |
816 | |
817 static void customAttrAttrSetterCallback(v8::Local<v8::String> name, v8::Local<v
8::Value> value, const v8::AccessorInfo& info) | |
818 { | |
819 V8TestObj::customAttrAttrSetterCustom(name, value, info); | |
820 } | |
821 | |
822 static v8::Handle<v8::Value> withScriptStateAttributeAttrGetter(v8::Local<v8::St
ring> name, const v8::AccessorInfo& info) | |
823 { | |
824 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
825 ScriptState* currentState = ScriptState::current(); | |
826 if (!currentState) | |
827 return v8Undefined(); | |
828 ScriptState& state = *currentState; | |
829 return v8Integer(imp->withScriptStateAttribute(&state), info.GetIsolate()); | |
830 } | |
831 | |
832 static v8::Handle<v8::Value> withScriptStateAttributeAttrGetterCallback(v8::Loca
l<v8::String> name, const v8::AccessorInfo& info) | |
833 { | |
834 return TestObjV8Internal::withScriptStateAttributeAttrGetter(name, info); | |
835 } | |
836 | |
837 static void withScriptStateAttributeAttrSetter(v8::Local<v8::String> name, v8::L
ocal<v8::Value> value, const v8::AccessorInfo& info) | |
838 { | |
839 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
840 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
841 ScriptState* currentState = ScriptState::current(); | |
842 if (!currentState) | |
843 return; | |
844 ScriptState& state = *currentState; | |
845 imp->setWithScriptStateAttribute(&state, v); | |
846 if (state.hadException()) | |
847 throwError(state.exception(), info.GetIsolate()); | |
848 return; | |
849 } | |
850 | |
851 static void withScriptStateAttributeAttrSetterCallback(v8::Local<v8::String> nam
e, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
852 { | |
853 TestObjV8Internal::withScriptStateAttributeAttrSetter(name, value, info); | |
854 } | |
855 | |
856 static v8::Handle<v8::Value> withScriptExecutionContextAttributeAttrGetter(v8::L
ocal<v8::String> name, const v8::AccessorInfo& info) | |
857 { | |
858 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
859 ScriptExecutionContext* scriptContext = getScriptExecutionContext(); | |
860 return toV8Fast(imp->withScriptExecutionContextAttribute(scriptContext), inf
o, imp); | |
861 } | |
862 | |
863 static v8::Handle<v8::Value> withScriptExecutionContextAttributeAttrGetterCallba
ck(v8::Local<v8::String> name, const v8::AccessorInfo& info) | |
864 { | |
865 return TestObjV8Internal::withScriptExecutionContextAttributeAttrGetter(name
, info); | |
866 } | |
867 | |
868 static void withScriptExecutionContextAttributeAttrSetter(v8::Local<v8::String>
name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
869 { | |
870 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
871 V8TRYCATCH_VOID(TestObj*, v, V8TestObj::HasInstance(value, info.GetIsolate()
, worldType(info.GetIsolate())) ? V8TestObj::toNative(v8::Handle<v8::Object>::Ca
st(value)) : 0); | |
872 ScriptExecutionContext* scriptContext = getScriptExecutionContext(); | |
873 imp->setWithScriptExecutionContextAttribute(scriptContext, WTF::getPtr(v)); | |
874 return; | |
875 } | |
876 | |
877 static void withScriptExecutionContextAttributeAttrSetterCallback(v8::Local<v8::
String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
878 { | |
879 TestObjV8Internal::withScriptExecutionContextAttributeAttrSetter(name, value
, info); | |
880 } | |
881 | |
882 static v8::Handle<v8::Value> withScriptStateAttributeRaisesAttrGetter(v8::Local<
v8::String> name, const v8::AccessorInfo& info) | |
883 { | |
884 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
885 ExceptionCode ec = 0; | |
886 ScriptState* currentState = ScriptState::current(); | |
887 if (!currentState) | |
888 return v8Undefined(); | |
889 ScriptState& state = *currentState; | |
890 RefPtr<TestObj> v = imp->withScriptStateAttributeRaises(&state, ec); | |
891 if (UNLIKELY(ec)) | |
892 return setDOMException(ec, info.GetIsolate()); | |
893 if (state.hadException()) | |
894 return throwError(state.exception(), info.GetIsolate()); | |
895 return toV8Fast(v.release(), info, imp); | |
896 } | |
897 | |
898 static v8::Handle<v8::Value> withScriptStateAttributeRaisesAttrGetterCallback(v8
::Local<v8::String> name, const v8::AccessorInfo& info) | |
899 { | |
900 return TestObjV8Internal::withScriptStateAttributeRaisesAttrGetter(name, inf
o); | |
901 } | |
902 | |
903 static void withScriptStateAttributeRaisesAttrSetter(v8::Local<v8::String> name,
v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
904 { | |
905 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
906 V8TRYCATCH_VOID(TestObj*, v, V8TestObj::HasInstance(value, info.GetIsolate()
, worldType(info.GetIsolate())) ? V8TestObj::toNative(v8::Handle<v8::Object>::Ca
st(value)) : 0); | |
907 ScriptState* currentState = ScriptState::current(); | |
908 if (!currentState) | |
909 return; | |
910 ScriptState& state = *currentState; | |
911 imp->setWithScriptStateAttributeRaises(&state, WTF::getPtr(v)); | |
912 if (state.hadException()) | |
913 throwError(state.exception(), info.GetIsolate()); | |
914 return; | |
915 } | |
916 | |
917 static void withScriptStateAttributeRaisesAttrSetterCallback(v8::Local<v8::Strin
g> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
918 { | |
919 TestObjV8Internal::withScriptStateAttributeRaisesAttrSetter(name, value, inf
o); | |
920 } | |
921 | |
922 static v8::Handle<v8::Value> withScriptExecutionContextAttributeRaisesAttrGetter
(v8::Local<v8::String> name, const v8::AccessorInfo& info) | |
923 { | |
924 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
925 ExceptionCode ec = 0; | |
926 ScriptExecutionContext* scriptContext = getScriptExecutionContext(); | |
927 RefPtr<TestObj> v = imp->withScriptExecutionContextAttributeRaises(scriptCon
text, ec); | |
928 if (UNLIKELY(ec)) | |
929 return setDOMException(ec, info.GetIsolate()); | |
930 return toV8Fast(v.release(), info, imp); | |
931 } | |
932 | |
933 static v8::Handle<v8::Value> withScriptExecutionContextAttributeRaisesAttrGetter
Callback(v8::Local<v8::String> name, const v8::AccessorInfo& info) | |
934 { | |
935 return TestObjV8Internal::withScriptExecutionContextAttributeRaisesAttrGette
r(name, info); | |
936 } | |
937 | |
938 static void withScriptExecutionContextAttributeRaisesAttrSetter(v8::Local<v8::St
ring> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
939 { | |
940 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
941 V8TRYCATCH_VOID(TestObj*, v, V8TestObj::HasInstance(value, info.GetIsolate()
, worldType(info.GetIsolate())) ? V8TestObj::toNative(v8::Handle<v8::Object>::Ca
st(value)) : 0); | |
942 ScriptExecutionContext* scriptContext = getScriptExecutionContext(); | |
943 imp->setWithScriptExecutionContextAttributeRaises(scriptContext, WTF::getPtr
(v)); | |
944 return; | |
945 } | |
946 | |
947 static void withScriptExecutionContextAttributeRaisesAttrSetterCallback(v8::Loca
l<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
948 { | |
949 TestObjV8Internal::withScriptExecutionContextAttributeRaisesAttrSetter(name,
value, info); | |
950 } | |
951 | |
952 static v8::Handle<v8::Value> withScriptExecutionContextAndScriptStateAttributeAt
trGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) | |
953 { | |
954 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
955 ScriptState* currentState = ScriptState::current(); | |
956 if (!currentState) | |
957 return v8Undefined(); | |
958 ScriptState& state = *currentState; | |
959 ScriptExecutionContext* scriptContext = getScriptExecutionContext(); | |
960 return toV8Fast(imp->withScriptExecutionContextAndScriptStateAttribute(&stat
e, scriptContext), info, imp); | |
961 } | |
962 | |
963 static v8::Handle<v8::Value> withScriptExecutionContextAndScriptStateAttributeAt
trGetterCallback(v8::Local<v8::String> name, const v8::AccessorInfo& info) | |
964 { | |
965 return TestObjV8Internal::withScriptExecutionContextAndScriptStateAttributeA
ttrGetter(name, info); | |
966 } | |
967 | |
968 static void withScriptExecutionContextAndScriptStateAttributeAttrSetter(v8::Loca
l<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
969 { | |
970 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
971 V8TRYCATCH_VOID(TestObj*, v, V8TestObj::HasInstance(value, info.GetIsolate()
, worldType(info.GetIsolate())) ? V8TestObj::toNative(v8::Handle<v8::Object>::Ca
st(value)) : 0); | |
972 ScriptState* currentState = ScriptState::current(); | |
973 if (!currentState) | |
974 return; | |
975 ScriptState& state = *currentState; | |
976 ScriptExecutionContext* scriptContext = getScriptExecutionContext(); | |
977 imp->setWithScriptExecutionContextAndScriptStateAttribute(&state, scriptCont
ext, WTF::getPtr(v)); | |
978 if (state.hadException()) | |
979 throwError(state.exception(), info.GetIsolate()); | |
980 return; | |
981 } | |
982 | |
983 static void withScriptExecutionContextAndScriptStateAttributeAttrSetterCallback(
v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo&
info) | |
984 { | |
985 TestObjV8Internal::withScriptExecutionContextAndScriptStateAttributeAttrSett
er(name, value, info); | |
986 } | |
987 | |
988 static v8::Handle<v8::Value> withScriptExecutionContextAndScriptStateAttributeRa
isesAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) | |
989 { | |
990 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
991 ExceptionCode ec = 0; | |
992 ScriptState* currentState = ScriptState::current(); | |
993 if (!currentState) | |
994 return v8Undefined(); | |
995 ScriptState& state = *currentState; | |
996 ScriptExecutionContext* scriptContext = getScriptExecutionContext(); | |
997 RefPtr<TestObj> v = imp->withScriptExecutionContextAndScriptStateAttributeRa
ises(&state, scriptContext, ec); | |
998 if (UNLIKELY(ec)) | |
999 return setDOMException(ec, info.GetIsolate()); | |
1000 if (state.hadException()) | |
1001 return throwError(state.exception(), info.GetIsolate()); | |
1002 return toV8Fast(v.release(), info, imp); | |
1003 } | |
1004 | |
1005 static v8::Handle<v8::Value> withScriptExecutionContextAndScriptStateAttributeRa
isesAttrGetterCallback(v8::Local<v8::String> name, const v8::AccessorInfo& info) | |
1006 { | |
1007 return TestObjV8Internal::withScriptExecutionContextAndScriptStateAttributeR
aisesAttrGetter(name, info); | |
1008 } | |
1009 | |
1010 static void withScriptExecutionContextAndScriptStateAttributeRaisesAttrSetter(v8
::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& in
fo) | |
1011 { | |
1012 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
1013 V8TRYCATCH_VOID(TestObj*, v, V8TestObj::HasInstance(value, info.GetIsolate()
, worldType(info.GetIsolate())) ? V8TestObj::toNative(v8::Handle<v8::Object>::Ca
st(value)) : 0); | |
1014 ScriptState* currentState = ScriptState::current(); | |
1015 if (!currentState) | |
1016 return; | |
1017 ScriptState& state = *currentState; | |
1018 ScriptExecutionContext* scriptContext = getScriptExecutionContext(); | |
1019 imp->setWithScriptExecutionContextAndScriptStateAttributeRaises(&state, scri
ptContext, WTF::getPtr(v)); | |
1020 if (state.hadException()) | |
1021 throwError(state.exception(), info.GetIsolate()); | |
1022 return; | |
1023 } | |
1024 | |
1025 static void withScriptExecutionContextAndScriptStateAttributeRaisesAttrSetterCal
lback(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::Accessor
Info& info) | |
1026 { | |
1027 TestObjV8Internal::withScriptExecutionContextAndScriptStateAttributeRaisesAt
trSetter(name, value, info); | |
1028 } | |
1029 | |
1030 static v8::Handle<v8::Value> withScriptExecutionContextAndScriptStateWithSpacesA
ttributeAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) | |
1031 { | |
1032 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
1033 ScriptState* currentState = ScriptState::current(); | |
1034 if (!currentState) | |
1035 return v8Undefined(); | |
1036 ScriptState& state = *currentState; | |
1037 ScriptExecutionContext* scriptContext = getScriptExecutionContext(); | |
1038 return toV8Fast(imp->withScriptExecutionContextAndScriptStateWithSpacesAttri
bute(&state, scriptContext), info, imp); | |
1039 } | |
1040 | |
1041 static v8::Handle<v8::Value> withScriptExecutionContextAndScriptStateWithSpacesA
ttributeAttrGetterCallback(v8::Local<v8::String> name, const v8::AccessorInfo& i
nfo) | |
1042 { | |
1043 return TestObjV8Internal::withScriptExecutionContextAndScriptStateWithSpaces
AttributeAttrGetter(name, info); | |
1044 } | |
1045 | |
1046 static void withScriptExecutionContextAndScriptStateWithSpacesAttributeAttrSette
r(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo
& info) | |
1047 { | |
1048 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
1049 V8TRYCATCH_VOID(TestObj*, v, V8TestObj::HasInstance(value, info.GetIsolate()
, worldType(info.GetIsolate())) ? V8TestObj::toNative(v8::Handle<v8::Object>::Ca
st(value)) : 0); | |
1050 ScriptState* currentState = ScriptState::current(); | |
1051 if (!currentState) | |
1052 return; | |
1053 ScriptState& state = *currentState; | |
1054 ScriptExecutionContext* scriptContext = getScriptExecutionContext(); | |
1055 imp->setWithScriptExecutionContextAndScriptStateWithSpacesAttribute(&state,
scriptContext, WTF::getPtr(v)); | |
1056 if (state.hadException()) | |
1057 throwError(state.exception(), info.GetIsolate()); | |
1058 return; | |
1059 } | |
1060 | |
1061 static void withScriptExecutionContextAndScriptStateWithSpacesAttributeAttrSette
rCallback(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::Acce
ssorInfo& info) | |
1062 { | |
1063 TestObjV8Internal::withScriptExecutionContextAndScriptStateWithSpacesAttribu
teAttrSetter(name, value, info); | |
1064 } | |
1065 | |
1066 static v8::Handle<v8::Value> enforcedRangeLongAttrAttrGetter(v8::Local<v8::Strin
g> name, const v8::AccessorInfo& info) | |
1067 { | |
1068 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
1069 return v8Integer(imp->enforcedRangeLongAttr(), info.GetIsolate()); | |
1070 } | |
1071 | |
1072 static v8::Handle<v8::Value> enforcedRangeLongAttrAttrGetterCallback(v8::Local<v
8::String> name, const v8::AccessorInfo& info) | |
1073 { | |
1074 return TestObjV8Internal::enforcedRangeLongAttrAttrGetter(name, info); | |
1075 } | |
1076 | |
1077 static void enforcedRangeLongAttrAttrSetter(v8::Local<v8::String> name, v8::Loca
l<v8::Value> value, const v8::AccessorInfo& info) | |
1078 { | |
1079 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
1080 V8TRYCATCH_WITH_TYPECHECK_VOID(int, v, toInt32(value, EnforceRange, ok), inf
o.GetIsolate()); | |
1081 imp->setEnforcedRangeLongAttr(v); | |
1082 return; | |
1083 } | |
1084 | |
1085 static void enforcedRangeLongAttrAttrSetterCallback(v8::Local<v8::String> name,
v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
1086 { | |
1087 TestObjV8Internal::enforcedRangeLongAttrAttrSetter(name, value, info); | |
1088 } | |
1089 | |
1090 static v8::Handle<v8::Value> enforcedRangeUnsignedLongAttrAttrGetter(v8::Local<v
8::String> name, const v8::AccessorInfo& info) | |
1091 { | |
1092 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
1093 return v8UnsignedInteger(imp->enforcedRangeUnsignedLongAttr(), info.GetIsola
te()); | |
1094 } | |
1095 | |
1096 static v8::Handle<v8::Value> enforcedRangeUnsignedLongAttrAttrGetterCallback(v8:
:Local<v8::String> name, const v8::AccessorInfo& info) | |
1097 { | |
1098 return TestObjV8Internal::enforcedRangeUnsignedLongAttrAttrGetter(name, info
); | |
1099 } | |
1100 | |
1101 static void enforcedRangeUnsignedLongAttrAttrSetter(v8::Local<v8::String> name,
v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
1102 { | |
1103 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
1104 V8TRYCATCH_WITH_TYPECHECK_VOID(unsigned, v, toUInt32(value, EnforceRange, ok
), info.GetIsolate()); | |
1105 imp->setEnforcedRangeUnsignedLongAttr(v); | |
1106 return; | |
1107 } | |
1108 | |
1109 static void enforcedRangeUnsignedLongAttrAttrSetterCallback(v8::Local<v8::String
> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
1110 { | |
1111 TestObjV8Internal::enforcedRangeUnsignedLongAttrAttrSetter(name, value, info
); | |
1112 } | |
1113 | |
1114 static v8::Handle<v8::Value> enforcedRangeLongLongAttrAttrGetter(v8::Local<v8::S
tring> name, const v8::AccessorInfo& info) | |
1115 { | |
1116 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
1117 return v8::Number::New(static_cast<double>(imp->enforcedRangeLongLongAttr())
); | |
1118 } | |
1119 | |
1120 static v8::Handle<v8::Value> enforcedRangeLongLongAttrAttrGetterCallback(v8::Loc
al<v8::String> name, const v8::AccessorInfo& info) | |
1121 { | |
1122 return TestObjV8Internal::enforcedRangeLongLongAttrAttrGetter(name, info); | |
1123 } | |
1124 | |
1125 static void enforcedRangeLongLongAttrAttrSetter(v8::Local<v8::String> name, v8::
Local<v8::Value> value, const v8::AccessorInfo& info) | |
1126 { | |
1127 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
1128 V8TRYCATCH_WITH_TYPECHECK_VOID(long long, v, toInt64(value, EnforceRange, ok
), info.GetIsolate()); | |
1129 imp->setEnforcedRangeLongLongAttr(v); | |
1130 return; | |
1131 } | |
1132 | |
1133 static void enforcedRangeLongLongAttrAttrSetterCallback(v8::Local<v8::String> na
me, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
1134 { | |
1135 TestObjV8Internal::enforcedRangeLongLongAttrAttrSetter(name, value, info); | |
1136 } | |
1137 | |
1138 static v8::Handle<v8::Value> enforcedRangeUnsignedLongLongAttrAttrGetter(v8::Loc
al<v8::String> name, const v8::AccessorInfo& info) | |
1139 { | |
1140 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
1141 return v8::Number::New(static_cast<double>(imp->enforcedRangeUnsignedLongLon
gAttr())); | |
1142 } | |
1143 | |
1144 static v8::Handle<v8::Value> enforcedRangeUnsignedLongLongAttrAttrGetterCallback
(v8::Local<v8::String> name, const v8::AccessorInfo& info) | |
1145 { | |
1146 return TestObjV8Internal::enforcedRangeUnsignedLongLongAttrAttrGetter(name,
info); | |
1147 } | |
1148 | |
1149 static void enforcedRangeUnsignedLongLongAttrAttrSetter(v8::Local<v8::String> na
me, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
1150 { | |
1151 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
1152 V8TRYCATCH_WITH_TYPECHECK_VOID(unsigned long long, v, toUInt64(value, Enforc
eRange, ok), info.GetIsolate()); | |
1153 imp->setEnforcedRangeUnsignedLongLongAttr(v); | |
1154 return; | |
1155 } | |
1156 | |
1157 static void enforcedRangeUnsignedLongLongAttrAttrSetterCallback(v8::Local<v8::St
ring> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
1158 { | |
1159 TestObjV8Internal::enforcedRangeUnsignedLongLongAttrAttrSetter(name, value,
info); | |
1160 } | |
1161 | |
1162 #if ENABLE(Condition1) | |
1163 | |
1164 static v8::Handle<v8::Value> conditionalAttr1AttrGetter(v8::Local<v8::String> na
me, const v8::AccessorInfo& info) | |
1165 { | |
1166 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
1167 return v8Integer(imp->conditionalAttr1(), info.GetIsolate()); | |
1168 } | |
1169 | |
1170 #endif // ENABLE(Condition1) | |
1171 | |
1172 #if ENABLE(Condition1) | |
1173 | |
1174 static v8::Handle<v8::Value> conditionalAttr1AttrGetterCallback(v8::Local<v8::St
ring> name, const v8::AccessorInfo& info) | |
1175 { | |
1176 return TestObjV8Internal::conditionalAttr1AttrGetter(name, info); | |
1177 } | |
1178 | |
1179 #endif // ENABLE(Condition1) | |
1180 | |
1181 #if ENABLE(Condition1) | |
1182 | |
1183 static void conditionalAttr1AttrSetter(v8::Local<v8::String> name, v8::Local<v8:
:Value> value, const v8::AccessorInfo& info) | |
1184 { | |
1185 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
1186 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
1187 imp->setConditionalAttr1(v); | |
1188 return; | |
1189 } | |
1190 | |
1191 #endif // ENABLE(Condition1) | |
1192 | |
1193 #if ENABLE(Condition1) | |
1194 | |
1195 static void conditionalAttr1AttrSetterCallback(v8::Local<v8::String> name, v8::L
ocal<v8::Value> value, const v8::AccessorInfo& info) | |
1196 { | |
1197 TestObjV8Internal::conditionalAttr1AttrSetter(name, value, info); | |
1198 } | |
1199 | |
1200 #endif // ENABLE(Condition1) | |
1201 | |
1202 #if ENABLE(Condition1) && ENABLE(Condition2) | |
1203 | |
1204 static v8::Handle<v8::Value> conditionalAttr2AttrGetter(v8::Local<v8::String> na
me, const v8::AccessorInfo& info) | |
1205 { | |
1206 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
1207 return v8Integer(imp->conditionalAttr2(), info.GetIsolate()); | |
1208 } | |
1209 | |
1210 #endif // ENABLE(Condition1) && ENABLE(Condition2) | |
1211 | |
1212 #if ENABLE(Condition1) && ENABLE(Condition2) | |
1213 | |
1214 static v8::Handle<v8::Value> conditionalAttr2AttrGetterCallback(v8::Local<v8::St
ring> name, const v8::AccessorInfo& info) | |
1215 { | |
1216 return TestObjV8Internal::conditionalAttr2AttrGetter(name, info); | |
1217 } | |
1218 | |
1219 #endif // ENABLE(Condition1) && ENABLE(Condition2) | |
1220 | |
1221 #if ENABLE(Condition1) && ENABLE(Condition2) | |
1222 | |
1223 static void conditionalAttr2AttrSetter(v8::Local<v8::String> name, v8::Local<v8:
:Value> value, const v8::AccessorInfo& info) | |
1224 { | |
1225 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
1226 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
1227 imp->setConditionalAttr2(v); | |
1228 return; | |
1229 } | |
1230 | |
1231 #endif // ENABLE(Condition1) && ENABLE(Condition2) | |
1232 | |
1233 #if ENABLE(Condition1) && ENABLE(Condition2) | |
1234 | |
1235 static void conditionalAttr2AttrSetterCallback(v8::Local<v8::String> name, v8::L
ocal<v8::Value> value, const v8::AccessorInfo& info) | |
1236 { | |
1237 TestObjV8Internal::conditionalAttr2AttrSetter(name, value, info); | |
1238 } | |
1239 | |
1240 #endif // ENABLE(Condition1) && ENABLE(Condition2) | |
1241 | |
1242 #if ENABLE(Condition1) || ENABLE(Condition2) | |
1243 | |
1244 static v8::Handle<v8::Value> conditionalAttr3AttrGetter(v8::Local<v8::String> na
me, const v8::AccessorInfo& info) | |
1245 { | |
1246 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
1247 return v8Integer(imp->conditionalAttr3(), info.GetIsolate()); | |
1248 } | |
1249 | |
1250 #endif // ENABLE(Condition1) || ENABLE(Condition2) | |
1251 | |
1252 #if ENABLE(Condition1) || ENABLE(Condition2) | |
1253 | |
1254 static v8::Handle<v8::Value> conditionalAttr3AttrGetterCallback(v8::Local<v8::St
ring> name, const v8::AccessorInfo& info) | |
1255 { | |
1256 return TestObjV8Internal::conditionalAttr3AttrGetter(name, info); | |
1257 } | |
1258 | |
1259 #endif // ENABLE(Condition1) || ENABLE(Condition2) | |
1260 | |
1261 #if ENABLE(Condition1) || ENABLE(Condition2) | |
1262 | |
1263 static void conditionalAttr3AttrSetter(v8::Local<v8::String> name, v8::Local<v8:
:Value> value, const v8::AccessorInfo& info) | |
1264 { | |
1265 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
1266 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
1267 imp->setConditionalAttr3(v); | |
1268 return; | |
1269 } | |
1270 | |
1271 #endif // ENABLE(Condition1) || ENABLE(Condition2) | |
1272 | |
1273 #if ENABLE(Condition1) || ENABLE(Condition2) | |
1274 | |
1275 static void conditionalAttr3AttrSetterCallback(v8::Local<v8::String> name, v8::L
ocal<v8::Value> value, const v8::AccessorInfo& info) | |
1276 { | |
1277 TestObjV8Internal::conditionalAttr3AttrSetter(name, value, info); | |
1278 } | |
1279 | |
1280 #endif // ENABLE(Condition1) || ENABLE(Condition2) | |
1281 | |
1282 static v8::Handle<v8::Value> cachedAttribute1AttrGetter(v8::Local<v8::String> na
me, const v8::AccessorInfo& info) | |
1283 { | |
1284 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
1285 return imp->cachedAttribute1().v8Value(); | |
1286 } | |
1287 | |
1288 static v8::Handle<v8::Value> cachedAttribute1AttrGetterCallback(v8::Local<v8::St
ring> name, const v8::AccessorInfo& info) | |
1289 { | |
1290 return TestObjV8Internal::cachedAttribute1AttrGetter(name, info); | |
1291 } | |
1292 | |
1293 static v8::Handle<v8::Value> cachedAttribute2AttrGetter(v8::Local<v8::String> na
me, const v8::AccessorInfo& info) | |
1294 { | |
1295 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
1296 return imp->cachedAttribute2().v8Value(); | |
1297 } | |
1298 | |
1299 static v8::Handle<v8::Value> cachedAttribute2AttrGetterCallback(v8::Local<v8::St
ring> name, const v8::AccessorInfo& info) | |
1300 { | |
1301 return TestObjV8Internal::cachedAttribute2AttrGetter(name, info); | |
1302 } | |
1303 | |
1304 static v8::Handle<v8::Value> anyAttributeAttrGetter(v8::Local<v8::String> name,
const v8::AccessorInfo& info) | |
1305 { | |
1306 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
1307 return imp->anyAttribute().v8Value(); | |
1308 } | |
1309 | |
1310 static v8::Handle<v8::Value> anyAttributeAttrGetterCallback(v8::Local<v8::String
> name, const v8::AccessorInfo& info) | |
1311 { | |
1312 return TestObjV8Internal::anyAttributeAttrGetter(name, info); | |
1313 } | |
1314 | |
1315 static void anyAttributeAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Val
ue> value, const v8::AccessorInfo& info) | |
1316 { | |
1317 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
1318 V8TRYCATCH_VOID(ScriptValue, v, ScriptValue(value)); | |
1319 imp->setAnyAttribute(WTF::getPtr(v)); | |
1320 return; | |
1321 } | |
1322 | |
1323 static void anyAttributeAttrSetterCallback(v8::Local<v8::String> name, v8::Local
<v8::Value> value, const v8::AccessorInfo& info) | |
1324 { | |
1325 TestObjV8Internal::anyAttributeAttrSetter(name, value, info); | |
1326 } | |
1327 | |
1328 static v8::Handle<v8::Value> enabledAtRuntimeAttr1AttrGetter(v8::Local<v8::Strin
g> name, const v8::AccessorInfo& info) | |
1329 { | |
1330 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
1331 return v8Integer(imp->enabledAtRuntimeAttr1(), info.GetIsolate()); | |
1332 } | |
1333 | |
1334 static v8::Handle<v8::Value> enabledAtRuntimeAttr1AttrGetterCallback(v8::Local<v
8::String> name, const v8::AccessorInfo& info) | |
1335 { | |
1336 return TestObjV8Internal::enabledAtRuntimeAttr1AttrGetter(name, info); | |
1337 } | |
1338 | |
1339 static void enabledAtRuntimeAttr1AttrSetter(v8::Local<v8::String> name, v8::Loca
l<v8::Value> value, const v8::AccessorInfo& info) | |
1340 { | |
1341 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
1342 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
1343 imp->setEnabledAtRuntimeAttr1(v); | |
1344 return; | |
1345 } | |
1346 | |
1347 static void enabledAtRuntimeAttr1AttrSetterCallback(v8::Local<v8::String> name,
v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
1348 { | |
1349 TestObjV8Internal::enabledAtRuntimeAttr1AttrSetter(name, value, info); | |
1350 } | |
1351 | |
1352 static v8::Handle<v8::Value> enabledAtRuntimeAttr2AttrGetter(v8::Local<v8::Strin
g> name, const v8::AccessorInfo& info) | |
1353 { | |
1354 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
1355 return v8Integer(imp->enabledAtRuntimeAttr2(), info.GetIsolate()); | |
1356 } | |
1357 | |
1358 static v8::Handle<v8::Value> enabledAtRuntimeAttr2AttrGetterCallback(v8::Local<v
8::String> name, const v8::AccessorInfo& info) | |
1359 { | |
1360 return TestObjV8Internal::enabledAtRuntimeAttr2AttrGetter(name, info); | |
1361 } | |
1362 | |
1363 static void enabledAtRuntimeAttr2AttrSetter(v8::Local<v8::String> name, v8::Loca
l<v8::Value> value, const v8::AccessorInfo& info) | |
1364 { | |
1365 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
1366 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
1367 imp->setEnabledAtRuntimeAttr2(v); | |
1368 return; | |
1369 } | |
1370 | |
1371 static void enabledAtRuntimeAttr2AttrSetterCallback(v8::Local<v8::String> name,
v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
1372 { | |
1373 TestObjV8Internal::enabledAtRuntimeAttr2AttrSetter(name, value, info); | |
1374 } | |
1375 | |
1376 static v8::Handle<v8::Value> enabledPerContextAttr1AttrGetter(v8::Local<v8::Stri
ng> name, const v8::AccessorInfo& info) | |
1377 { | |
1378 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
1379 return v8Integer(imp->enabledPerContextAttr1(), info.GetIsolate()); | |
1380 } | |
1381 | |
1382 static v8::Handle<v8::Value> enabledPerContextAttr1AttrGetterCallback(v8::Local<
v8::String> name, const v8::AccessorInfo& info) | |
1383 { | |
1384 return TestObjV8Internal::enabledPerContextAttr1AttrGetter(name, info); | |
1385 } | |
1386 | |
1387 static void enabledPerContextAttr1AttrSetter(v8::Local<v8::String> name, v8::Loc
al<v8::Value> value, const v8::AccessorInfo& info) | |
1388 { | |
1389 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
1390 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
1391 imp->setEnabledPerContextAttr1(v); | |
1392 return; | |
1393 } | |
1394 | |
1395 static void enabledPerContextAttr1AttrSetterCallback(v8::Local<v8::String> name,
v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
1396 { | |
1397 TestObjV8Internal::enabledPerContextAttr1AttrSetter(name, value, info); | |
1398 } | |
1399 | |
1400 static v8::Handle<v8::Value> enabledPerContextAttr2AttrGetter(v8::Local<v8::Stri
ng> name, const v8::AccessorInfo& info) | |
1401 { | |
1402 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
1403 return v8Integer(imp->enabledPerContextAttr2(), info.GetIsolate()); | |
1404 } | |
1405 | |
1406 static v8::Handle<v8::Value> enabledPerContextAttr2AttrGetterCallback(v8::Local<
v8::String> name, const v8::AccessorInfo& info) | |
1407 { | |
1408 return TestObjV8Internal::enabledPerContextAttr2AttrGetter(name, info); | |
1409 } | |
1410 | |
1411 static void enabledPerContextAttr2AttrSetter(v8::Local<v8::String> name, v8::Loc
al<v8::Value> value, const v8::AccessorInfo& info) | |
1412 { | |
1413 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
1414 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
1415 imp->setEnabledPerContextAttr2(v); | |
1416 return; | |
1417 } | |
1418 | |
1419 static void enabledPerContextAttr2AttrSetterCallback(v8::Local<v8::String> name,
v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
1420 { | |
1421 TestObjV8Internal::enabledPerContextAttr2AttrSetter(name, value, info); | |
1422 } | |
1423 | |
1424 static v8::Handle<v8::Value> floatArrayAttrGetter(v8::Local<v8::String> name, co
nst v8::AccessorInfo& info) | |
1425 { | |
1426 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
1427 return v8Array(imp->floatArray(), info.GetIsolate()); | |
1428 } | |
1429 | |
1430 static v8::Handle<v8::Value> floatArrayAttrGetterCallback(v8::Local<v8::String>
name, const v8::AccessorInfo& info) | |
1431 { | |
1432 return TestObjV8Internal::floatArrayAttrGetter(name, info); | |
1433 } | |
1434 | |
1435 static void floatArrayAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value
> value, const v8::AccessorInfo& info) | |
1436 { | |
1437 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
1438 V8TRYCATCH_VOID(Vector<float>, v, toNativeArray<float>(value)); | |
1439 imp->setFloatArray(v); | |
1440 return; | |
1441 } | |
1442 | |
1443 static void floatArrayAttrSetterCallback(v8::Local<v8::String> name, v8::Local<v
8::Value> value, const v8::AccessorInfo& info) | |
1444 { | |
1445 TestObjV8Internal::floatArrayAttrSetter(name, value, info); | |
1446 } | |
1447 | |
1448 static v8::Handle<v8::Value> doubleArrayAttrGetter(v8::Local<v8::String> name, c
onst v8::AccessorInfo& info) | |
1449 { | |
1450 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
1451 return v8Array(imp->doubleArray(), info.GetIsolate()); | |
1452 } | |
1453 | |
1454 static v8::Handle<v8::Value> doubleArrayAttrGetterCallback(v8::Local<v8::String>
name, const v8::AccessorInfo& info) | |
1455 { | |
1456 return TestObjV8Internal::doubleArrayAttrGetter(name, info); | |
1457 } | |
1458 | |
1459 static void doubleArrayAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Valu
e> value, const v8::AccessorInfo& info) | |
1460 { | |
1461 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
1462 V8TRYCATCH_VOID(Vector<double>, v, toNativeArray<double>(value)); | |
1463 imp->setDoubleArray(v); | |
1464 return; | |
1465 } | |
1466 | |
1467 static void doubleArrayAttrSetterCallback(v8::Local<v8::String> name, v8::Local<
v8::Value> value, const v8::AccessorInfo& info) | |
1468 { | |
1469 TestObjV8Internal::doubleArrayAttrSetter(name, value, info); | |
1470 } | |
1471 | |
1472 static v8::Handle<v8::Value> contentDocumentAttrGetter(v8::Local<v8::String> nam
e, const v8::AccessorInfo& info) | |
1473 { | |
1474 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
1475 if (!BindingSecurity::shouldAllowAccessToNode(imp->contentDocument())) | |
1476 return v8::Handle<v8::Value>(v8Null(info.GetIsolate())); | |
1477 | |
1478 return toV8Fast(imp->contentDocument(), info, imp); | |
1479 } | |
1480 | |
1481 static v8::Handle<v8::Value> contentDocumentAttrGetterCallback(v8::Local<v8::Str
ing> name, const v8::AccessorInfo& info) | |
1482 { | |
1483 return TestObjV8Internal::contentDocumentAttrGetter(name, info); | |
1484 } | |
1485 | |
1486 static v8::Handle<v8::Value> mutablePointAttrGetter(v8::Local<v8::String> name,
const v8::AccessorInfo& info) | |
1487 { | |
1488 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
1489 return toV8Fast(WTF::getPtr(SVGStaticPropertyTearOff<TestObj, FloatPoint>::c
reate(imp, imp->mutablePoint(), &TestObj::updateMutablePoint)), info, imp); | |
1490 } | |
1491 | |
1492 static v8::Handle<v8::Value> mutablePointAttrGetterCallback(v8::Local<v8::String
> name, const v8::AccessorInfo& info) | |
1493 { | |
1494 return TestObjV8Internal::mutablePointAttrGetter(name, info); | |
1495 } | |
1496 | |
1497 static void mutablePointAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Val
ue> value, const v8::AccessorInfo& info) | |
1498 { | |
1499 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
1500 V8TRYCATCH_VOID(RefPtr<SVGPropertyTearOff<FloatPoint> >, v, V8SVGPoint::HasI
nstance(value, info.GetIsolate(), worldType(info.GetIsolate())) ? V8SVGPoint::to
Native(v8::Handle<v8::Object>::Cast(value)) : 0); | |
1501 imp->setMutablePoint(WTF::getPtr(v)); | |
1502 return; | |
1503 } | |
1504 | |
1505 static void mutablePointAttrSetterCallback(v8::Local<v8::String> name, v8::Local
<v8::Value> value, const v8::AccessorInfo& info) | |
1506 { | |
1507 TestObjV8Internal::mutablePointAttrSetter(name, value, info); | |
1508 } | |
1509 | |
1510 static v8::Handle<v8::Value> immutablePointAttrGetter(v8::Local<v8::String> name
, const v8::AccessorInfo& info) | |
1511 { | |
1512 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
1513 return toV8Fast(WTF::getPtr(SVGPropertyTearOff<FloatPoint>::create(imp->immu
tablePoint())), info, imp); | |
1514 } | |
1515 | |
1516 static v8::Handle<v8::Value> immutablePointAttrGetterCallback(v8::Local<v8::Stri
ng> name, const v8::AccessorInfo& info) | |
1517 { | |
1518 return TestObjV8Internal::immutablePointAttrGetter(name, info); | |
1519 } | |
1520 | |
1521 static void immutablePointAttrSetter(v8::Local<v8::String> name, v8::Local<v8::V
alue> value, const v8::AccessorInfo& info) | |
1522 { | |
1523 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
1524 V8TRYCATCH_VOID(RefPtr<SVGPropertyTearOff<FloatPoint> >, v, V8SVGPoint::HasI
nstance(value, info.GetIsolate(), worldType(info.GetIsolate())) ? V8SVGPoint::to
Native(v8::Handle<v8::Object>::Cast(value)) : 0); | |
1525 imp->setImmutablePoint(WTF::getPtr(v)); | |
1526 return; | |
1527 } | |
1528 | |
1529 static void immutablePointAttrSetterCallback(v8::Local<v8::String> name, v8::Loc
al<v8::Value> value, const v8::AccessorInfo& info) | |
1530 { | |
1531 TestObjV8Internal::immutablePointAttrSetter(name, value, info); | |
1532 } | |
1533 | |
1534 static v8::Handle<v8::Value> strawberryAttrGetter(v8::Local<v8::String> name, co
nst v8::AccessorInfo& info) | |
1535 { | |
1536 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
1537 return v8Integer(imp->blueberry(), info.GetIsolate()); | |
1538 } | |
1539 | |
1540 static v8::Handle<v8::Value> strawberryAttrGetterCallback(v8::Local<v8::String>
name, const v8::AccessorInfo& info) | |
1541 { | |
1542 return TestObjV8Internal::strawberryAttrGetter(name, info); | |
1543 } | |
1544 | |
1545 static void strawberryAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value
> value, const v8::AccessorInfo& info) | |
1546 { | |
1547 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
1548 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
1549 imp->setBlueberry(v); | |
1550 return; | |
1551 } | |
1552 | |
1553 static void strawberryAttrSetterCallback(v8::Local<v8::String> name, v8::Local<v
8::Value> value, const v8::AccessorInfo& info) | |
1554 { | |
1555 TestObjV8Internal::strawberryAttrSetter(name, value, info); | |
1556 } | |
1557 | |
1558 static v8::Handle<v8::Value> strictFloatAttrGetter(v8::Local<v8::String> name, c
onst v8::AccessorInfo& info) | |
1559 { | |
1560 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
1561 return v8::Number::New(imp->strictFloat()); | |
1562 } | |
1563 | |
1564 static v8::Handle<v8::Value> strictFloatAttrGetterCallback(v8::Local<v8::String>
name, const v8::AccessorInfo& info) | |
1565 { | |
1566 return TestObjV8Internal::strictFloatAttrGetter(name, info); | |
1567 } | |
1568 | |
1569 static void strictFloatAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Valu
e> value, const v8::AccessorInfo& info) | |
1570 { | |
1571 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
1572 V8TRYCATCH_VOID(float, v, static_cast<float>(value->NumberValue())); | |
1573 imp->setStrictFloat(v); | |
1574 return; | |
1575 } | |
1576 | |
1577 static void strictFloatAttrSetterCallback(v8::Local<v8::String> name, v8::Local<
v8::Value> value, const v8::AccessorInfo& info) | |
1578 { | |
1579 TestObjV8Internal::strictFloatAttrSetter(name, value, info); | |
1580 } | |
1581 | |
1582 static v8::Handle<v8::Value> descriptionAttrGetter(v8::Local<v8::String> name, c
onst v8::AccessorInfo& info) | |
1583 { | |
1584 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
1585 return v8Integer(imp->description(), info.GetIsolate()); | |
1586 } | |
1587 | |
1588 static v8::Handle<v8::Value> descriptionAttrGetterCallback(v8::Local<v8::String>
name, const v8::AccessorInfo& info) | |
1589 { | |
1590 return TestObjV8Internal::descriptionAttrGetter(name, info); | |
1591 } | |
1592 | |
1593 static v8::Handle<v8::Value> idAttrGetter(v8::Local<v8::String> name, const v8::
AccessorInfo& info) | |
1594 { | |
1595 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
1596 return v8Integer(imp->id(), info.GetIsolate()); | |
1597 } | |
1598 | |
1599 static v8::Handle<v8::Value> idAttrGetterCallback(v8::Local<v8::String> name, co
nst v8::AccessorInfo& info) | |
1600 { | |
1601 return TestObjV8Internal::idAttrGetter(name, info); | |
1602 } | |
1603 | |
1604 static void idAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value,
const v8::AccessorInfo& info) | |
1605 { | |
1606 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
1607 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
1608 imp->setId(v); | |
1609 return; | |
1610 } | |
1611 | |
1612 static void idAttrSetterCallback(v8::Local<v8::String> name, v8::Local<v8::Value
> value, const v8::AccessorInfo& info) | |
1613 { | |
1614 TestObjV8Internal::idAttrSetter(name, value, info); | |
1615 } | |
1616 | |
1617 static v8::Handle<v8::Value> hashAttrGetter(v8::Local<v8::String> name, const v8
::AccessorInfo& info) | |
1618 { | |
1619 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
1620 return v8String(imp->hash(), info.GetIsolate(), ReturnUnsafeHandle); | |
1621 } | |
1622 | |
1623 static v8::Handle<v8::Value> hashAttrGetterCallback(v8::Local<v8::String> name,
const v8::AccessorInfo& info) | |
1624 { | |
1625 return TestObjV8Internal::hashAttrGetter(name, info); | |
1626 } | |
1627 | |
1628 static v8::Handle<v8::Value> replaceableAttributeAttrGetter(v8::Local<v8::String
> name, const v8::AccessorInfo& info) | |
1629 { | |
1630 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
1631 return v8Integer(imp->replaceableAttribute(), info.GetIsolate()); | |
1632 } | |
1633 | |
1634 static v8::Handle<v8::Value> replaceableAttributeAttrGetterCallback(v8::Local<v8
::String> name, const v8::AccessorInfo& info) | |
1635 { | |
1636 return TestObjV8Internal::replaceableAttributeAttrGetter(name, info); | |
1637 } | |
1638 | |
1639 static v8::Handle<v8::Value> nullableDoubleAttributeAttrGetter(v8::Local<v8::Str
ing> name, const v8::AccessorInfo& info) | |
1640 { | |
1641 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
1642 bool isNull = false; | |
1643 double v = imp->nullableDoubleAttribute(isNull); | |
1644 if (isNull) | |
1645 return v8Null(info.GetIsolate()); | |
1646 return v8::Number::New(v); | |
1647 } | |
1648 | |
1649 static v8::Handle<v8::Value> nullableDoubleAttributeAttrGetterCallback(v8::Local
<v8::String> name, const v8::AccessorInfo& info) | |
1650 { | |
1651 return TestObjV8Internal::nullableDoubleAttributeAttrGetter(name, info); | |
1652 } | |
1653 | |
1654 static v8::Handle<v8::Value> nullableLongAttributeAttrGetter(v8::Local<v8::Strin
g> name, const v8::AccessorInfo& info) | |
1655 { | |
1656 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
1657 bool isNull = false; | |
1658 int v = imp->nullableLongAttribute(isNull); | |
1659 if (isNull) | |
1660 return v8Null(info.GetIsolate()); | |
1661 return v8Integer(v, info.GetIsolate()); | |
1662 } | |
1663 | |
1664 static v8::Handle<v8::Value> nullableLongAttributeAttrGetterCallback(v8::Local<v
8::String> name, const v8::AccessorInfo& info) | |
1665 { | |
1666 return TestObjV8Internal::nullableLongAttributeAttrGetter(name, info); | |
1667 } | |
1668 | |
1669 static v8::Handle<v8::Value> nullableBooleanAttributeAttrGetter(v8::Local<v8::St
ring> name, const v8::AccessorInfo& info) | |
1670 { | |
1671 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
1672 bool isNull = false; | |
1673 bool v = imp->nullableBooleanAttribute(isNull); | |
1674 if (isNull) | |
1675 return v8Null(info.GetIsolate()); | |
1676 return v8Boolean(v, info.GetIsolate()); | |
1677 } | |
1678 | |
1679 static v8::Handle<v8::Value> nullableBooleanAttributeAttrGetterCallback(v8::Loca
l<v8::String> name, const v8::AccessorInfo& info) | |
1680 { | |
1681 return TestObjV8Internal::nullableBooleanAttributeAttrGetter(name, info); | |
1682 } | |
1683 | |
1684 static v8::Handle<v8::Value> nullableStringAttributeAttrGetter(v8::Local<v8::Str
ing> name, const v8::AccessorInfo& info) | |
1685 { | |
1686 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
1687 bool isNull = false; | |
1688 String v = imp->nullableStringAttribute(isNull); | |
1689 if (isNull) | |
1690 return v8Null(info.GetIsolate()); | |
1691 return v8String(v, info.GetIsolate(), ReturnUnsafeHandle); | |
1692 } | |
1693 | |
1694 static v8::Handle<v8::Value> nullableStringAttributeAttrGetterCallback(v8::Local
<v8::String> name, const v8::AccessorInfo& info) | |
1695 { | |
1696 return TestObjV8Internal::nullableStringAttributeAttrGetter(name, info); | |
1697 } | |
1698 | |
1699 static v8::Handle<v8::Value> nullableLongSettableAttributeAttrGetter(v8::Local<v
8::String> name, const v8::AccessorInfo& info) | |
1700 { | |
1701 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
1702 bool isNull = false; | |
1703 int v = imp->nullableLongSettableAttribute(isNull); | |
1704 if (isNull) | |
1705 return v8Null(info.GetIsolate()); | |
1706 return v8Integer(v, info.GetIsolate()); | |
1707 } | |
1708 | |
1709 static v8::Handle<v8::Value> nullableLongSettableAttributeAttrGetterCallback(v8:
:Local<v8::String> name, const v8::AccessorInfo& info) | |
1710 { | |
1711 return TestObjV8Internal::nullableLongSettableAttributeAttrGetter(name, info
); | |
1712 } | |
1713 | |
1714 static void nullableLongSettableAttributeAttrSetter(v8::Local<v8::String> name,
v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
1715 { | |
1716 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
1717 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
1718 imp->setNullableLongSettableAttribute(v); | |
1719 return; | |
1720 } | |
1721 | |
1722 static void nullableLongSettableAttributeAttrSetterCallback(v8::Local<v8::String
> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
1723 { | |
1724 TestObjV8Internal::nullableLongSettableAttributeAttrSetter(name, value, info
); | |
1725 } | |
1726 | |
1727 static v8::Handle<v8::Value> nullableStringValueAttrGetter(v8::Local<v8::String>
name, const v8::AccessorInfo& info) | |
1728 { | |
1729 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
1730 ExceptionCode ec = 0; | |
1731 bool isNull = false; | |
1732 int v = imp->nullableStringValue(isNull, ec); | |
1733 if (isNull) | |
1734 return v8Null(info.GetIsolate()); | |
1735 if (UNLIKELY(ec)) | |
1736 return setDOMException(ec, info.GetIsolate()); | |
1737 return v8Integer(v, info.GetIsolate()); | |
1738 } | |
1739 | |
1740 static v8::Handle<v8::Value> nullableStringValueAttrGetterCallback(v8::Local<v8:
:String> name, const v8::AccessorInfo& info) | |
1741 { | |
1742 return TestObjV8Internal::nullableStringValueAttrGetter(name, info); | |
1743 } | |
1744 | |
1745 static void nullableStringValueAttrSetter(v8::Local<v8::String> name, v8::Local<
v8::Value> value, const v8::AccessorInfo& info) | |
1746 { | |
1747 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
1748 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
1749 imp->setNullableStringValue(v); | |
1750 return; | |
1751 } | |
1752 | |
1753 static void nullableStringValueAttrSetterCallback(v8::Local<v8::String> name, v8
::Local<v8::Value> value, const v8::AccessorInfo& info) | |
1754 { | |
1755 TestObjV8Internal::nullableStringValueAttrSetter(name, value, info); | |
1756 } | |
1757 | |
1758 static v8::Handle<v8::Value> perWorldReadOnlyAttributeAttrGetter(v8::Local<v8::S
tring> name, const v8::AccessorInfo& info) | |
1759 { | |
1760 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
1761 RefPtr<TestObj> result = imp->perWorldReadOnlyAttribute(); | |
1762 v8::Handle<v8::Value> wrapper = result.get() ? v8::Handle<v8::Value>(DOMData
Store::getWrapper(result.get(), info.GetIsolate())) : v8Undefined(); | |
1763 if (wrapper.IsEmpty()) { | |
1764 wrapper = toV8(result.get(), info.Holder(), info.GetIsolate()); | |
1765 if (!wrapper.IsEmpty()) | |
1766 V8HiddenPropertyName::setNamedHiddenReference(info.Holder(), "perWor
ldReadOnlyAttribute", wrapper); | |
1767 } | |
1768 return wrapper; | |
1769 } | |
1770 | |
1771 static v8::Handle<v8::Value> perWorldReadOnlyAttributeAttrGetterCallback(v8::Loc
al<v8::String> name, const v8::AccessorInfo& info) | |
1772 { | |
1773 return TestObjV8Internal::perWorldReadOnlyAttributeAttrGetter(name, info); | |
1774 } | |
1775 | |
1776 static v8::Handle<v8::Value> perWorldReadOnlyAttributeAttrGetterForMainWorld(v8:
:Local<v8::String> name, const v8::AccessorInfo& info) | |
1777 { | |
1778 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
1779 RefPtr<TestObj> result = imp->perWorldReadOnlyAttribute(); | |
1780 v8::Handle<v8::Value> wrapper = result.get() ? v8::Handle<v8::Value>(DOMData
Store::getWrapperForMainWorld(result.get())) : v8Undefined(); | |
1781 if (wrapper.IsEmpty()) { | |
1782 wrapper = toV8(result.get(), info.Holder(), info.GetIsolate()); | |
1783 if (!wrapper.IsEmpty()) | |
1784 V8HiddenPropertyName::setNamedHiddenReference(info.Holder(), "perWor
ldReadOnlyAttribute", wrapper); | |
1785 } | |
1786 return wrapper; | |
1787 } | |
1788 | |
1789 static v8::Handle<v8::Value> perWorldReadOnlyAttributeAttrGetterCallbackForMainW
orld(v8::Local<v8::String> name, const v8::AccessorInfo& info) | |
1790 { | |
1791 return TestObjV8Internal::perWorldReadOnlyAttributeAttrGetterForMainWorld(na
me, info); | |
1792 } | |
1793 | |
1794 static v8::Handle<v8::Value> perWorldAttributeAttrGetter(v8::Local<v8::String> n
ame, const v8::AccessorInfo& info) | |
1795 { | |
1796 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
1797 return toV8Fast(imp->perWorldAttribute(), info, imp); | |
1798 } | |
1799 | |
1800 static v8::Handle<v8::Value> perWorldAttributeAttrGetterCallback(v8::Local<v8::S
tring> name, const v8::AccessorInfo& info) | |
1801 { | |
1802 return TestObjV8Internal::perWorldAttributeAttrGetter(name, info); | |
1803 } | |
1804 | |
1805 static v8::Handle<v8::Value> perWorldAttributeAttrGetterForMainWorld(v8::Local<v
8::String> name, const v8::AccessorInfo& info) | |
1806 { | |
1807 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
1808 return toV8FastForMainWorld(imp->perWorldAttribute(), info, imp); | |
1809 } | |
1810 | |
1811 static v8::Handle<v8::Value> perWorldAttributeAttrGetterCallbackForMainWorld(v8:
:Local<v8::String> name, const v8::AccessorInfo& info) | |
1812 { | |
1813 return TestObjV8Internal::perWorldAttributeAttrGetterForMainWorld(name, info
); | |
1814 } | |
1815 | |
1816 static void perWorldAttributeAttrSetter(v8::Local<v8::String> name, v8::Local<v8
::Value> value, const v8::AccessorInfo& info) | |
1817 { | |
1818 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
1819 V8TRYCATCH_VOID(TestObj*, v, V8TestObj::HasInstance(value, info.GetIsolate()
, worldType(info.GetIsolate())) ? V8TestObj::toNative(v8::Handle<v8::Object>::Ca
st(value)) : 0); | |
1820 imp->setPerWorldAttribute(WTF::getPtr(v)); | |
1821 return; | |
1822 } | |
1823 | |
1824 static void perWorldAttributeAttrSetterCallback(v8::Local<v8::String> name, v8::
Local<v8::Value> value, const v8::AccessorInfo& info) | |
1825 { | |
1826 TestObjV8Internal::perWorldAttributeAttrSetter(name, value, info); | |
1827 } | |
1828 | |
1829 static void perWorldAttributeAttrSetterForMainWorld(v8::Local<v8::String> name,
v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
1830 { | |
1831 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
1832 V8TRYCATCH_VOID(TestObj*, v, V8TestObj::HasInstance(value, info.GetIsolate()
, worldType(info.GetIsolate())) ? V8TestObj::toNative(v8::Handle<v8::Object>::Ca
st(value)) : 0); | |
1833 imp->setPerWorldAttribute(WTF::getPtr(v)); | |
1834 return; | |
1835 } | |
1836 | |
1837 static void perWorldAttributeAttrSetterCallbackForMainWorld(v8::Local<v8::String
> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
1838 { | |
1839 TestObjV8Internal::perWorldAttributeAttrSetterForMainWorld(name, value, info
); | |
1840 } | |
1841 | |
1842 static v8::Handle<v8::Value> activityLoggedAttr1AttrGetter(v8::Local<v8::String>
name, const v8::AccessorInfo& info) | |
1843 { | |
1844 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
1845 return v8Integer(imp->activityLoggedAttr1(), info.GetIsolate()); | |
1846 } | |
1847 | |
1848 static v8::Handle<v8::Value> activityLoggedAttr1AttrGetterCallback(v8::Local<v8:
:String> name, const v8::AccessorInfo& info) | |
1849 { | |
1850 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); | |
1851 if (contextData && contextData->activityLogger()) | |
1852 contextData->activityLogger()->log("TestObject.activityLoggedAttr1", 0,
0, "Getter"); | |
1853 return TestObjV8Internal::activityLoggedAttr1AttrGetter(name, info); | |
1854 } | |
1855 | |
1856 static void activityLoggedAttr1AttrSetter(v8::Local<v8::String> name, v8::Local<
v8::Value> value, const v8::AccessorInfo& info) | |
1857 { | |
1858 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
1859 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
1860 imp->setActivityLoggedAttr1(v); | |
1861 return; | |
1862 } | |
1863 | |
1864 static void activityLoggedAttr1AttrSetterCallback(v8::Local<v8::String> name, v8
::Local<v8::Value> value, const v8::AccessorInfo& info) | |
1865 { | |
1866 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); | |
1867 if (contextData && contextData->activityLogger()) { | |
1868 v8::Handle<v8::Value> loggerArg[] = { value }; | |
1869 contextData->activityLogger()->log("TestObject.activityLoggedAttr1", 1,
&loggerArg[0], "Setter"); | |
1870 } | |
1871 TestObjV8Internal::activityLoggedAttr1AttrSetter(name, value, info); | |
1872 } | |
1873 | |
1874 static v8::Handle<v8::Value> activityLoggedAttr2AttrGetter(v8::Local<v8::String>
name, const v8::AccessorInfo& info) | |
1875 { | |
1876 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
1877 return v8Integer(imp->activityLoggedAttr2(), info.GetIsolate()); | |
1878 } | |
1879 | |
1880 static v8::Handle<v8::Value> activityLoggedAttr2AttrGetterCallback(v8::Local<v8:
:String> name, const v8::AccessorInfo& info) | |
1881 { | |
1882 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); | |
1883 if (contextData && contextData->activityLogger()) | |
1884 contextData->activityLogger()->log("TestObject.activityLoggedAttr2", 0,
0, "Getter"); | |
1885 return TestObjV8Internal::activityLoggedAttr2AttrGetter(name, info); | |
1886 } | |
1887 | |
1888 static v8::Handle<v8::Value> activityLoggedAttr2AttrGetterForMainWorld(v8::Local
<v8::String> name, const v8::AccessorInfo& info) | |
1889 { | |
1890 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
1891 return v8Integer(imp->activityLoggedAttr2(), info.GetIsolate()); | |
1892 } | |
1893 | |
1894 static v8::Handle<v8::Value> activityLoggedAttr2AttrGetterCallbackForMainWorld(v
8::Local<v8::String> name, const v8::AccessorInfo& info) | |
1895 { | |
1896 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); | |
1897 if (contextData && contextData->activityLogger()) | |
1898 contextData->activityLogger()->log("TestObject.activityLoggedAttr2", 0,
0, "Getter"); | |
1899 return TestObjV8Internal::activityLoggedAttr2AttrGetterForMainWorld(name, in
fo); | |
1900 } | |
1901 | |
1902 static void activityLoggedAttr2AttrSetter(v8::Local<v8::String> name, v8::Local<
v8::Value> value, const v8::AccessorInfo& info) | |
1903 { | |
1904 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
1905 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
1906 imp->setActivityLoggedAttr2(v); | |
1907 return; | |
1908 } | |
1909 | |
1910 static void activityLoggedAttr2AttrSetterCallback(v8::Local<v8::String> name, v8
::Local<v8::Value> value, const v8::AccessorInfo& info) | |
1911 { | |
1912 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); | |
1913 if (contextData && contextData->activityLogger()) { | |
1914 v8::Handle<v8::Value> loggerArg[] = { value }; | |
1915 contextData->activityLogger()->log("TestObject.activityLoggedAttr2", 1,
&loggerArg[0], "Setter"); | |
1916 } | |
1917 TestObjV8Internal::activityLoggedAttr2AttrSetter(name, value, info); | |
1918 } | |
1919 | |
1920 static void activityLoggedAttr2AttrSetterForMainWorld(v8::Local<v8::String> name
, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
1921 { | |
1922 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
1923 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
1924 imp->setActivityLoggedAttr2(v); | |
1925 return; | |
1926 } | |
1927 | |
1928 static void activityLoggedAttr2AttrSetterCallbackForMainWorld(v8::Local<v8::Stri
ng> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
1929 { | |
1930 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); | |
1931 if (contextData && contextData->activityLogger()) { | |
1932 v8::Handle<v8::Value> loggerArg[] = { value }; | |
1933 contextData->activityLogger()->log("TestObject.activityLoggedAttr2", 1,
&loggerArg[0], "Setter"); | |
1934 } | |
1935 TestObjV8Internal::activityLoggedAttr2AttrSetterForMainWorld(name, value, in
fo); | |
1936 } | |
1937 | |
1938 static v8::Handle<v8::Value> activityLoggedInIsolatedWorldsAttrAttrGetter(v8::Lo
cal<v8::String> name, const v8::AccessorInfo& info) | |
1939 { | |
1940 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
1941 return v8Integer(imp->activityLoggedInIsolatedWorldsAttr(), info.GetIsolate(
)); | |
1942 } | |
1943 | |
1944 static v8::Handle<v8::Value> activityLoggedInIsolatedWorldsAttrAttrGetterCallbac
k(v8::Local<v8::String> name, const v8::AccessorInfo& info) | |
1945 { | |
1946 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); | |
1947 if (contextData && contextData->activityLogger()) | |
1948 contextData->activityLogger()->log("TestObject.activityLoggedInIsolatedW
orldsAttr", 0, 0, "Getter"); | |
1949 return TestObjV8Internal::activityLoggedInIsolatedWorldsAttrAttrGetter(name,
info); | |
1950 } | |
1951 | |
1952 static v8::Handle<v8::Value> activityLoggedInIsolatedWorldsAttrAttrGetterForMain
World(v8::Local<v8::String> name, const v8::AccessorInfo& info) | |
1953 { | |
1954 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
1955 return v8Integer(imp->activityLoggedInIsolatedWorldsAttr(), info.GetIsolate(
)); | |
1956 } | |
1957 | |
1958 static v8::Handle<v8::Value> activityLoggedInIsolatedWorldsAttrAttrGetterCallbac
kForMainWorld(v8::Local<v8::String> name, const v8::AccessorInfo& info) | |
1959 { | |
1960 return TestObjV8Internal::activityLoggedInIsolatedWorldsAttrAttrGetterForMai
nWorld(name, info); | |
1961 } | |
1962 | |
1963 static void activityLoggedInIsolatedWorldsAttrAttrSetter(v8::Local<v8::String> n
ame, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
1964 { | |
1965 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
1966 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
1967 imp->setActivityLoggedInIsolatedWorldsAttr(v); | |
1968 return; | |
1969 } | |
1970 | |
1971 static void activityLoggedInIsolatedWorldsAttrAttrSetterCallback(v8::Local<v8::S
tring> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
1972 { | |
1973 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); | |
1974 if (contextData && contextData->activityLogger()) { | |
1975 v8::Handle<v8::Value> loggerArg[] = { value }; | |
1976 contextData->activityLogger()->log("TestObject.activityLoggedInIsolatedW
orldsAttr", 1, &loggerArg[0], "Setter"); | |
1977 } | |
1978 TestObjV8Internal::activityLoggedInIsolatedWorldsAttrAttrSetter(name, value,
info); | |
1979 } | |
1980 | |
1981 static void activityLoggedInIsolatedWorldsAttrAttrSetterForMainWorld(v8::Local<v
8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
1982 { | |
1983 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
1984 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
1985 imp->setActivityLoggedInIsolatedWorldsAttr(v); | |
1986 return; | |
1987 } | |
1988 | |
1989 static void activityLoggedInIsolatedWorldsAttrAttrSetterCallbackForMainWorld(v8:
:Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& inf
o) | |
1990 { | |
1991 TestObjV8Internal::activityLoggedInIsolatedWorldsAttrAttrSetterForMainWorld(
name, value, info); | |
1992 } | |
1993 | |
1994 static v8::Handle<v8::Value> activityLoggedAttrSetter1AttrGetter(v8::Local<v8::S
tring> name, const v8::AccessorInfo& info) | |
1995 { | |
1996 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
1997 return v8Integer(imp->activityLoggedAttrSetter1(), info.GetIsolate()); | |
1998 } | |
1999 | |
2000 static v8::Handle<v8::Value> activityLoggedAttrSetter1AttrGetterCallback(v8::Loc
al<v8::String> name, const v8::AccessorInfo& info) | |
2001 { | |
2002 return TestObjV8Internal::activityLoggedAttrSetter1AttrGetter(name, info); | |
2003 } | |
2004 | |
2005 static void activityLoggedAttrSetter1AttrSetter(v8::Local<v8::String> name, v8::
Local<v8::Value> value, const v8::AccessorInfo& info) | |
2006 { | |
2007 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
2008 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
2009 imp->setActivityLoggedAttrSetter1(v); | |
2010 return; | |
2011 } | |
2012 | |
2013 static void activityLoggedAttrSetter1AttrSetterCallback(v8::Local<v8::String> na
me, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
2014 { | |
2015 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); | |
2016 if (contextData && contextData->activityLogger()) { | |
2017 v8::Handle<v8::Value> loggerArg[] = { value }; | |
2018 contextData->activityLogger()->log("TestObject.activityLoggedAttrSetter1
", 1, &loggerArg[0], "Setter"); | |
2019 } | |
2020 TestObjV8Internal::activityLoggedAttrSetter1AttrSetter(name, value, info); | |
2021 } | |
2022 | |
2023 static v8::Handle<v8::Value> activityLoggedAttrSetter2AttrGetter(v8::Local<v8::S
tring> name, const v8::AccessorInfo& info) | |
2024 { | |
2025 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
2026 return v8Integer(imp->activityLoggedAttrSetter2(), info.GetIsolate()); | |
2027 } | |
2028 | |
2029 static v8::Handle<v8::Value> activityLoggedAttrSetter2AttrGetterCallback(v8::Loc
al<v8::String> name, const v8::AccessorInfo& info) | |
2030 { | |
2031 return TestObjV8Internal::activityLoggedAttrSetter2AttrGetter(name, info); | |
2032 } | |
2033 | |
2034 static v8::Handle<v8::Value> activityLoggedAttrSetter2AttrGetterForMainWorld(v8:
:Local<v8::String> name, const v8::AccessorInfo& info) | |
2035 { | |
2036 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
2037 return v8Integer(imp->activityLoggedAttrSetter2(), info.GetIsolate()); | |
2038 } | |
2039 | |
2040 static v8::Handle<v8::Value> activityLoggedAttrSetter2AttrGetterCallbackForMainW
orld(v8::Local<v8::String> name, const v8::AccessorInfo& info) | |
2041 { | |
2042 return TestObjV8Internal::activityLoggedAttrSetter2AttrGetterForMainWorld(na
me, info); | |
2043 } | |
2044 | |
2045 static void activityLoggedAttrSetter2AttrSetter(v8::Local<v8::String> name, v8::
Local<v8::Value> value, const v8::AccessorInfo& info) | |
2046 { | |
2047 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
2048 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
2049 imp->setActivityLoggedAttrSetter2(v); | |
2050 return; | |
2051 } | |
2052 | |
2053 static void activityLoggedAttrSetter2AttrSetterCallback(v8::Local<v8::String> na
me, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
2054 { | |
2055 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); | |
2056 if (contextData && contextData->activityLogger()) { | |
2057 v8::Handle<v8::Value> loggerArg[] = { value }; | |
2058 contextData->activityLogger()->log("TestObject.activityLoggedAttrSetter2
", 1, &loggerArg[0], "Setter"); | |
2059 } | |
2060 TestObjV8Internal::activityLoggedAttrSetter2AttrSetter(name, value, info); | |
2061 } | |
2062 | |
2063 static void activityLoggedAttrSetter2AttrSetterForMainWorld(v8::Local<v8::String
> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
2064 { | |
2065 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
2066 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
2067 imp->setActivityLoggedAttrSetter2(v); | |
2068 return; | |
2069 } | |
2070 | |
2071 static void activityLoggedAttrSetter2AttrSetterCallbackForMainWorld(v8::Local<v8
::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
2072 { | |
2073 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); | |
2074 if (contextData && contextData->activityLogger()) { | |
2075 v8::Handle<v8::Value> loggerArg[] = { value }; | |
2076 contextData->activityLogger()->log("TestObject.activityLoggedAttrSetter2
", 1, &loggerArg[0], "Setter"); | |
2077 } | |
2078 TestObjV8Internal::activityLoggedAttrSetter2AttrSetterForMainWorld(name, val
ue, info); | |
2079 } | |
2080 | |
2081 static v8::Handle<v8::Value> activityLoggedInIsolatedWorldsAttrSetterAttrGetter(
v8::Local<v8::String> name, const v8::AccessorInfo& info) | |
2082 { | |
2083 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
2084 return v8Integer(imp->activityLoggedInIsolatedWorldsAttrSetter(), info.GetIs
olate()); | |
2085 } | |
2086 | |
2087 static v8::Handle<v8::Value> activityLoggedInIsolatedWorldsAttrSetterAttrGetterC
allback(v8::Local<v8::String> name, const v8::AccessorInfo& info) | |
2088 { | |
2089 return TestObjV8Internal::activityLoggedInIsolatedWorldsAttrSetterAttrGetter
(name, info); | |
2090 } | |
2091 | |
2092 static v8::Handle<v8::Value> activityLoggedInIsolatedWorldsAttrSetterAttrGetterF
orMainWorld(v8::Local<v8::String> name, const v8::AccessorInfo& info) | |
2093 { | |
2094 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
2095 return v8Integer(imp->activityLoggedInIsolatedWorldsAttrSetter(), info.GetIs
olate()); | |
2096 } | |
2097 | |
2098 static v8::Handle<v8::Value> activityLoggedInIsolatedWorldsAttrSetterAttrGetterC
allbackForMainWorld(v8::Local<v8::String> name, const v8::AccessorInfo& info) | |
2099 { | |
2100 return TestObjV8Internal::activityLoggedInIsolatedWorldsAttrSetterAttrGetter
ForMainWorld(name, info); | |
2101 } | |
2102 | |
2103 static void activityLoggedInIsolatedWorldsAttrSetterAttrSetter(v8::Local<v8::Str
ing> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
2104 { | |
2105 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
2106 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
2107 imp->setActivityLoggedInIsolatedWorldsAttrSetter(v); | |
2108 return; | |
2109 } | |
2110 | |
2111 static void activityLoggedInIsolatedWorldsAttrSetterAttrSetterCallback(v8::Local
<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
2112 { | |
2113 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); | |
2114 if (contextData && contextData->activityLogger()) { | |
2115 v8::Handle<v8::Value> loggerArg[] = { value }; | |
2116 contextData->activityLogger()->log("TestObject.activityLoggedInIsolatedW
orldsAttrSetter", 1, &loggerArg[0], "Setter"); | |
2117 } | |
2118 TestObjV8Internal::activityLoggedInIsolatedWorldsAttrSetterAttrSetter(name,
value, info); | |
2119 } | |
2120 | |
2121 static void activityLoggedInIsolatedWorldsAttrSetterAttrSetterForMainWorld(v8::L
ocal<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
2122 { | |
2123 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
2124 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
2125 imp->setActivityLoggedInIsolatedWorldsAttrSetter(v); | |
2126 return; | |
2127 } | |
2128 | |
2129 static void activityLoggedInIsolatedWorldsAttrSetterAttrSetterCallbackForMainWor
ld(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInf
o& info) | |
2130 { | |
2131 TestObjV8Internal::activityLoggedInIsolatedWorldsAttrSetterAttrSetterForMain
World(name, value, info); | |
2132 } | |
2133 | |
2134 static v8::Handle<v8::Value> activityLoggedAttrGetter1AttrGetter(v8::Local<v8::S
tring> name, const v8::AccessorInfo& info) | |
2135 { | |
2136 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
2137 return v8Integer(imp->activityLoggedAttrGetter1(), info.GetIsolate()); | |
2138 } | |
2139 | |
2140 static v8::Handle<v8::Value> activityLoggedAttrGetter1AttrGetterCallback(v8::Loc
al<v8::String> name, const v8::AccessorInfo& info) | |
2141 { | |
2142 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); | |
2143 if (contextData && contextData->activityLogger()) | |
2144 contextData->activityLogger()->log("TestObject.activityLoggedAttrGetter1
", 0, 0, "Getter"); | |
2145 return TestObjV8Internal::activityLoggedAttrGetter1AttrGetter(name, info); | |
2146 } | |
2147 | |
2148 static void activityLoggedAttrGetter1AttrSetter(v8::Local<v8::String> name, v8::
Local<v8::Value> value, const v8::AccessorInfo& info) | |
2149 { | |
2150 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
2151 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
2152 imp->setActivityLoggedAttrGetter1(v); | |
2153 return; | |
2154 } | |
2155 | |
2156 static void activityLoggedAttrGetter1AttrSetterCallback(v8::Local<v8::String> na
me, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
2157 { | |
2158 TestObjV8Internal::activityLoggedAttrGetter1AttrSetter(name, value, info); | |
2159 } | |
2160 | |
2161 static v8::Handle<v8::Value> activityLoggedAttrGetter2AttrGetter(v8::Local<v8::S
tring> name, const v8::AccessorInfo& info) | |
2162 { | |
2163 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
2164 return v8Integer(imp->activityLoggedAttrGetter2(), info.GetIsolate()); | |
2165 } | |
2166 | |
2167 static v8::Handle<v8::Value> activityLoggedAttrGetter2AttrGetterCallback(v8::Loc
al<v8::String> name, const v8::AccessorInfo& info) | |
2168 { | |
2169 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); | |
2170 if (contextData && contextData->activityLogger()) | |
2171 contextData->activityLogger()->log("TestObject.activityLoggedAttrGetter2
", 0, 0, "Getter"); | |
2172 return TestObjV8Internal::activityLoggedAttrGetter2AttrGetter(name, info); | |
2173 } | |
2174 | |
2175 static v8::Handle<v8::Value> activityLoggedAttrGetter2AttrGetterForMainWorld(v8:
:Local<v8::String> name, const v8::AccessorInfo& info) | |
2176 { | |
2177 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
2178 return v8Integer(imp->activityLoggedAttrGetter2(), info.GetIsolate()); | |
2179 } | |
2180 | |
2181 static v8::Handle<v8::Value> activityLoggedAttrGetter2AttrGetterCallbackForMainW
orld(v8::Local<v8::String> name, const v8::AccessorInfo& info) | |
2182 { | |
2183 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); | |
2184 if (contextData && contextData->activityLogger()) | |
2185 contextData->activityLogger()->log("TestObject.activityLoggedAttrGetter2
", 0, 0, "Getter"); | |
2186 return TestObjV8Internal::activityLoggedAttrGetter2AttrGetterForMainWorld(na
me, info); | |
2187 } | |
2188 | |
2189 static void activityLoggedAttrGetter2AttrSetter(v8::Local<v8::String> name, v8::
Local<v8::Value> value, const v8::AccessorInfo& info) | |
2190 { | |
2191 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
2192 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
2193 imp->setActivityLoggedAttrGetter2(v); | |
2194 return; | |
2195 } | |
2196 | |
2197 static void activityLoggedAttrGetter2AttrSetterCallback(v8::Local<v8::String> na
me, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
2198 { | |
2199 TestObjV8Internal::activityLoggedAttrGetter2AttrSetter(name, value, info); | |
2200 } | |
2201 | |
2202 static void activityLoggedAttrGetter2AttrSetterForMainWorld(v8::Local<v8::String
> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
2203 { | |
2204 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
2205 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
2206 imp->setActivityLoggedAttrGetter2(v); | |
2207 return; | |
2208 } | |
2209 | |
2210 static void activityLoggedAttrGetter2AttrSetterCallbackForMainWorld(v8::Local<v8
::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
2211 { | |
2212 TestObjV8Internal::activityLoggedAttrGetter2AttrSetterForMainWorld(name, val
ue, info); | |
2213 } | |
2214 | |
2215 static v8::Handle<v8::Value> activityLoggedInIsolatedWorldsAttrGetterAttrGetter(
v8::Local<v8::String> name, const v8::AccessorInfo& info) | |
2216 { | |
2217 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
2218 return v8Integer(imp->activityLoggedInIsolatedWorldsAttrGetter(), info.GetIs
olate()); | |
2219 } | |
2220 | |
2221 static v8::Handle<v8::Value> activityLoggedInIsolatedWorldsAttrGetterAttrGetterC
allback(v8::Local<v8::String> name, const v8::AccessorInfo& info) | |
2222 { | |
2223 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); | |
2224 if (contextData && contextData->activityLogger()) | |
2225 contextData->activityLogger()->log("TestObject.activityLoggedInIsolatedW
orldsAttrGetter", 0, 0, "Getter"); | |
2226 return TestObjV8Internal::activityLoggedInIsolatedWorldsAttrGetterAttrGetter
(name, info); | |
2227 } | |
2228 | |
2229 static v8::Handle<v8::Value> activityLoggedInIsolatedWorldsAttrGetterAttrGetterF
orMainWorld(v8::Local<v8::String> name, const v8::AccessorInfo& info) | |
2230 { | |
2231 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
2232 return v8Integer(imp->activityLoggedInIsolatedWorldsAttrGetter(), info.GetIs
olate()); | |
2233 } | |
2234 | |
2235 static v8::Handle<v8::Value> activityLoggedInIsolatedWorldsAttrGetterAttrGetterC
allbackForMainWorld(v8::Local<v8::String> name, const v8::AccessorInfo& info) | |
2236 { | |
2237 return TestObjV8Internal::activityLoggedInIsolatedWorldsAttrGetterAttrGetter
ForMainWorld(name, info); | |
2238 } | |
2239 | |
2240 static void activityLoggedInIsolatedWorldsAttrGetterAttrSetter(v8::Local<v8::Str
ing> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
2241 { | |
2242 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
2243 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
2244 imp->setActivityLoggedInIsolatedWorldsAttrGetter(v); | |
2245 return; | |
2246 } | |
2247 | |
2248 static void activityLoggedInIsolatedWorldsAttrGetterAttrSetterCallback(v8::Local
<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
2249 { | |
2250 TestObjV8Internal::activityLoggedInIsolatedWorldsAttrGetterAttrSetter(name,
value, info); | |
2251 } | |
2252 | |
2253 static void activityLoggedInIsolatedWorldsAttrGetterAttrSetterForMainWorld(v8::L
ocal<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
2254 { | |
2255 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
2256 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
2257 imp->setActivityLoggedInIsolatedWorldsAttrGetter(v); | |
2258 return; | |
2259 } | |
2260 | |
2261 static void activityLoggedInIsolatedWorldsAttrGetterAttrSetterCallbackForMainWor
ld(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInf
o& info) | |
2262 { | |
2263 TestObjV8Internal::activityLoggedInIsolatedWorldsAttrGetterAttrSetterForMain
World(name, value, info); | |
2264 } | |
2265 | |
2266 static v8::Handle<v8::Value> deprecatedStaticReadOnlyAttrAttrGetter(v8::Local<v8
::String> name, const v8::AccessorInfo& info) | |
2267 { | |
2268 return v8Integer(TestObj::deprecatedStaticReadOnlyAttr(), info.GetIsolate())
; | |
2269 } | |
2270 | |
2271 static v8::Handle<v8::Value> deprecatedStaticReadOnlyAttrAttrGetterCallback(v8::
Local<v8::String> name, const v8::AccessorInfo& info) | |
2272 { | |
2273 UseCounter::countDeprecation(activeDOMWindow(), UseCounter::StaticReadonlyAt
tribute); | |
2274 return TestObjV8Internal::deprecatedStaticReadOnlyAttrAttrGetter(name, info)
; | |
2275 } | |
2276 | |
2277 static v8::Handle<v8::Value> deprecatedStaticAttrAttrGetter(v8::Local<v8::String
> name, const v8::AccessorInfo& info) | |
2278 { | |
2279 return v8Integer(TestObj::deprecatedStaticAttr(), info.GetIsolate()); | |
2280 } | |
2281 | |
2282 static v8::Handle<v8::Value> deprecatedStaticAttrAttrGetterCallback(v8::Local<v8
::String> name, const v8::AccessorInfo& info) | |
2283 { | |
2284 UseCounter::countDeprecation(activeDOMWindow(), UseCounter::StaticAttribute)
; | |
2285 return TestObjV8Internal::deprecatedStaticAttrAttrGetter(name, info); | |
2286 } | |
2287 | |
2288 static void deprecatedStaticAttrAttrSetter(v8::Local<v8::String> name, v8::Local
<v8::Value> value, const v8::AccessorInfo& info) | |
2289 { | |
2290 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
2291 TestObj::setDeprecatedStaticAttr(v); | |
2292 return; | |
2293 } | |
2294 | |
2295 static void deprecatedStaticAttrAttrSetterCallback(v8::Local<v8::String> name, v
8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
2296 { | |
2297 UseCounter::countDeprecation(activeDOMWindow(), UseCounter::StaticAttribute)
; | |
2298 TestObjV8Internal::deprecatedStaticAttrAttrSetter(name, value, info); | |
2299 } | |
2300 | |
2301 static v8::Handle<v8::Value> deprecatedReadonlyAttrAttrGetter(v8::Local<v8::Stri
ng> name, const v8::AccessorInfo& info) | |
2302 { | |
2303 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
2304 return v8Integer(imp->deprecatedReadonlyAttr(), info.GetIsolate()); | |
2305 } | |
2306 | |
2307 static v8::Handle<v8::Value> deprecatedReadonlyAttrAttrGetterCallback(v8::Local<
v8::String> name, const v8::AccessorInfo& info) | |
2308 { | |
2309 UseCounter::countDeprecation(activeDOMWindow(), UseCounter::ReadonlyAttribut
e); | |
2310 return TestObjV8Internal::deprecatedReadonlyAttrAttrGetter(name, info); | |
2311 } | |
2312 | |
2313 static v8::Handle<v8::Value> deprecatedAttrAttrGetter(v8::Local<v8::String> name
, const v8::AccessorInfo& info) | |
2314 { | |
2315 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
2316 return v8Integer(imp->deprecatedAttr(), info.GetIsolate()); | |
2317 } | |
2318 | |
2319 static v8::Handle<v8::Value> deprecatedAttrAttrGetterCallback(v8::Local<v8::Stri
ng> name, const v8::AccessorInfo& info) | |
2320 { | |
2321 UseCounter::countDeprecation(activeDOMWindow(), UseCounter::Attribute); | |
2322 return TestObjV8Internal::deprecatedAttrAttrGetter(name, info); | |
2323 } | |
2324 | |
2325 static void deprecatedAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::V
alue> value, const v8::AccessorInfo& info) | |
2326 { | |
2327 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
2328 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
2329 imp->setDeprecatedAttr(v); | |
2330 return; | |
2331 } | |
2332 | |
2333 static void deprecatedAttrAttrSetterCallback(v8::Local<v8::String> name, v8::Loc
al<v8::Value> value, const v8::AccessorInfo& info) | |
2334 { | |
2335 UseCounter::countDeprecation(activeDOMWindow(), UseCounter::Attribute); | |
2336 TestObjV8Internal::deprecatedAttrAttrSetter(name, value, info); | |
2337 } | |
2338 | |
2339 static v8::Handle<v8::Value> TestObjConstructorGetter(v8::Local<v8::String> name
, const v8::AccessorInfo& info) | |
2340 { | |
2341 v8::Handle<v8::Value> data = info.Data(); | |
2342 ASSERT(data->IsExternal()); | |
2343 V8PerContextData* perContextData = V8PerContextData::from(info.Holder()->Cre
ationContext()); | |
2344 if (!perContextData) | |
2345 return v8Undefined(); | |
2346 return perContextData->constructorForType(WrapperTypeInfo::unwrap(data)); | |
2347 } | |
2348 static void TestObjReplaceableAttrSetter(v8::Local<v8::String> name, v8::Local<v
8::Value> value, const v8::AccessorInfo& info) | |
2349 { | |
2350 info.This()->ForceSet(name, value); | |
2351 } | |
2352 | |
2353 static void TestObjReplaceableAttrSetterCallback(v8::Local<v8::String> name, v8:
:Local<v8::Value> value, const v8::AccessorInfo& info) | |
2354 { | |
2355 return TestObjV8Internal::TestObjReplaceableAttrSetter(name, value, info); | |
2356 } | |
2357 | |
2358 static v8::Handle<v8::Value> voidMethodMethod(const v8::Arguments& args) | |
2359 { | |
2360 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
2361 imp->voidMethod(); | |
2362 return v8Undefined(); | |
2363 } | |
2364 | |
2365 static v8::Handle<v8::Value> voidMethodMethodCallback(const v8::Arguments& args) | |
2366 { | |
2367 return TestObjV8Internal::voidMethodMethod(args); | |
2368 } | |
2369 | |
2370 static v8::Handle<v8::Value> voidMethodWithArgsMethod(const v8::Arguments& args) | |
2371 { | |
2372 if (args.Length() < 3) | |
2373 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
2374 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
2375 V8TRYCATCH(int, longArg, toInt32(args[0])); | |
2376 V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, strArg, args[1]); | |
2377 V8TRYCATCH(TestObj*, objArg, V8TestObj::HasInstance(args[2], args.GetIsolate
(), worldType(args.GetIsolate())) ? V8TestObj::toNative(v8::Handle<v8::Object>::
Cast(args[2])) : 0); | |
2378 imp->voidMethodWithArgs(longArg, strArg, objArg); | |
2379 return v8Undefined(); | |
2380 } | |
2381 | |
2382 static v8::Handle<v8::Value> voidMethodWithArgsMethodCallback(const v8::Argument
s& args) | |
2383 { | |
2384 return TestObjV8Internal::voidMethodWithArgsMethod(args); | |
2385 } | |
2386 | |
2387 static v8::Handle<v8::Value> longMethodMethod(const v8::Arguments& args) | |
2388 { | |
2389 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
2390 return v8Integer(imp->longMethod(), args.GetIsolate()); | |
2391 } | |
2392 | |
2393 static v8::Handle<v8::Value> longMethodMethodCallback(const v8::Arguments& args) | |
2394 { | |
2395 return TestObjV8Internal::longMethodMethod(args); | |
2396 } | |
2397 | |
2398 static v8::Handle<v8::Value> longMethodWithArgsMethod(const v8::Arguments& args) | |
2399 { | |
2400 if (args.Length() < 3) | |
2401 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
2402 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
2403 V8TRYCATCH(int, longArg, toInt32(args[0])); | |
2404 V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, strArg, args[1]); | |
2405 V8TRYCATCH(TestObj*, objArg, V8TestObj::HasInstance(args[2], args.GetIsolate
(), worldType(args.GetIsolate())) ? V8TestObj::toNative(v8::Handle<v8::Object>::
Cast(args[2])) : 0); | |
2406 return v8Integer(imp->longMethodWithArgs(longArg, strArg, objArg), args.GetI
solate()); | |
2407 } | |
2408 | |
2409 static v8::Handle<v8::Value> longMethodWithArgsMethodCallback(const v8::Argument
s& args) | |
2410 { | |
2411 return TestObjV8Internal::longMethodWithArgsMethod(args); | |
2412 } | |
2413 | |
2414 static v8::Handle<v8::Value> objMethodMethod(const v8::Arguments& args) | |
2415 { | |
2416 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
2417 return toV8(imp->objMethod(), args.Holder(), args.GetIsolate()); | |
2418 } | |
2419 | |
2420 static v8::Handle<v8::Value> objMethodMethodCallback(const v8::Arguments& args) | |
2421 { | |
2422 UseCounter::count(activeDOMWindow(), UseCounter::TestFeature); | |
2423 return TestObjV8Internal::objMethodMethod(args); | |
2424 } | |
2425 | |
2426 static v8::Handle<v8::Value> objMethodWithArgsMethod(const v8::Arguments& args) | |
2427 { | |
2428 if (args.Length() < 3) | |
2429 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
2430 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
2431 V8TRYCATCH(int, longArg, toInt32(args[0])); | |
2432 V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, strArg, args[1]); | |
2433 V8TRYCATCH(TestObj*, objArg, V8TestObj::HasInstance(args[2], args.GetIsolate
(), worldType(args.GetIsolate())) ? V8TestObj::toNative(v8::Handle<v8::Object>::
Cast(args[2])) : 0); | |
2434 return toV8(imp->objMethodWithArgs(longArg, strArg, objArg), args.Holder(),
args.GetIsolate()); | |
2435 } | |
2436 | |
2437 static v8::Handle<v8::Value> objMethodWithArgsMethodCallback(const v8::Arguments
& args) | |
2438 { | |
2439 return TestObjV8Internal::objMethodWithArgsMethod(args); | |
2440 } | |
2441 | |
2442 static v8::Handle<v8::Value> methodWithSequenceArgMethod(const v8::Arguments& ar
gs) | |
2443 { | |
2444 if (args.Length() < 1) | |
2445 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
2446 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
2447 V8TRYCATCH(Vector<RefPtr<ScriptProfile> >, sequenceArg, (toRefPtrNativeArray
<ScriptProfile, V8ScriptProfile>(args[0], args.GetIsolate()))); | |
2448 imp->methodWithSequenceArg(sequenceArg); | |
2449 return v8Undefined(); | |
2450 } | |
2451 | |
2452 static v8::Handle<v8::Value> methodWithSequenceArgMethodCallback(const v8::Argum
ents& args) | |
2453 { | |
2454 return TestObjV8Internal::methodWithSequenceArgMethod(args); | |
2455 } | |
2456 | |
2457 static v8::Handle<v8::Value> methodReturningSequenceMethod(const v8::Arguments&
args) | |
2458 { | |
2459 if (args.Length() < 1) | |
2460 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
2461 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
2462 V8TRYCATCH(int, longArg, toInt32(args[0])); | |
2463 return v8Array(imp->methodReturningSequence(longArg), args.GetIsolate()); | |
2464 } | |
2465 | |
2466 static v8::Handle<v8::Value> methodReturningSequenceMethodCallback(const v8::Arg
uments& args) | |
2467 { | |
2468 return TestObjV8Internal::methodReturningSequenceMethod(args); | |
2469 } | |
2470 | |
2471 static v8::Handle<v8::Value> methodWithEnumArgMethod(const v8::Arguments& args) | |
2472 { | |
2473 if (args.Length() < 1) | |
2474 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
2475 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
2476 V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, enumArg, args[0]); | |
2477 String string = enumArg; | |
2478 if (!(string == "" || string == "EnumValue1" || string == "EnumValue2" || st
ring == "EnumValue3")) | |
2479 return throwTypeError(0, args.GetIsolate()); | |
2480 imp->methodWithEnumArg(enumArg); | |
2481 return v8Undefined(); | |
2482 } | |
2483 | |
2484 static v8::Handle<v8::Value> methodWithEnumArgMethodCallback(const v8::Arguments
& args) | |
2485 { | |
2486 return TestObjV8Internal::methodWithEnumArgMethod(args); | |
2487 } | |
2488 | |
2489 static v8::Handle<v8::Value> methodThatRequiresAllArgsAndThrowsMethod(const v8::
Arguments& args) | |
2490 { | |
2491 if (args.Length() < 2) | |
2492 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
2493 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
2494 ExceptionCode ec = 0; | |
2495 { | |
2496 V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, strArg, args[0]); | |
2497 V8TRYCATCH(TestObj*, objArg, V8TestObj::HasInstance(args[1], args.GetIsolate
(), worldType(args.GetIsolate())) ? V8TestObj::toNative(v8::Handle<v8::Object>::
Cast(args[1])) : 0); | |
2498 RefPtr<TestObj> result = imp->methodThatRequiresAllArgsAndThrows(strArg, obj
Arg, ec); | |
2499 if (UNLIKELY(ec)) | |
2500 goto fail; | |
2501 return toV8(result.release(), args.Holder(), args.GetIsolate()); | |
2502 } | |
2503 fail: | |
2504 return setDOMException(ec, args.GetIsolate()); | |
2505 } | |
2506 | |
2507 static v8::Handle<v8::Value> methodThatRequiresAllArgsAndThrowsMethodCallback(co
nst v8::Arguments& args) | |
2508 { | |
2509 return TestObjV8Internal::methodThatRequiresAllArgsAndThrowsMethod(args); | |
2510 } | |
2511 | |
2512 static v8::Handle<v8::Value> serializedValueMethod(const v8::Arguments& args) | |
2513 { | |
2514 if (args.Length() < 1) | |
2515 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
2516 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
2517 bool serializedArgDidThrow = false; | |
2518 RefPtr<SerializedScriptValue> serializedArg = SerializedScriptValue::create(
args[0], 0, 0, serializedArgDidThrow, args.GetIsolate()); | |
2519 if (serializedArgDidThrow) | |
2520 return v8Undefined(); | |
2521 imp->serializedValue(serializedArg); | |
2522 return v8Undefined(); | |
2523 } | |
2524 | |
2525 static v8::Handle<v8::Value> serializedValueMethodCallback(const v8::Arguments&
args) | |
2526 { | |
2527 return TestObjV8Internal::serializedValueMethod(args); | |
2528 } | |
2529 | |
2530 static v8::Handle<v8::Value> optionsObjectMethod(const v8::Arguments& args) | |
2531 { | |
2532 if (args.Length() < 1) | |
2533 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
2534 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
2535 V8TRYCATCH(Dictionary, oo, Dictionary(args[0], args.GetIsolate())); | |
2536 if (!oo.isUndefinedOrNull() && !oo.isObject()) | |
2537 return throwTypeError("Not an object.", args.GetIsolate()); | |
2538 V8TRYCATCH(Dictionary, ooo, Dictionary(args[1], args.GetIsolate())); | |
2539 if (!ooo.isUndefinedOrNull() && !ooo.isObject()) | |
2540 return throwTypeError("Not an object.", args.GetIsolate()); | |
2541 imp->optionsObject(oo, ooo); | |
2542 return v8Undefined(); | |
2543 } | |
2544 | |
2545 static v8::Handle<v8::Value> optionsObjectMethodCallback(const v8::Arguments& ar
gs) | |
2546 { | |
2547 return TestObjV8Internal::optionsObjectMethod(args); | |
2548 } | |
2549 | |
2550 static v8::Handle<v8::Value> methodWithExceptionMethod(const v8::Arguments& args
) | |
2551 { | |
2552 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
2553 ExceptionCode ec = 0; | |
2554 { | |
2555 imp->methodWithException(ec); | |
2556 if (UNLIKELY(ec)) | |
2557 goto fail; | |
2558 return v8Undefined(); | |
2559 } | |
2560 fail: | |
2561 return setDOMException(ec, args.GetIsolate()); | |
2562 } | |
2563 | |
2564 static v8::Handle<v8::Value> methodWithExceptionMethodCallback(const v8::Argumen
ts& args) | |
2565 { | |
2566 return TestObjV8Internal::methodWithExceptionMethod(args); | |
2567 } | |
2568 | |
2569 static v8::Handle<v8::Value> customMethodMethodCallback(const v8::Arguments& arg
s) | |
2570 { | |
2571 UseCounter::count(activeDOMWindow(), UseCounter::CustomTestFeature); | |
2572 return V8TestObj::customMethodMethodCustom(args); | |
2573 } | |
2574 | |
2575 static v8::Handle<v8::Value> customMethodWithArgsMethodCallback(const v8::Argume
nts& args) | |
2576 { | |
2577 return V8TestObj::customMethodWithArgsMethodCustom(args); | |
2578 } | |
2579 | |
2580 static v8::Handle<v8::Value> addEventListenerMethod(const v8::Arguments& args) | |
2581 { | |
2582 RefPtr<EventListener> listener = V8EventListenerList::getEventListener(args[
1], false, ListenerFindOrCreate); | |
2583 if (listener) { | |
2584 V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<WithNullCheck>, stringR
esource, args[0]); | |
2585 V8TestObj::toNative(args.Holder())->addEventListener(stringResource, lis
tener, args[2]->BooleanValue()); | |
2586 createHiddenDependency(args.Holder(), args[1], V8TestObj::eventListenerC
acheIndex, args.GetIsolate()); | |
2587 } | |
2588 return v8Undefined(); | |
2589 } | |
2590 | |
2591 static v8::Handle<v8::Value> addEventListenerMethodCallback(const v8::Arguments&
args) | |
2592 { | |
2593 return TestObjV8Internal::addEventListenerMethod(args); | |
2594 } | |
2595 | |
2596 static v8::Handle<v8::Value> removeEventListenerMethod(const v8::Arguments& args
) | |
2597 { | |
2598 RefPtr<EventListener> listener = V8EventListenerList::getEventListener(args[
1], false, ListenerFindOnly); | |
2599 if (listener) { | |
2600 V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<WithNullCheck>, stringR
esource, args[0]); | |
2601 V8TestObj::toNative(args.Holder())->removeEventListener(stringResource,
listener.get(), args[2]->BooleanValue()); | |
2602 removeHiddenDependency(args.Holder(), args[1], V8TestObj::eventListenerC
acheIndex, args.GetIsolate()); | |
2603 } | |
2604 return v8Undefined(); | |
2605 } | |
2606 | |
2607 static v8::Handle<v8::Value> removeEventListenerMethodCallback(const v8::Argumen
ts& args) | |
2608 { | |
2609 return TestObjV8Internal::removeEventListenerMethod(args); | |
2610 } | |
2611 | |
2612 static v8::Handle<v8::Value> withScriptStateVoidMethod(const v8::Arguments& args
) | |
2613 { | |
2614 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
2615 ScriptState* currentState = ScriptState::current(); | |
2616 if (!currentState) | |
2617 return v8Undefined(); | |
2618 ScriptState& state = *currentState; | |
2619 imp->withScriptStateVoid(&state); | |
2620 if (state.hadException()) { | |
2621 v8::Local<v8::Value> exception = state.exception(); | |
2622 state.clearException(); | |
2623 return throwError(exception, args.GetIsolate()); | |
2624 } | |
2625 return v8Undefined(); | |
2626 } | |
2627 | |
2628 static v8::Handle<v8::Value> withScriptStateVoidMethodCallback(const v8::Argumen
ts& args) | |
2629 { | |
2630 return TestObjV8Internal::withScriptStateVoidMethod(args); | |
2631 } | |
2632 | |
2633 static v8::Handle<v8::Value> withScriptStateObjMethod(const v8::Arguments& args) | |
2634 { | |
2635 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
2636 ScriptState* currentState = ScriptState::current(); | |
2637 if (!currentState) | |
2638 return v8Undefined(); | |
2639 ScriptState& state = *currentState; | |
2640 RefPtr<TestObj> result = imp->withScriptStateObj(&state); | |
2641 if (state.hadException()) { | |
2642 v8::Local<v8::Value> exception = state.exception(); | |
2643 state.clearException(); | |
2644 return throwError(exception, args.GetIsolate()); | |
2645 } | |
2646 return toV8(result.release(), args.Holder(), args.GetIsolate()); | |
2647 } | |
2648 | |
2649 static v8::Handle<v8::Value> withScriptStateObjMethodCallback(const v8::Argument
s& args) | |
2650 { | |
2651 return TestObjV8Internal::withScriptStateObjMethod(args); | |
2652 } | |
2653 | |
2654 static v8::Handle<v8::Value> withScriptStateVoidExceptionMethod(const v8::Argume
nts& args) | |
2655 { | |
2656 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
2657 ExceptionCode ec = 0; | |
2658 { | |
2659 ScriptState* currentState = ScriptState::current(); | |
2660 if (!currentState) | |
2661 return v8Undefined(); | |
2662 ScriptState& state = *currentState; | |
2663 imp->withScriptStateVoidException(&state, ec); | |
2664 if (UNLIKELY(ec)) | |
2665 goto fail; | |
2666 if (state.hadException()) { | |
2667 v8::Local<v8::Value> exception = state.exception(); | |
2668 state.clearException(); | |
2669 return throwError(exception, args.GetIsolate()); | |
2670 } | |
2671 return v8Undefined(); | |
2672 } | |
2673 fail: | |
2674 return setDOMException(ec, args.GetIsolate()); | |
2675 } | |
2676 | |
2677 static v8::Handle<v8::Value> withScriptStateVoidExceptionMethodCallback(const v8
::Arguments& args) | |
2678 { | |
2679 return TestObjV8Internal::withScriptStateVoidExceptionMethod(args); | |
2680 } | |
2681 | |
2682 static v8::Handle<v8::Value> withScriptStateObjExceptionMethod(const v8::Argumen
ts& args) | |
2683 { | |
2684 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
2685 ExceptionCode ec = 0; | |
2686 { | |
2687 ScriptState* currentState = ScriptState::current(); | |
2688 if (!currentState) | |
2689 return v8Undefined(); | |
2690 ScriptState& state = *currentState; | |
2691 RefPtr<TestObj> result = imp->withScriptStateObjException(&state, ec); | |
2692 if (UNLIKELY(ec)) | |
2693 goto fail; | |
2694 if (state.hadException()) { | |
2695 v8::Local<v8::Value> exception = state.exception(); | |
2696 state.clearException(); | |
2697 return throwError(exception, args.GetIsolate()); | |
2698 } | |
2699 return toV8(result.release(), args.Holder(), args.GetIsolate()); | |
2700 } | |
2701 fail: | |
2702 return setDOMException(ec, args.GetIsolate()); | |
2703 } | |
2704 | |
2705 static v8::Handle<v8::Value> withScriptStateObjExceptionMethodCallback(const v8:
:Arguments& args) | |
2706 { | |
2707 return TestObjV8Internal::withScriptStateObjExceptionMethod(args); | |
2708 } | |
2709 | |
2710 static v8::Handle<v8::Value> withScriptExecutionContextMethod(const v8::Argument
s& args) | |
2711 { | |
2712 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
2713 ScriptExecutionContext* scriptContext = getScriptExecutionContext(); | |
2714 imp->withScriptExecutionContext(scriptContext); | |
2715 return v8Undefined(); | |
2716 } | |
2717 | |
2718 static v8::Handle<v8::Value> withScriptExecutionContextMethodCallback(const v8::
Arguments& args) | |
2719 { | |
2720 return TestObjV8Internal::withScriptExecutionContextMethod(args); | |
2721 } | |
2722 | |
2723 static v8::Handle<v8::Value> withScriptExecutionContextAndScriptStateMethod(cons
t v8::Arguments& args) | |
2724 { | |
2725 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
2726 ScriptState* currentState = ScriptState::current(); | |
2727 if (!currentState) | |
2728 return v8Undefined(); | |
2729 ScriptState& state = *currentState; | |
2730 ScriptExecutionContext* scriptContext = getScriptExecutionContext(); | |
2731 imp->withScriptExecutionContextAndScriptState(&state, scriptContext); | |
2732 if (state.hadException()) { | |
2733 v8::Local<v8::Value> exception = state.exception(); | |
2734 state.clearException(); | |
2735 return throwError(exception, args.GetIsolate()); | |
2736 } | |
2737 return v8Undefined(); | |
2738 } | |
2739 | |
2740 static v8::Handle<v8::Value> withScriptExecutionContextAndScriptStateMethodCallb
ack(const v8::Arguments& args) | |
2741 { | |
2742 return TestObjV8Internal::withScriptExecutionContextAndScriptStateMethod(arg
s); | |
2743 } | |
2744 | |
2745 static v8::Handle<v8::Value> withScriptExecutionContextAndScriptStateObjExceptio
nMethod(const v8::Arguments& args) | |
2746 { | |
2747 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
2748 ExceptionCode ec = 0; | |
2749 { | |
2750 ScriptState* currentState = ScriptState::current(); | |
2751 if (!currentState) | |
2752 return v8Undefined(); | |
2753 ScriptState& state = *currentState; | |
2754 ScriptExecutionContext* scriptContext = getScriptExecutionContext(); | |
2755 RefPtr<TestObj> result = imp->withScriptExecutionContextAndScriptStateObjExc
eption(&state, scriptContext, ec); | |
2756 if (UNLIKELY(ec)) | |
2757 goto fail; | |
2758 if (state.hadException()) { | |
2759 v8::Local<v8::Value> exception = state.exception(); | |
2760 state.clearException(); | |
2761 return throwError(exception, args.GetIsolate()); | |
2762 } | |
2763 return toV8(result.release(), args.Holder(), args.GetIsolate()); | |
2764 } | |
2765 fail: | |
2766 return setDOMException(ec, args.GetIsolate()); | |
2767 } | |
2768 | |
2769 static v8::Handle<v8::Value> withScriptExecutionContextAndScriptStateObjExceptio
nMethodCallback(const v8::Arguments& args) | |
2770 { | |
2771 return TestObjV8Internal::withScriptExecutionContextAndScriptStateObjExcepti
onMethod(args); | |
2772 } | |
2773 | |
2774 static v8::Handle<v8::Value> withScriptExecutionContextAndScriptStateWithSpacesM
ethod(const v8::Arguments& args) | |
2775 { | |
2776 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
2777 ScriptState* currentState = ScriptState::current(); | |
2778 if (!currentState) | |
2779 return v8Undefined(); | |
2780 ScriptState& state = *currentState; | |
2781 ScriptExecutionContext* scriptContext = getScriptExecutionContext(); | |
2782 RefPtr<TestObj> result = imp->withScriptExecutionContextAndScriptStateWithSp
aces(&state, scriptContext); | |
2783 if (state.hadException()) { | |
2784 v8::Local<v8::Value> exception = state.exception(); | |
2785 state.clearException(); | |
2786 return throwError(exception, args.GetIsolate()); | |
2787 } | |
2788 return toV8(result.release(), args.Holder(), args.GetIsolate()); | |
2789 } | |
2790 | |
2791 static v8::Handle<v8::Value> withScriptExecutionContextAndScriptStateWithSpacesM
ethodCallback(const v8::Arguments& args) | |
2792 { | |
2793 return TestObjV8Internal::withScriptExecutionContextAndScriptStateWithSpaces
Method(args); | |
2794 } | |
2795 | |
2796 static v8::Handle<v8::Value> methodWithOptionalArgMethod(const v8::Arguments& ar
gs) | |
2797 { | |
2798 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
2799 if (args.Length() <= 0) { | |
2800 imp->methodWithOptionalArg(); | |
2801 return v8Undefined(); | |
2802 } | |
2803 V8TRYCATCH(int, opt, toInt32(args[0])); | |
2804 imp->methodWithOptionalArg(opt); | |
2805 return v8Undefined(); | |
2806 } | |
2807 | |
2808 static v8::Handle<v8::Value> methodWithOptionalArgMethodCallback(const v8::Argum
ents& args) | |
2809 { | |
2810 return TestObjV8Internal::methodWithOptionalArgMethod(args); | |
2811 } | |
2812 | |
2813 static v8::Handle<v8::Value> methodWithNonOptionalArgAndOptionalArgMethod(const
v8::Arguments& args) | |
2814 { | |
2815 if (args.Length() < 1) | |
2816 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
2817 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
2818 V8TRYCATCH(int, nonOpt, toInt32(args[0])); | |
2819 if (args.Length() <= 1) { | |
2820 imp->methodWithNonOptionalArgAndOptionalArg(nonOpt); | |
2821 return v8Undefined(); | |
2822 } | |
2823 V8TRYCATCH(int, opt, toInt32(args[1])); | |
2824 imp->methodWithNonOptionalArgAndOptionalArg(nonOpt, opt); | |
2825 return v8Undefined(); | |
2826 } | |
2827 | |
2828 static v8::Handle<v8::Value> methodWithNonOptionalArgAndOptionalArgMethodCallbac
k(const v8::Arguments& args) | |
2829 { | |
2830 return TestObjV8Internal::methodWithNonOptionalArgAndOptionalArgMethod(args)
; | |
2831 } | |
2832 | |
2833 static v8::Handle<v8::Value> methodWithNonOptionalArgAndTwoOptionalArgsMethod(co
nst v8::Arguments& args) | |
2834 { | |
2835 if (args.Length() < 1) | |
2836 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
2837 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
2838 V8TRYCATCH(int, nonOpt, toInt32(args[0])); | |
2839 if (args.Length() <= 1) { | |
2840 imp->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt); | |
2841 return v8Undefined(); | |
2842 } | |
2843 V8TRYCATCH(int, opt1, toInt32(args[1])); | |
2844 if (args.Length() <= 2) { | |
2845 imp->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt, opt1); | |
2846 return v8Undefined(); | |
2847 } | |
2848 V8TRYCATCH(int, opt2, toInt32(args[2])); | |
2849 imp->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt, opt1, opt2); | |
2850 return v8Undefined(); | |
2851 } | |
2852 | |
2853 static v8::Handle<v8::Value> methodWithNonOptionalArgAndTwoOptionalArgsMethodCal
lback(const v8::Arguments& args) | |
2854 { | |
2855 return TestObjV8Internal::methodWithNonOptionalArgAndTwoOptionalArgsMethod(a
rgs); | |
2856 } | |
2857 | |
2858 static v8::Handle<v8::Value> methodWithOptionalStringMethod(const v8::Arguments&
args) | |
2859 { | |
2860 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
2861 if (args.Length() <= 0) { | |
2862 imp->methodWithOptionalString(); | |
2863 return v8Undefined(); | |
2864 } | |
2865 V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, str, args[0]); | |
2866 imp->methodWithOptionalString(str); | |
2867 return v8Undefined(); | |
2868 } | |
2869 | |
2870 static v8::Handle<v8::Value> methodWithOptionalStringMethodCallback(const v8::Ar
guments& args) | |
2871 { | |
2872 return TestObjV8Internal::methodWithOptionalStringMethod(args); | |
2873 } | |
2874 | |
2875 static v8::Handle<v8::Value> methodWithOptionalStringIsUndefinedMethod(const v8:
:Arguments& args) | |
2876 { | |
2877 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
2878 V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, str, args[0]); | |
2879 imp->methodWithOptionalStringIsUndefined(str); | |
2880 return v8Undefined(); | |
2881 } | |
2882 | |
2883 static v8::Handle<v8::Value> methodWithOptionalStringIsUndefinedMethodCallback(c
onst v8::Arguments& args) | |
2884 { | |
2885 return TestObjV8Internal::methodWithOptionalStringIsUndefinedMethod(args); | |
2886 } | |
2887 | |
2888 static v8::Handle<v8::Value> methodWithOptionalStringIsNullStringMethod(const v8
::Arguments& args) | |
2889 { | |
2890 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
2891 V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, str, argumentOrNull(args
, 0)); | |
2892 imp->methodWithOptionalStringIsNullString(str); | |
2893 return v8Undefined(); | |
2894 } | |
2895 | |
2896 static v8::Handle<v8::Value> methodWithOptionalStringIsNullStringMethodCallback(
const v8::Arguments& args) | |
2897 { | |
2898 return TestObjV8Internal::methodWithOptionalStringIsNullStringMethod(args); | |
2899 } | |
2900 | |
2901 static v8::Handle<v8::Value> methodWithCallbackArgMethod(const v8::Arguments& ar
gs) | |
2902 { | |
2903 if (args.Length() < 1) | |
2904 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
2905 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
2906 if (args.Length() <= 0 || !args[0]->IsFunction()) | |
2907 return throwTypeError(0, args.GetIsolate()); | |
2908 RefPtr<TestCallback> callback = V8TestCallback::create(args[0], getScriptExe
cutionContext()); | |
2909 imp->methodWithCallbackArg(callback); | |
2910 return v8Undefined(); | |
2911 } | |
2912 | |
2913 static v8::Handle<v8::Value> methodWithCallbackArgMethodCallback(const v8::Argum
ents& args) | |
2914 { | |
2915 return TestObjV8Internal::methodWithCallbackArgMethod(args); | |
2916 } | |
2917 | |
2918 static v8::Handle<v8::Value> methodWithNonCallbackArgAndCallbackArgMethod(const
v8::Arguments& args) | |
2919 { | |
2920 if (args.Length() < 2) | |
2921 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
2922 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
2923 V8TRYCATCH(int, nonCallback, toInt32(args[0])); | |
2924 if (args.Length() <= 1 || !args[1]->IsFunction()) | |
2925 return throwTypeError(0, args.GetIsolate()); | |
2926 RefPtr<TestCallback> callback = V8TestCallback::create(args[1], getScriptExe
cutionContext()); | |
2927 imp->methodWithNonCallbackArgAndCallbackArg(nonCallback, callback); | |
2928 return v8Undefined(); | |
2929 } | |
2930 | |
2931 static v8::Handle<v8::Value> methodWithNonCallbackArgAndCallbackArgMethodCallbac
k(const v8::Arguments& args) | |
2932 { | |
2933 return TestObjV8Internal::methodWithNonCallbackArgAndCallbackArgMethod(args)
; | |
2934 } | |
2935 | |
2936 static v8::Handle<v8::Value> methodWithCallbackAndOptionalArgMethod(const v8::Ar
guments& args) | |
2937 { | |
2938 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
2939 RefPtr<TestCallback> callback; | |
2940 if (args.Length() > 0 && !args[0]->IsNull() && !args[0]->IsUndefined()) { | |
2941 if (!args[0]->IsFunction()) | |
2942 return throwTypeError(0, args.GetIsolate()); | |
2943 callback = V8TestCallback::create(args[0], getScriptExecutionContext()); | |
2944 } | |
2945 imp->methodWithCallbackAndOptionalArg(callback); | |
2946 return v8Undefined(); | |
2947 } | |
2948 | |
2949 static v8::Handle<v8::Value> methodWithCallbackAndOptionalArgMethodCallback(cons
t v8::Arguments& args) | |
2950 { | |
2951 return TestObjV8Internal::methodWithCallbackAndOptionalArgMethod(args); | |
2952 } | |
2953 | |
2954 static v8::Handle<v8::Value> staticMethodWithCallbackAndOptionalArgMethod(const
v8::Arguments& args) | |
2955 { | |
2956 RefPtr<TestCallback> callback; | |
2957 if (args.Length() > 0 && !args[0]->IsNull() && !args[0]->IsUndefined()) { | |
2958 if (!args[0]->IsFunction()) | |
2959 return throwTypeError(0, args.GetIsolate()); | |
2960 callback = V8TestCallback::create(args[0], getScriptExecutionContext()); | |
2961 } | |
2962 TestObj::staticMethodWithCallbackAndOptionalArg(callback); | |
2963 return v8Undefined(); | |
2964 } | |
2965 | |
2966 static v8::Handle<v8::Value> staticMethodWithCallbackAndOptionalArgMethodCallbac
k(const v8::Arguments& args) | |
2967 { | |
2968 return TestObjV8Internal::staticMethodWithCallbackAndOptionalArgMethod(args)
; | |
2969 } | |
2970 | |
2971 static v8::Handle<v8::Value> staticMethodWithCallbackArgMethod(const v8::Argumen
ts& args) | |
2972 { | |
2973 if (args.Length() < 1) | |
2974 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
2975 if (args.Length() <= 0 || !args[0]->IsFunction()) | |
2976 return throwTypeError(0, args.GetIsolate()); | |
2977 RefPtr<TestCallback> callback = V8TestCallback::create(args[0], getScriptExe
cutionContext()); | |
2978 TestObj::staticMethodWithCallbackArg(callback); | |
2979 return v8Undefined(); | |
2980 } | |
2981 | |
2982 static v8::Handle<v8::Value> staticMethodWithCallbackArgMethodCallback(const v8:
:Arguments& args) | |
2983 { | |
2984 return TestObjV8Internal::staticMethodWithCallbackArgMethod(args); | |
2985 } | |
2986 | |
2987 static v8::Handle<v8::Value> methodWithEnforceRangeInt32Method(const v8::Argumen
ts& args) | |
2988 { | |
2989 if (args.Length() < 1) | |
2990 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
2991 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
2992 V8TRYCATCH_WITH_TYPECHECK(int, value, toInt32(args[0], EnforceRange, ok), ar
gs.GetIsolate()); | |
2993 imp->methodWithEnforceRangeInt32(value); | |
2994 return v8Undefined(); | |
2995 } | |
2996 | |
2997 static v8::Handle<v8::Value> methodWithEnforceRangeInt32MethodCallback(const v8:
:Arguments& args) | |
2998 { | |
2999 return TestObjV8Internal::methodWithEnforceRangeInt32Method(args); | |
3000 } | |
3001 | |
3002 static v8::Handle<v8::Value> methodWithEnforceRangeUInt32Method(const v8::Argume
nts& args) | |
3003 { | |
3004 if (args.Length() < 1) | |
3005 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
3006 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
3007 V8TRYCATCH_WITH_TYPECHECK(unsigned, value, toUInt32(args[0], EnforceRange, o
k), args.GetIsolate()); | |
3008 imp->methodWithEnforceRangeUInt32(value); | |
3009 return v8Undefined(); | |
3010 } | |
3011 | |
3012 static v8::Handle<v8::Value> methodWithEnforceRangeUInt32MethodCallback(const v8
::Arguments& args) | |
3013 { | |
3014 return TestObjV8Internal::methodWithEnforceRangeUInt32Method(args); | |
3015 } | |
3016 | |
3017 static v8::Handle<v8::Value> methodWithEnforceRangeInt64Method(const v8::Argumen
ts& args) | |
3018 { | |
3019 if (args.Length() < 1) | |
3020 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
3021 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
3022 V8TRYCATCH_WITH_TYPECHECK(long long, value, toInt64(args[0], EnforceRange, o
k), args.GetIsolate()); | |
3023 imp->methodWithEnforceRangeInt64(value); | |
3024 return v8Undefined(); | |
3025 } | |
3026 | |
3027 static v8::Handle<v8::Value> methodWithEnforceRangeInt64MethodCallback(const v8:
:Arguments& args) | |
3028 { | |
3029 return TestObjV8Internal::methodWithEnforceRangeInt64Method(args); | |
3030 } | |
3031 | |
3032 static v8::Handle<v8::Value> methodWithEnforceRangeUInt64Method(const v8::Argume
nts& args) | |
3033 { | |
3034 if (args.Length() < 1) | |
3035 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
3036 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
3037 V8TRYCATCH_WITH_TYPECHECK(unsigned long long, value, toUInt64(args[0], Enfor
ceRange, ok), args.GetIsolate()); | |
3038 imp->methodWithEnforceRangeUInt64(value); | |
3039 return v8Undefined(); | |
3040 } | |
3041 | |
3042 static v8::Handle<v8::Value> methodWithEnforceRangeUInt64MethodCallback(const v8
::Arguments& args) | |
3043 { | |
3044 return TestObjV8Internal::methodWithEnforceRangeUInt64Method(args); | |
3045 } | |
3046 | |
3047 #if ENABLE(Condition1) | |
3048 | |
3049 static v8::Handle<v8::Value> conditionalMethod1Method(const v8::Arguments& args) | |
3050 { | |
3051 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
3052 return v8String(imp->conditionalMethod1(), args.GetIsolate(), ReturnUnsafeHa
ndle); | |
3053 } | |
3054 | |
3055 #endif // ENABLE(Condition1) | |
3056 | |
3057 #if ENABLE(Condition1) | |
3058 | |
3059 static v8::Handle<v8::Value> conditionalMethod1MethodCallback(const v8::Argument
s& args) | |
3060 { | |
3061 return TestObjV8Internal::conditionalMethod1Method(args); | |
3062 } | |
3063 | |
3064 #endif // ENABLE(Condition1) | |
3065 | |
3066 #if ENABLE(Condition1) && ENABLE(Condition2) | |
3067 | |
3068 static v8::Handle<v8::Value> conditionalMethod2Method(const v8::Arguments& args) | |
3069 { | |
3070 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
3071 imp->conditionalMethod2(); | |
3072 return v8Undefined(); | |
3073 } | |
3074 | |
3075 #endif // ENABLE(Condition1) && ENABLE(Condition2) | |
3076 | |
3077 #if ENABLE(Condition1) && ENABLE(Condition2) | |
3078 | |
3079 static v8::Handle<v8::Value> conditionalMethod2MethodCallback(const v8::Argument
s& args) | |
3080 { | |
3081 return TestObjV8Internal::conditionalMethod2Method(args); | |
3082 } | |
3083 | |
3084 #endif // ENABLE(Condition1) && ENABLE(Condition2) | |
3085 | |
3086 #if ENABLE(Condition1) || ENABLE(Condition2) | |
3087 | |
3088 static v8::Handle<v8::Value> conditionalMethod3Method(const v8::Arguments& args) | |
3089 { | |
3090 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
3091 imp->conditionalMethod3(); | |
3092 return v8Undefined(); | |
3093 } | |
3094 | |
3095 #endif // ENABLE(Condition1) || ENABLE(Condition2) | |
3096 | |
3097 #if ENABLE(Condition1) || ENABLE(Condition2) | |
3098 | |
3099 static v8::Handle<v8::Value> conditionalMethod3MethodCallback(const v8::Argument
s& args) | |
3100 { | |
3101 return TestObjV8Internal::conditionalMethod3Method(args); | |
3102 } | |
3103 | |
3104 #endif // ENABLE(Condition1) || ENABLE(Condition2) | |
3105 | |
3106 static v8::Handle<v8::Value> overloadedMethod1Method(const v8::Arguments& args) | |
3107 { | |
3108 if (args.Length() < 2) | |
3109 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
3110 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
3111 V8TRYCATCH(TestObj*, objArg, V8TestObj::HasInstance(args[0], args.GetIsolate
(), worldType(args.GetIsolate())) ? V8TestObj::toNative(v8::Handle<v8::Object>::
Cast(args[0])) : 0); | |
3112 V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, strArg, args[1]); | |
3113 imp->overloadedMethod(objArg, strArg); | |
3114 return v8Undefined(); | |
3115 } | |
3116 | |
3117 static v8::Handle<v8::Value> overloadedMethod2Method(const v8::Arguments& args) | |
3118 { | |
3119 if (args.Length() < 1) | |
3120 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
3121 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
3122 V8TRYCATCH(TestObj*, objArg, V8TestObj::HasInstance(args[0], args.GetIsolate
(), worldType(args.GetIsolate())) ? V8TestObj::toNative(v8::Handle<v8::Object>::
Cast(args[0])) : 0); | |
3123 if (args.Length() <= 1) { | |
3124 imp->overloadedMethod(objArg); | |
3125 return v8Undefined(); | |
3126 } | |
3127 V8TRYCATCH(int, longArg, toInt32(args[1])); | |
3128 imp->overloadedMethod(objArg, longArg); | |
3129 return v8Undefined(); | |
3130 } | |
3131 | |
3132 static v8::Handle<v8::Value> overloadedMethod3Method(const v8::Arguments& args) | |
3133 { | |
3134 if (args.Length() < 1) | |
3135 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
3136 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
3137 V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, strArg, args[0]); | |
3138 imp->overloadedMethod(strArg); | |
3139 return v8Undefined(); | |
3140 } | |
3141 | |
3142 static v8::Handle<v8::Value> overloadedMethod4Method(const v8::Arguments& args) | |
3143 { | |
3144 if (args.Length() < 1) | |
3145 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
3146 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
3147 V8TRYCATCH(int, longArg, toInt32(args[0])); | |
3148 imp->overloadedMethod(longArg); | |
3149 return v8Undefined(); | |
3150 } | |
3151 | |
3152 static v8::Handle<v8::Value> overloadedMethod5Method(const v8::Arguments& args) | |
3153 { | |
3154 if (args.Length() < 1) | |
3155 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
3156 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
3157 if (args.Length() <= 0 || !args[0]->IsFunction()) | |
3158 return throwTypeError(0, args.GetIsolate()); | |
3159 RefPtr<TestCallback> callback = V8TestCallback::create(args[0], getScriptExe
cutionContext()); | |
3160 imp->overloadedMethod(callback); | |
3161 return v8Undefined(); | |
3162 } | |
3163 | |
3164 static v8::Handle<v8::Value> overloadedMethod6Method(const v8::Arguments& args) | |
3165 { | |
3166 if (args.Length() < 1) | |
3167 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
3168 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
3169 V8TRYCATCH(RefPtr<DOMStringList>, listArg, toDOMStringList(args[0], args.Get
Isolate())); | |
3170 imp->overloadedMethod(listArg); | |
3171 return v8Undefined(); | |
3172 } | |
3173 | |
3174 static v8::Handle<v8::Value> overloadedMethod7Method(const v8::Arguments& args) | |
3175 { | |
3176 if (args.Length() < 1) | |
3177 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
3178 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
3179 V8TRYCATCH(Vector<String>, arrayArg, toNativeArray<String>(args[0])); | |
3180 imp->overloadedMethod(arrayArg); | |
3181 return v8Undefined(); | |
3182 } | |
3183 | |
3184 static v8::Handle<v8::Value> overloadedMethod8Method(const v8::Arguments& args) | |
3185 { | |
3186 if (args.Length() < 1) | |
3187 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
3188 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
3189 V8TRYCATCH(TestObj*, objArg, V8TestObj::HasInstance(args[0], args.GetIsolate
(), worldType(args.GetIsolate())) ? V8TestObj::toNative(v8::Handle<v8::Object>::
Cast(args[0])) : 0); | |
3190 imp->overloadedMethod(objArg); | |
3191 return v8Undefined(); | |
3192 } | |
3193 | |
3194 static v8::Handle<v8::Value> overloadedMethod9Method(const v8::Arguments& args) | |
3195 { | |
3196 if (args.Length() < 1) | |
3197 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
3198 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
3199 V8TRYCATCH(Vector<String>, arrayArg, toNativeArray<String>(args[0])); | |
3200 imp->overloadedMethod(arrayArg); | |
3201 return v8Undefined(); | |
3202 } | |
3203 | |
3204 static v8::Handle<v8::Value> overloadedMethod10Method(const v8::Arguments& args) | |
3205 { | |
3206 if (args.Length() < 1) | |
3207 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
3208 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
3209 V8TRYCATCH(Vector<unsigned>, arrayArg, toNativeArray<unsigned>(args[0])); | |
3210 imp->overloadedMethod(arrayArg); | |
3211 return v8Undefined(); | |
3212 } | |
3213 | |
3214 static v8::Handle<v8::Value> overloadedMethod11Method(const v8::Arguments& args) | |
3215 { | |
3216 if (args.Length() < 1) | |
3217 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
3218 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
3219 V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, strArg, args[0]); | |
3220 imp->overloadedMethod(strArg); | |
3221 return v8Undefined(); | |
3222 } | |
3223 | |
3224 static v8::Handle<v8::Value> overloadedMethodMethod(const v8::Arguments& args) | |
3225 { | |
3226 if ((args.Length() == 2 && (args[0]->IsNull() || V8TestObj::HasInstance(args
[0], args.GetIsolate(), worldType(args.GetIsolate()))) && (args[1]->IsNull() ||
args[1]->IsUndefined() || args[1]->IsString() || args[1]->IsObject()))) | |
3227 return overloadedMethod1Method(args); | |
3228 if ((args.Length() == 1 && (args[0]->IsNull() || V8TestObj::HasInstance(args
[0], args.GetIsolate(), worldType(args.GetIsolate())))) || (args.Length() == 2 &
& (args[0]->IsNull() || V8TestObj::HasInstance(args[0], args.GetIsolate(), world
Type(args.GetIsolate()))))) | |
3229 return overloadedMethod2Method(args); | |
3230 if ((args.Length() == 1 && (args[0]->IsNull() || args[0]->IsUndefined() || a
rgs[0]->IsString() || args[0]->IsObject()))) | |
3231 return overloadedMethod3Method(args); | |
3232 if (args.Length() == 1) | |
3233 return overloadedMethod4Method(args); | |
3234 if ((args.Length() == 1 && (args[0]->IsNull() || args[0]->IsFunction()))) | |
3235 return overloadedMethod5Method(args); | |
3236 if ((args.Length() == 1 && (args[0]->IsNull() || V8DOMStringList::HasInstanc
e(args[0], args.GetIsolate(), worldType(args.GetIsolate()))))) | |
3237 return overloadedMethod6Method(args); | |
3238 if ((args.Length() == 1 && (args[0]->IsNull() || args[0]->IsArray()))) | |
3239 return overloadedMethod7Method(args); | |
3240 if ((args.Length() == 1 && (V8TestObj::HasInstance(args[0], args.GetIsolate(
), worldType(args.GetIsolate()))))) | |
3241 return overloadedMethod8Method(args); | |
3242 if ((args.Length() == 1 && (args[0]->IsArray()))) | |
3243 return overloadedMethod9Method(args); | |
3244 if ((args.Length() == 1 && (args[0]->IsArray()))) | |
3245 return overloadedMethod10Method(args); | |
3246 if (args.Length() == 1) | |
3247 return overloadedMethod11Method(args); | |
3248 if (args.Length() < 1) | |
3249 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
3250 return throwTypeError(0, args.GetIsolate()); | |
3251 } | |
3252 | |
3253 static v8::Handle<v8::Value> overloadedMethodMethodCallback(const v8::Arguments&
args) | |
3254 { | |
3255 return TestObjV8Internal::overloadedMethodMethod(args); | |
3256 } | |
3257 | |
3258 static v8::Handle<v8::Value> classMethodMethod(const v8::Arguments& args) | |
3259 { | |
3260 TestObj::classMethod(); | |
3261 return v8Undefined(); | |
3262 } | |
3263 | |
3264 static v8::Handle<v8::Value> classMethodMethodCallback(const v8::Arguments& args
) | |
3265 { | |
3266 return TestObjV8Internal::classMethodMethod(args); | |
3267 } | |
3268 | |
3269 static v8::Handle<v8::Value> classMethodWithOptionalMethod(const v8::Arguments&
args) | |
3270 { | |
3271 if (args.Length() <= 0) { | |
3272 return v8Integer(TestObj::classMethodWithOptional(), args.GetIsolate()); | |
3273 } | |
3274 V8TRYCATCH(int, arg, toInt32(args[0])); | |
3275 return v8Integer(TestObj::classMethodWithOptional(arg), args.GetIsolate()); | |
3276 } | |
3277 | |
3278 static v8::Handle<v8::Value> classMethodWithOptionalMethodCallback(const v8::Arg
uments& args) | |
3279 { | |
3280 return TestObjV8Internal::classMethodWithOptionalMethod(args); | |
3281 } | |
3282 | |
3283 static v8::Handle<v8::Value> classMethod2MethodCallback(const v8::Arguments& arg
s) | |
3284 { | |
3285 return V8TestObj::classMethod2MethodCustom(args); | |
3286 } | |
3287 | |
3288 #if ENABLE(Condition1) | |
3289 | |
3290 static v8::Handle<v8::Value> overloadedMethod11Method(const v8::Arguments& args) | |
3291 { | |
3292 if (args.Length() < 1) | |
3293 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
3294 V8TRYCATCH(int, arg, toInt32(args[0])); | |
3295 TestObj::overloadedMethod1(arg); | |
3296 return v8Undefined(); | |
3297 } | |
3298 | |
3299 #endif // ENABLE(Condition1) | |
3300 | |
3301 #if ENABLE(Condition1) | |
3302 | |
3303 static v8::Handle<v8::Value> overloadedMethod12Method(const v8::Arguments& args) | |
3304 { | |
3305 if (args.Length() < 1) | |
3306 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
3307 V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, type, args[0]); | |
3308 TestObj::overloadedMethod1(type); | |
3309 return v8Undefined(); | |
3310 } | |
3311 | |
3312 #endif // ENABLE(Condition1) | |
3313 | |
3314 #if ENABLE(Condition1) | |
3315 | |
3316 static v8::Handle<v8::Value> overloadedMethod1Method(const v8::Arguments& args) | |
3317 { | |
3318 if (args.Length() == 1) | |
3319 return overloadedMethod11Method(args); | |
3320 if ((args.Length() == 1 && (args[0]->IsNull() || args[0]->IsUndefined() || a
rgs[0]->IsString() || args[0]->IsObject()))) | |
3321 return overloadedMethod12Method(args); | |
3322 if (args.Length() < 1) | |
3323 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
3324 return throwTypeError(0, args.GetIsolate()); | |
3325 } | |
3326 | |
3327 #endif // ENABLE(Condition1) | |
3328 | |
3329 #if ENABLE(Condition1) | |
3330 | |
3331 static v8::Handle<v8::Value> overloadedMethod1MethodCallback(const v8::Arguments
& args) | |
3332 { | |
3333 return TestObjV8Internal::overloadedMethod1Method(args); | |
3334 } | |
3335 | |
3336 #endif // ENABLE(Condition1) | |
3337 | |
3338 static v8::Handle<v8::Value> classMethodWithClampMethod(const v8::Arguments& arg
s) | |
3339 { | |
3340 if (args.Length() < 2) | |
3341 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
3342 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
3343 unsigned short objArgsShort = 0; | |
3344 V8TRYCATCH(double, objArgsShortNativeValue, args[0]->NumberValue()); | |
3345 if (!std::isnan(objArgsShortNativeValue)) | |
3346 objArgsShort = clampTo<unsigned short>(objArgsShortNativeValue); | |
3347 unsigned long objArgsLong = 0; | |
3348 V8TRYCATCH(double, objArgsLongNativeValue, args[1]->NumberValue()); | |
3349 if (!std::isnan(objArgsLongNativeValue)) | |
3350 objArgsLong = clampTo<unsigned long>(objArgsLongNativeValue); | |
3351 imp->classMethodWithClamp(objArgsShort, objArgsLong); | |
3352 return v8Undefined(); | |
3353 } | |
3354 | |
3355 static v8::Handle<v8::Value> classMethodWithClampMethodCallback(const v8::Argume
nts& args) | |
3356 { | |
3357 return TestObjV8Internal::classMethodWithClampMethod(args); | |
3358 } | |
3359 | |
3360 static v8::Handle<v8::Value> enabledAtRuntimeMethod1Method(const v8::Arguments&
args) | |
3361 { | |
3362 if (args.Length() < 1) | |
3363 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
3364 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
3365 V8TRYCATCH(int, longArg, toInt32(args[0])); | |
3366 imp->enabledAtRuntimeMethod1(longArg); | |
3367 return v8Undefined(); | |
3368 } | |
3369 | |
3370 static v8::Handle<v8::Value> enabledAtRuntimeMethod1MethodCallback(const v8::Arg
uments& args) | |
3371 { | |
3372 return TestObjV8Internal::enabledAtRuntimeMethod1Method(args); | |
3373 } | |
3374 | |
3375 static v8::Handle<v8::Value> enabledAtRuntimeMethod2Method(const v8::Arguments&
args) | |
3376 { | |
3377 if (args.Length() < 1) | |
3378 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
3379 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
3380 V8TRYCATCH(int, longArg, toInt32(args[0])); | |
3381 imp->enabledAtRuntimeMethod2(longArg); | |
3382 return v8Undefined(); | |
3383 } | |
3384 | |
3385 static v8::Handle<v8::Value> enabledAtRuntimeMethod2MethodCallback(const v8::Arg
uments& args) | |
3386 { | |
3387 return TestObjV8Internal::enabledAtRuntimeMethod2Method(args); | |
3388 } | |
3389 | |
3390 static v8::Handle<v8::Value> enabledPerContextMethod1Method(const v8::Arguments&
args) | |
3391 { | |
3392 if (args.Length() < 1) | |
3393 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
3394 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
3395 V8TRYCATCH(int, longArg, toInt32(args[0])); | |
3396 imp->enabledPerContextMethod1(longArg); | |
3397 return v8Undefined(); | |
3398 } | |
3399 | |
3400 static v8::Handle<v8::Value> enabledPerContextMethod1MethodCallback(const v8::Ar
guments& args) | |
3401 { | |
3402 return TestObjV8Internal::enabledPerContextMethod1Method(args); | |
3403 } | |
3404 | |
3405 static v8::Handle<v8::Value> enabledPerContextMethod2Method(const v8::Arguments&
args) | |
3406 { | |
3407 if (args.Length() < 1) | |
3408 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
3409 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
3410 V8TRYCATCH(int, longArg, toInt32(args[0])); | |
3411 imp->enabledPerContextMethod2(longArg); | |
3412 return v8Undefined(); | |
3413 } | |
3414 | |
3415 static v8::Handle<v8::Value> enabledPerContextMethod2MethodCallback(const v8::Ar
guments& args) | |
3416 { | |
3417 return TestObjV8Internal::enabledPerContextMethod2Method(args); | |
3418 } | |
3419 | |
3420 static v8::Handle<v8::Value> methodWithUnsignedLongSequenceMethod(const v8::Argu
ments& args) | |
3421 { | |
3422 if (args.Length() < 1) | |
3423 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
3424 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
3425 V8TRYCATCH(Vector<unsigned>, unsignedLongSequence, toNativeArray<unsigned>(a
rgs[0])); | |
3426 imp->methodWithUnsignedLongSequence(unsignedLongSequence); | |
3427 return v8Undefined(); | |
3428 } | |
3429 | |
3430 static v8::Handle<v8::Value> methodWithUnsignedLongSequenceMethodCallback(const
v8::Arguments& args) | |
3431 { | |
3432 return TestObjV8Internal::methodWithUnsignedLongSequenceMethod(args); | |
3433 } | |
3434 | |
3435 static v8::Handle<v8::Value> stringArrayFunctionMethod(const v8::Arguments& args
) | |
3436 { | |
3437 if (args.Length() < 1) | |
3438 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
3439 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
3440 ExceptionCode ec = 0; | |
3441 { | |
3442 V8TRYCATCH(Vector<String>, values, toNativeArray<String>(args[0])); | |
3443 Vector<String> result = imp->stringArrayFunction(values, ec); | |
3444 if (UNLIKELY(ec)) | |
3445 goto fail; | |
3446 return v8Array(result, args.GetIsolate()); | |
3447 } | |
3448 fail: | |
3449 return setDOMException(ec, args.GetIsolate()); | |
3450 } | |
3451 | |
3452 static v8::Handle<v8::Value> stringArrayFunctionMethodCallback(const v8::Argumen
ts& args) | |
3453 { | |
3454 return TestObjV8Internal::stringArrayFunctionMethod(args); | |
3455 } | |
3456 | |
3457 static v8::Handle<v8::Value> domStringListFunctionMethod(const v8::Arguments& ar
gs) | |
3458 { | |
3459 if (args.Length() < 1) | |
3460 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
3461 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
3462 ExceptionCode ec = 0; | |
3463 { | |
3464 V8TRYCATCH(RefPtr<DOMStringList>, values, toDOMStringList(args[0], args.GetI
solate())); | |
3465 RefPtr<DOMStringList> result = imp->domStringListFunction(values, ec); | |
3466 if (UNLIKELY(ec)) | |
3467 goto fail; | |
3468 return toV8(result.release(), args.Holder(), args.GetIsolate()); | |
3469 } | |
3470 fail: | |
3471 return setDOMException(ec, args.GetIsolate()); | |
3472 } | |
3473 | |
3474 static v8::Handle<v8::Value> domStringListFunctionMethodCallback(const v8::Argum
ents& args) | |
3475 { | |
3476 return TestObjV8Internal::domStringListFunctionMethod(args); | |
3477 } | |
3478 | |
3479 static v8::Handle<v8::Value> getSVGDocumentMethod(const v8::Arguments& args) | |
3480 { | |
3481 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
3482 ExceptionCode ec = 0; | |
3483 { | |
3484 if (!BindingSecurity::shouldAllowAccessToNode(imp->getSVGDocument(ec))) | |
3485 return v8::Handle<v8::Value>(v8Null(args.GetIsolate())); | |
3486 RefPtr<SVGDocument> result = imp->getSVGDocument(ec); | |
3487 if (UNLIKELY(ec)) | |
3488 goto fail; | |
3489 return toV8(result.release(), args.Holder(), args.GetIsolate()); | |
3490 } | |
3491 fail: | |
3492 return setDOMException(ec, args.GetIsolate()); | |
3493 } | |
3494 | |
3495 static v8::Handle<v8::Value> getSVGDocumentMethodCallback(const v8::Arguments& a
rgs) | |
3496 { | |
3497 return TestObjV8Internal::getSVGDocumentMethod(args); | |
3498 } | |
3499 | |
3500 static v8::Handle<v8::Value> convert1Method(const v8::Arguments& args) | |
3501 { | |
3502 if (args.Length() < 1) | |
3503 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
3504 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
3505 V8TRYCATCH(TestNode*, value, V8TestNode::HasInstance(args[0], args.GetIsolat
e(), worldType(args.GetIsolate())) ? V8TestNode::toNative(v8::Handle<v8::Object>
::Cast(args[0])) : 0); | |
3506 imp->convert1(value); | |
3507 return v8Undefined(); | |
3508 } | |
3509 | |
3510 static v8::Handle<v8::Value> convert1MethodCallback(const v8::Arguments& args) | |
3511 { | |
3512 return TestObjV8Internal::convert1Method(args); | |
3513 } | |
3514 | |
3515 static v8::Handle<v8::Value> convert2Method(const v8::Arguments& args) | |
3516 { | |
3517 if (args.Length() < 1) | |
3518 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
3519 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
3520 V8TRYCATCH(TestNode*, value, V8TestNode::HasInstance(args[0], args.GetIsolat
e(), worldType(args.GetIsolate())) ? V8TestNode::toNative(v8::Handle<v8::Object>
::Cast(args[0])) : 0); | |
3521 imp->convert2(value); | |
3522 return v8Undefined(); | |
3523 } | |
3524 | |
3525 static v8::Handle<v8::Value> convert2MethodCallback(const v8::Arguments& args) | |
3526 { | |
3527 return TestObjV8Internal::convert2Method(args); | |
3528 } | |
3529 | |
3530 static v8::Handle<v8::Value> convert4Method(const v8::Arguments& args) | |
3531 { | |
3532 if (args.Length() < 1) | |
3533 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
3534 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
3535 V8TRYCATCH(TestNode*, value, V8TestNode::HasInstance(args[0], args.GetIsolat
e(), worldType(args.GetIsolate())) ? V8TestNode::toNative(v8::Handle<v8::Object>
::Cast(args[0])) : 0); | |
3536 imp->convert4(value); | |
3537 return v8Undefined(); | |
3538 } | |
3539 | |
3540 static v8::Handle<v8::Value> convert4MethodCallback(const v8::Arguments& args) | |
3541 { | |
3542 return TestObjV8Internal::convert4Method(args); | |
3543 } | |
3544 | |
3545 static v8::Handle<v8::Value> convert5Method(const v8::Arguments& args) | |
3546 { | |
3547 if (args.Length() < 1) | |
3548 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
3549 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
3550 V8TRYCATCH(TestNode*, value, V8TestNode::HasInstance(args[0], args.GetIsolat
e(), worldType(args.GetIsolate())) ? V8TestNode::toNative(v8::Handle<v8::Object>
::Cast(args[0])) : 0); | |
3551 imp->convert5(value); | |
3552 return v8Undefined(); | |
3553 } | |
3554 | |
3555 static v8::Handle<v8::Value> convert5MethodCallback(const v8::Arguments& args) | |
3556 { | |
3557 return TestObjV8Internal::convert5Method(args); | |
3558 } | |
3559 | |
3560 static v8::Handle<v8::Value> mutablePointFunctionMethod(const v8::Arguments& arg
s) | |
3561 { | |
3562 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
3563 return toV8(WTF::getPtr(SVGPropertyTearOff<FloatPoint>::create(imp->mutableP
ointFunction())), args.Holder(), args.GetIsolate()); | |
3564 } | |
3565 | |
3566 static v8::Handle<v8::Value> mutablePointFunctionMethodCallback(const v8::Argume
nts& args) | |
3567 { | |
3568 return TestObjV8Internal::mutablePointFunctionMethod(args); | |
3569 } | |
3570 | |
3571 static v8::Handle<v8::Value> immutablePointFunctionMethod(const v8::Arguments& a
rgs) | |
3572 { | |
3573 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
3574 return toV8(WTF::getPtr(SVGPropertyTearOff<FloatPoint>::create(imp->immutabl
ePointFunction())), args.Holder(), args.GetIsolate()); | |
3575 } | |
3576 | |
3577 static v8::Handle<v8::Value> immutablePointFunctionMethodCallback(const v8::Argu
ments& args) | |
3578 { | |
3579 return TestObjV8Internal::immutablePointFunctionMethod(args); | |
3580 } | |
3581 | |
3582 static v8::Handle<v8::Value> orangeMethod(const v8::Arguments& args) | |
3583 { | |
3584 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
3585 imp->banana(); | |
3586 return v8Undefined(); | |
3587 } | |
3588 | |
3589 static v8::Handle<v8::Value> orangeMethodCallback(const v8::Arguments& args) | |
3590 { | |
3591 return TestObjV8Internal::orangeMethod(args); | |
3592 } | |
3593 | |
3594 static v8::Handle<v8::Value> strictFunctionMethod(const v8::Arguments& args) | |
3595 { | |
3596 if (args.Length() < 3) | |
3597 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
3598 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
3599 ExceptionCode ec = 0; | |
3600 { | |
3601 V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, str, args[0]); | |
3602 V8TRYCATCH(float, a, static_cast<float>(args[1]->NumberValue())); | |
3603 V8TRYCATCH(int, b, toInt32(args[2])); | |
3604 bool result = imp->strictFunction(str, a, b, ec); | |
3605 if (UNLIKELY(ec)) | |
3606 goto fail; | |
3607 return v8Boolean(result, args.GetIsolate()); | |
3608 } | |
3609 fail: | |
3610 return setDOMException(ec, args.GetIsolate()); | |
3611 } | |
3612 | |
3613 static v8::Handle<v8::Value> strictFunctionMethodCallback(const v8::Arguments& a
rgs) | |
3614 { | |
3615 return TestObjV8Internal::strictFunctionMethod(args); | |
3616 } | |
3617 | |
3618 static v8::Handle<v8::Value> variadicStringMethodMethod(const v8::Arguments& arg
s) | |
3619 { | |
3620 if (args.Length() < 1) | |
3621 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
3622 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
3623 V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, head, args[0]); | |
3624 V8TRYCATCH(Vector<String>, tail, toNativeArguments<String>(args, 1)); | |
3625 imp->variadicStringMethod(head, tail); | |
3626 return v8Undefined(); | |
3627 } | |
3628 | |
3629 static v8::Handle<v8::Value> variadicStringMethodMethodCallback(const v8::Argume
nts& args) | |
3630 { | |
3631 return TestObjV8Internal::variadicStringMethodMethod(args); | |
3632 } | |
3633 | |
3634 static v8::Handle<v8::Value> variadicDoubleMethodMethod(const v8::Arguments& arg
s) | |
3635 { | |
3636 if (args.Length() < 1) | |
3637 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
3638 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
3639 V8TRYCATCH(double, head, static_cast<double>(args[0]->NumberValue())); | |
3640 V8TRYCATCH(Vector<double>, tail, toNativeArguments<double>(args, 1)); | |
3641 imp->variadicDoubleMethod(head, tail); | |
3642 return v8Undefined(); | |
3643 } | |
3644 | |
3645 static v8::Handle<v8::Value> variadicDoubleMethodMethodCallback(const v8::Argume
nts& args) | |
3646 { | |
3647 return TestObjV8Internal::variadicDoubleMethodMethod(args); | |
3648 } | |
3649 | |
3650 static v8::Handle<v8::Value> variadicNodeMethodMethod(const v8::Arguments& args) | |
3651 { | |
3652 if (args.Length() < 1) | |
3653 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
3654 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
3655 V8TRYCATCH(Node*, head, V8Node::HasInstance(args[0], args.GetIsolate(), worl
dType(args.GetIsolate())) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(args[0
])) : 0); | |
3656 Vector<RefPtr<Node> > tail; | |
3657 for (int i = 1; i < args.Length(); ++i) { | |
3658 if (!V8Node::HasInstance(args[i], args.GetIsolate(), worldType(args.GetI
solate()))) | |
3659 return throwTypeError(0, args.GetIsolate()); | |
3660 tail.append(V8Node::toNative(v8::Handle<v8::Object>::Cast(args[i]))); | |
3661 } | |
3662 imp->variadicNodeMethod(head, tail); | |
3663 return v8Undefined(); | |
3664 } | |
3665 | |
3666 static v8::Handle<v8::Value> variadicNodeMethodMethodCallback(const v8::Argument
s& args) | |
3667 { | |
3668 return TestObjV8Internal::variadicNodeMethodMethod(args); | |
3669 } | |
3670 | |
3671 static v8::Handle<v8::Value> perWorldMethodMethod(const v8::Arguments& args) | |
3672 { | |
3673 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
3674 imp->perWorldMethod(); | |
3675 return v8Undefined(); | |
3676 } | |
3677 | |
3678 static v8::Handle<v8::Value> perWorldMethodMethodForMainWorld(const v8::Argument
s& args) | |
3679 { | |
3680 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
3681 imp->perWorldMethod(); | |
3682 return v8Undefined(); | |
3683 } | |
3684 | |
3685 static v8::Handle<v8::Value> perWorldMethodMethodCallback(const v8::Arguments& a
rgs) | |
3686 { | |
3687 return TestObjV8Internal::perWorldMethodMethod(args); | |
3688 } | |
3689 | |
3690 static v8::Handle<v8::Value> perWorldMethodMethodCallbackForMainWorld(const v8::
Arguments& args) | |
3691 { | |
3692 return TestObjV8Internal::perWorldMethodMethodForMainWorld(args); | |
3693 } | |
3694 | |
3695 static v8::Handle<v8::Value> overloadedPerWorldMethod1Method(const v8::Arguments
& args) | |
3696 { | |
3697 if (args.Length() < 1) | |
3698 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
3699 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
3700 V8TRYCATCH(int, longArg, toInt32(args[0])); | |
3701 imp->overloadedPerWorldMethod(longArg); | |
3702 return v8Undefined(); | |
3703 } | |
3704 | |
3705 static v8::Handle<v8::Value> overloadedPerWorldMethod1MethodForMainWorld(const v
8::Arguments& args) | |
3706 { | |
3707 if (args.Length() < 1) | |
3708 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
3709 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
3710 V8TRYCATCH(int, longArg, toInt32(args[0])); | |
3711 imp->overloadedPerWorldMethod(longArg); | |
3712 return v8Undefined(); | |
3713 } | |
3714 | |
3715 static v8::Handle<v8::Value> overloadedPerWorldMethod2Method(const v8::Arguments
& args) | |
3716 { | |
3717 if (args.Length() < 2) | |
3718 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
3719 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
3720 V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, strArg, args[0]); | |
3721 V8TRYCATCH(int, longArg, toInt32(args[1])); | |
3722 imp->overloadedPerWorldMethod(strArg, longArg); | |
3723 return v8Undefined(); | |
3724 } | |
3725 | |
3726 static v8::Handle<v8::Value> overloadedPerWorldMethod2MethodForMainWorld(const v
8::Arguments& args) | |
3727 { | |
3728 if (args.Length() < 2) | |
3729 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
3730 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
3731 V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, strArg, args[0]); | |
3732 V8TRYCATCH(int, longArg, toInt32(args[1])); | |
3733 imp->overloadedPerWorldMethod(strArg, longArg); | |
3734 return v8Undefined(); | |
3735 } | |
3736 | |
3737 static v8::Handle<v8::Value> overloadedPerWorldMethodMethod(const v8::Arguments&
args) | |
3738 { | |
3739 if (args.Length() == 1) | |
3740 return overloadedPerWorldMethod1Method(args); | |
3741 if (args.Length() == 2) | |
3742 return overloadedPerWorldMethod2Method(args); | |
3743 if (args.Length() < 1) | |
3744 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
3745 return throwTypeError(0, args.GetIsolate()); | |
3746 } | |
3747 | |
3748 static v8::Handle<v8::Value> overloadedPerWorldMethodMethodForMainWorld(const v8
::Arguments& args) | |
3749 { | |
3750 if (args.Length() == 1) | |
3751 return overloadedPerWorldMethod1MethodForMainWorld(args); | |
3752 if (args.Length() == 2) | |
3753 return overloadedPerWorldMethod2MethodForMainWorld(args); | |
3754 if (args.Length() < 1) | |
3755 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
3756 return throwTypeError(0, args.GetIsolate()); | |
3757 } | |
3758 | |
3759 static v8::Handle<v8::Value> overloadedPerWorldMethodMethodCallback(const v8::Ar
guments& args) | |
3760 { | |
3761 return TestObjV8Internal::overloadedPerWorldMethodMethod(args); | |
3762 } | |
3763 | |
3764 static v8::Handle<v8::Value> overloadedPerWorldMethodMethodCallbackForMainWorld(
const v8::Arguments& args) | |
3765 { | |
3766 return TestObjV8Internal::overloadedPerWorldMethodMethodForMainWorld(args); | |
3767 } | |
3768 | |
3769 static v8::Handle<v8::Value> activityLoggedMethod1Method(const v8::Arguments& ar
gs) | |
3770 { | |
3771 if (args.Length() < 1) | |
3772 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
3773 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
3774 V8TRYCATCH(int, longArg, toInt32(args[0])); | |
3775 imp->activityLoggedMethod1(longArg); | |
3776 return v8Undefined(); | |
3777 } | |
3778 | |
3779 static v8::Handle<v8::Value> activityLoggedMethod1MethodCallback(const v8::Argum
ents& args) | |
3780 { | |
3781 V8PerContextData* contextData = V8PerContextData::from(args.GetIsolate()->Ge
tCurrentContext()); | |
3782 if (contextData && contextData->activityLogger()) { | |
3783 Vector<v8::Handle<v8::Value> > loggerArgs = toVectorOfArguments(args); | |
3784 contextData->activityLogger()->log("TestObject.activityLoggedMethod1", a
rgs.Length(), loggerArgs.data(), "Method"); | |
3785 } | |
3786 return TestObjV8Internal::activityLoggedMethod1Method(args); | |
3787 } | |
3788 | |
3789 static v8::Handle<v8::Value> activityLoggedMethod2Method(const v8::Arguments& ar
gs) | |
3790 { | |
3791 if (args.Length() < 1) | |
3792 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
3793 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
3794 V8TRYCATCH(int, longArg, toInt32(args[0])); | |
3795 imp->activityLoggedMethod2(longArg); | |
3796 return v8Undefined(); | |
3797 } | |
3798 | |
3799 static v8::Handle<v8::Value> activityLoggedMethod2MethodForMainWorld(const v8::A
rguments& args) | |
3800 { | |
3801 if (args.Length() < 1) | |
3802 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
3803 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
3804 V8TRYCATCH(int, longArg, toInt32(args[0])); | |
3805 imp->activityLoggedMethod2(longArg); | |
3806 return v8Undefined(); | |
3807 } | |
3808 | |
3809 static v8::Handle<v8::Value> activityLoggedMethod2MethodCallback(const v8::Argum
ents& args) | |
3810 { | |
3811 V8PerContextData* contextData = V8PerContextData::from(args.GetIsolate()->Ge
tCurrentContext()); | |
3812 if (contextData && contextData->activityLogger()) { | |
3813 Vector<v8::Handle<v8::Value> > loggerArgs = toVectorOfArguments(args); | |
3814 contextData->activityLogger()->log("TestObject.activityLoggedMethod2", a
rgs.Length(), loggerArgs.data(), "Method"); | |
3815 } | |
3816 return TestObjV8Internal::activityLoggedMethod2Method(args); | |
3817 } | |
3818 | |
3819 static v8::Handle<v8::Value> activityLoggedMethod2MethodCallbackForMainWorld(con
st v8::Arguments& args) | |
3820 { | |
3821 V8PerContextData* contextData = V8PerContextData::from(args.GetIsolate()->Ge
tCurrentContext()); | |
3822 if (contextData && contextData->activityLogger()) { | |
3823 Vector<v8::Handle<v8::Value> > loggerArgs = toVectorOfArguments(args); | |
3824 contextData->activityLogger()->log("TestObject.activityLoggedMethod2", a
rgs.Length(), loggerArgs.data(), "Method"); | |
3825 } | |
3826 return TestObjV8Internal::activityLoggedMethod2MethodForMainWorld(args); | |
3827 } | |
3828 | |
3829 static v8::Handle<v8::Value> activityLoggedInIsolatedWorldMethodMethod(const v8:
:Arguments& args) | |
3830 { | |
3831 if (args.Length() < 1) | |
3832 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
3833 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
3834 V8TRYCATCH(int, longArg, toInt32(args[0])); | |
3835 imp->activityLoggedInIsolatedWorldMethod(longArg); | |
3836 return v8Undefined(); | |
3837 } | |
3838 | |
3839 static v8::Handle<v8::Value> activityLoggedInIsolatedWorldMethodMethodForMainWor
ld(const v8::Arguments& args) | |
3840 { | |
3841 if (args.Length() < 1) | |
3842 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
3843 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
3844 V8TRYCATCH(int, longArg, toInt32(args[0])); | |
3845 imp->activityLoggedInIsolatedWorldMethod(longArg); | |
3846 return v8Undefined(); | |
3847 } | |
3848 | |
3849 static v8::Handle<v8::Value> activityLoggedInIsolatedWorldMethodMethodCallback(c
onst v8::Arguments& args) | |
3850 { | |
3851 V8PerContextData* contextData = V8PerContextData::from(args.GetIsolate()->Ge
tCurrentContext()); | |
3852 if (contextData && contextData->activityLogger()) { | |
3853 Vector<v8::Handle<v8::Value> > loggerArgs = toVectorOfArguments(args); | |
3854 contextData->activityLogger()->log("TestObject.activityLoggedInIsolatedW
orldMethod", args.Length(), loggerArgs.data(), "Method"); | |
3855 } | |
3856 return TestObjV8Internal::activityLoggedInIsolatedWorldMethodMethod(args); | |
3857 } | |
3858 | |
3859 static v8::Handle<v8::Value> activityLoggedInIsolatedWorldMethodMethodCallbackFo
rMainWorld(const v8::Arguments& args) | |
3860 { | |
3861 return TestObjV8Internal::activityLoggedInIsolatedWorldMethodMethodForMainWo
rld(args); | |
3862 } | |
3863 | |
3864 static v8::Handle<v8::Value> overloadedActivityLoggedMethod1Method(const v8::Arg
uments& args) | |
3865 { | |
3866 if (args.Length() < 1) | |
3867 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
3868 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
3869 V8TRYCATCH(int, longArg, toInt32(args[0])); | |
3870 imp->overloadedActivityLoggedMethod(longArg); | |
3871 return v8Undefined(); | |
3872 } | |
3873 | |
3874 static v8::Handle<v8::Value> overloadedActivityLoggedMethod1MethodForMainWorld(c
onst v8::Arguments& args) | |
3875 { | |
3876 if (args.Length() < 1) | |
3877 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
3878 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
3879 V8TRYCATCH(int, longArg, toInt32(args[0])); | |
3880 imp->overloadedActivityLoggedMethod(longArg); | |
3881 return v8Undefined(); | |
3882 } | |
3883 | |
3884 static v8::Handle<v8::Value> overloadedActivityLoggedMethod2Method(const v8::Arg
uments& args) | |
3885 { | |
3886 if (args.Length() < 2) | |
3887 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
3888 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
3889 V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, strArg, args[0]); | |
3890 V8TRYCATCH(int, longArg, toInt32(args[1])); | |
3891 imp->overloadedActivityLoggedMethod(strArg, longArg); | |
3892 return v8Undefined(); | |
3893 } | |
3894 | |
3895 static v8::Handle<v8::Value> overloadedActivityLoggedMethod2MethodForMainWorld(c
onst v8::Arguments& args) | |
3896 { | |
3897 if (args.Length() < 2) | |
3898 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
3899 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
3900 V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, strArg, args[0]); | |
3901 V8TRYCATCH(int, longArg, toInt32(args[1])); | |
3902 imp->overloadedActivityLoggedMethod(strArg, longArg); | |
3903 return v8Undefined(); | |
3904 } | |
3905 | |
3906 static v8::Handle<v8::Value> overloadedActivityLoggedMethodMethod(const v8::Argu
ments& args) | |
3907 { | |
3908 if (args.Length() == 1) | |
3909 return overloadedActivityLoggedMethod1Method(args); | |
3910 if (args.Length() == 2) | |
3911 return overloadedActivityLoggedMethod2Method(args); | |
3912 if (args.Length() < 1) | |
3913 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
3914 return throwTypeError(0, args.GetIsolate()); | |
3915 } | |
3916 | |
3917 static v8::Handle<v8::Value> overloadedActivityLoggedMethodMethodForMainWorld(co
nst v8::Arguments& args) | |
3918 { | |
3919 if (args.Length() == 1) | |
3920 return overloadedActivityLoggedMethod1MethodForMainWorld(args); | |
3921 if (args.Length() == 2) | |
3922 return overloadedActivityLoggedMethod2MethodForMainWorld(args); | |
3923 if (args.Length() < 1) | |
3924 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
3925 return throwTypeError(0, args.GetIsolate()); | |
3926 } | |
3927 | |
3928 static v8::Handle<v8::Value> overloadedActivityLoggedMethodMethodCallback(const
v8::Arguments& args) | |
3929 { | |
3930 V8PerContextData* contextData = V8PerContextData::from(args.GetIsolate()->Ge
tCurrentContext()); | |
3931 if (contextData && contextData->activityLogger()) { | |
3932 Vector<v8::Handle<v8::Value> > loggerArgs = toVectorOfArguments(args); | |
3933 contextData->activityLogger()->log("TestObject.overloadedActivityLoggedM
ethod", args.Length(), loggerArgs.data(), "Method"); | |
3934 } | |
3935 return TestObjV8Internal::overloadedActivityLoggedMethodMethod(args); | |
3936 } | |
3937 | |
3938 static v8::Handle<v8::Value> overloadedActivityLoggedMethodMethodCallbackForMain
World(const v8::Arguments& args) | |
3939 { | |
3940 V8PerContextData* contextData = V8PerContextData::from(args.GetIsolate()->Ge
tCurrentContext()); | |
3941 if (contextData && contextData->activityLogger()) { | |
3942 Vector<v8::Handle<v8::Value> > loggerArgs = toVectorOfArguments(args); | |
3943 contextData->activityLogger()->log("TestObject.overloadedActivityLoggedM
ethod", args.Length(), loggerArgs.data(), "Method"); | |
3944 } | |
3945 return TestObjV8Internal::overloadedActivityLoggedMethodMethodForMainWorld(a
rgs); | |
3946 } | |
3947 | |
3948 static v8::Handle<v8::Value> deprecatedMethodMethod(const v8::Arguments& args) | |
3949 { | |
3950 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
3951 imp->deprecatedMethod(); | |
3952 return v8Undefined(); | |
3953 } | |
3954 | |
3955 static v8::Handle<v8::Value> deprecatedMethodMethodCallback(const v8::Arguments&
args) | |
3956 { | |
3957 UseCounter::countDeprecation(activeDOMWindow(), UseCounter::Method); | |
3958 return TestObjV8Internal::deprecatedMethodMethod(args); | |
3959 } | |
3960 | |
3961 static v8::Handle<v8::Value> deprecatedStaticMethodMethod(const v8::Arguments& a
rgs) | |
3962 { | |
3963 TestObj::deprecatedStaticMethod(); | |
3964 return v8Undefined(); | |
3965 } | |
3966 | |
3967 static v8::Handle<v8::Value> deprecatedStaticMethodMethodCallback(const v8::Argu
ments& args) | |
3968 { | |
3969 UseCounter::countDeprecation(activeDOMWindow(), UseCounter::StaticMethod); | |
3970 return TestObjV8Internal::deprecatedStaticMethodMethod(args); | |
3971 } | |
3972 | |
3973 static v8::Handle<v8::Value> constructor(const v8::Arguments& args) | |
3974 { | |
3975 if (args.Length() < 1) | |
3976 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
3977 if (args.Length() <= 0 || !args[0]->IsFunction()) | |
3978 return throwTypeError(0, args.GetIsolate()); | |
3979 RefPtr<TestCallback> testCallback = V8TestCallback::create(args[0], getScrip
tExecutionContext()); | |
3980 | |
3981 RefPtr<TestObj> impl = TestObj::create(testCallback); | |
3982 v8::Handle<v8::Object> wrapper = args.Holder(); | |
3983 | |
3984 V8DOMWrapper::associateObjectWithWrapper(impl.release(), &V8TestObj::info, w
rapper, args.GetIsolate(), WrapperConfiguration::Dependent); | |
3985 return wrapper; | |
3986 } | |
3987 | |
3988 } // namespace TestObjV8Internal | |
3989 | |
3990 static const V8DOMConfiguration::BatchedAttribute V8TestObjAttrs[] = { | |
3991 // Attribute 'readOnlyLongAttr' (Type: 'attribute' ExtAttr: '') | |
3992 {"readOnlyLongAttr", TestObjV8Internal::readOnlyLongAttrAttrGetterCallback,
0, 0, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_ca
st<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | |
3993 // Attribute 'readOnlyStringAttr' (Type: 'attribute' ExtAttr: '') | |
3994 {"readOnlyStringAttr", TestObjV8Internal::readOnlyStringAttrAttrGetterCallba
ck, 0, 0, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), stati
c_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | |
3995 // Attribute 'readOnlyTestObjAttr' (Type: 'attribute' ExtAttr: '') | |
3996 {"readOnlyTestObjAttr", TestObjV8Internal::readOnlyTestObjAttrAttrGetterCall
back, 0, 0, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), sta
tic_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | |
3997 // Attribute 'staticReadOnlyLongAttr' (Type: 'attribute' ExtAttr: '') | |
3998 {"staticReadOnlyLongAttr", TestObjV8Internal::staticReadOnlyLongAttrAttrGett
erCallback, 0, 0, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT
), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | |
3999 // Attribute 'staticStringAttr' (Type: 'attribute' ExtAttr: '') | |
4000 {"staticStringAttr", TestObjV8Internal::staticStringAttrAttrGetterCallback,
TestObjV8Internal::staticStringAttrAttrSetterCallback, 0, 0, 0 /* no data */, st
atic_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8
::None), 0 /* on instance */}, | |
4001 // Attribute 'TestSubObj' (Type: 'attribute' ExtAttr: '') | |
4002 {"TestSubObj", TestObjV8Internal::TestObjConstructorGetter, 0, 0, 0, &V8Test
SubObj::info, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Prope
rtyAttribute>(v8::None | v8::DontEnum), 0 /* on instance */}, | |
4003 // Attribute 'enumAttr' (Type: 'attribute' ExtAttr: '') | |
4004 {"enumAttr", TestObjV8Internal::enumAttrAttrGetterCallback, TestObjV8Interna
l::enumAttrAttrSetterCallback, 0, 0, 0 /* no data */, static_cast<v8::AccessCont
rol>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instanc
e */}, | |
4005 // Attribute 'readOnlyEnumAttr' (Type: 'attribute' ExtAttr: '') | |
4006 {"readOnlyEnumAttr", TestObjV8Internal::readOnlyEnumAttrAttrGetterCallback,
0, 0, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_ca
st<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | |
4007 // Attribute 'shortAttr' (Type: 'attribute' ExtAttr: '') | |
4008 {"shortAttr", TestObjV8Internal::shortAttrAttrGetterCallback, TestObjV8Inter
nal::shortAttrAttrSetterCallback, 0, 0, 0 /* no data */, static_cast<v8::AccessC
ontrol>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on inst
ance */}, | |
4009 // Attribute 'unsignedShortAttr' (Type: 'attribute' ExtAttr: '') | |
4010 {"unsignedShortAttr", TestObjV8Internal::unsignedShortAttrAttrGetterCallback
, TestObjV8Internal::unsignedShortAttrAttrSetterCallback, 0, 0, 0 /* no data */,
static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>
(v8::None), 0 /* on instance */}, | |
4011 // Attribute 'longAttr' (Type: 'attribute' ExtAttr: '') | |
4012 {"longAttr", TestObjV8Internal::longAttrAttrGetterCallback, TestObjV8Interna
l::longAttrAttrSetterCallback, 0, 0, 0 /* no data */, static_cast<v8::AccessCont
rol>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instanc
e */}, | |
4013 // Attribute 'longLongAttr' (Type: 'attribute' ExtAttr: '') | |
4014 {"longLongAttr", TestObjV8Internal::longLongAttrAttrGetterCallback, TestObjV
8Internal::longLongAttrAttrSetterCallback, 0, 0, 0 /* no data */, static_cast<v8
::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /
* on instance */}, | |
4015 // Attribute 'unsignedLongLongAttr' (Type: 'attribute' ExtAttr: '') | |
4016 {"unsignedLongLongAttr", TestObjV8Internal::unsignedLongLongAttrAttrGetterCa
llback, TestObjV8Internal::unsignedLongLongAttrAttrSetterCallback, 0, 0, 0 /* no
data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyA
ttribute>(v8::None), 0 /* on instance */}, | |
4017 // Attribute 'stringAttr' (Type: 'attribute' ExtAttr: '') | |
4018 {"stringAttr", TestObjV8Internal::stringAttrAttrGetterCallback, TestObjV8Int
ernal::stringAttrAttrSetterCallback, 0, 0, 0 /* no data */, static_cast<v8::Acce
ssControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on i
nstance */}, | |
4019 // Attribute 'testObjAttr' (Type: 'attribute' ExtAttr: 'MeasureAs') | |
4020 {"testObjAttr", TestObjV8Internal::testObjAttrAttrGetterCallback, TestObjV8I
nternal::testObjAttrAttrSetterCallback, 0, 0, 0 /* no data */, static_cast<v8::A
ccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* o
n instance */}, | |
4021 // Attribute 'XMLObjAttr' (Type: 'attribute' ExtAttr: '') | |
4022 {"XMLObjAttr", TestObjV8Internal::XMLObjAttrAttrGetterCallback, TestObjV8Int
ernal::XMLObjAttrAttrSetterCallback, 0, 0, 0 /* no data */, static_cast<v8::Acce
ssControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on i
nstance */}, | |
4023 // Attribute 'create' (Type: 'attribute' ExtAttr: '') | |
4024 {"create", TestObjV8Internal::createAttrGetterCallback, TestObjV8Internal::c
reateAttrSetterCallback, 0, 0, 0 /* no data */, static_cast<v8::AccessControl>(v
8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | |
4025 // Attribute 'reflectedStringAttr' (Type: 'attribute' ExtAttr: 'Reflect') | |
4026 {"reflectedStringAttr", TestObjV8Internal::reflectedStringAttrAttrGetterCall
back, TestObjV8Internal::reflectedStringAttrAttrSetterCallback, 0, 0, 0 /* no da
ta */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttr
ibute>(v8::None), 0 /* on instance */}, | |
4027 // Attribute 'reflectedIntegralAttr' (Type: 'attribute' ExtAttr: 'Reflect') | |
4028 {"reflectedIntegralAttr", TestObjV8Internal::reflectedIntegralAttrAttrGetter
Callback, TestObjV8Internal::reflectedIntegralAttrAttrSetterCallback, 0, 0, 0 /*
no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Proper
tyAttribute>(v8::None), 0 /* on instance */}, | |
4029 // Attribute 'reflectedUnsignedIntegralAttr' (Type: 'attribute' ExtAttr: 'Re
flect') | |
4030 {"reflectedUnsignedIntegralAttr", TestObjV8Internal::reflectedUnsignedIntegr
alAttrAttrGetterCallback, TestObjV8Internal::reflectedUnsignedIntegralAttrAttrSe
tterCallback, 0, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT)
, static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | |
4031 // Attribute 'reflectedBooleanAttr' (Type: 'attribute' ExtAttr: 'Reflect') | |
4032 {"reflectedBooleanAttr", TestObjV8Internal::reflectedBooleanAttrAttrGetterCa
llback, TestObjV8Internal::reflectedBooleanAttrAttrSetterCallback, 0, 0, 0 /* no
data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyA
ttribute>(v8::None), 0 /* on instance */}, | |
4033 // Attribute 'reflectedURLAttr' (Type: 'attribute' ExtAttr: 'URL Reflect') | |
4034 {"reflectedURLAttr", TestObjV8Internal::reflectedURLAttrAttrGetterCallback,
TestObjV8Internal::reflectedURLAttrAttrSetterCallback, 0, 0, 0 /* no data */, st
atic_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8
::None), 0 /* on instance */}, | |
4035 // Attribute 'reflectedStringAttr' (Type: 'attribute' ExtAttr: 'Reflect') | |
4036 {"reflectedStringAttr", TestObjV8Internal::reflectedStringAttrAttrGetterCall
back, TestObjV8Internal::reflectedStringAttrAttrSetterCallback, 0, 0, 0 /* no da
ta */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttr
ibute>(v8::None), 0 /* on instance */}, | |
4037 // Attribute 'reflectedCustomIntegralAttr' (Type: 'attribute' ExtAttr: 'Refl
ect') | |
4038 {"reflectedCustomIntegralAttr", TestObjV8Internal::reflectedCustomIntegralAt
trAttrGetterCallback, TestObjV8Internal::reflectedCustomIntegralAttrAttrSetterCa
llback, 0, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), stat
ic_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | |
4039 // Attribute 'reflectedCustomBooleanAttr' (Type: 'attribute' ExtAttr: 'Refle
ct') | |
4040 {"reflectedCustomBooleanAttr", TestObjV8Internal::reflectedCustomBooleanAttr
AttrGetterCallback, TestObjV8Internal::reflectedCustomBooleanAttrAttrSetterCallb
ack, 0, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_
cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | |
4041 // Attribute 'reflectedCustomURLAttr' (Type: 'attribute' ExtAttr: 'URL Refle
ct') | |
4042 {"reflectedCustomURLAttr", TestObjV8Internal::reflectedCustomURLAttrAttrGett
erCallback, TestObjV8Internal::reflectedCustomURLAttrAttrSetterCallback, 0, 0, 0
/* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Pro
pertyAttribute>(v8::None), 0 /* on instance */}, | |
4043 // Attribute 'typedArrayAttr' (Type: 'attribute' ExtAttr: '') | |
4044 {"typedArrayAttr", TestObjV8Internal::typedArrayAttrAttrGetterCallback, Test
ObjV8Internal::typedArrayAttrAttrSetterCallback, 0, 0, 0 /* no data */, static_c
ast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None
), 0 /* on instance */}, | |
4045 // Attribute 'attrWithGetterException' (Type: 'attribute' ExtAttr: 'GetterRa
isesException') | |
4046 {"attrWithGetterException", TestObjV8Internal::attrWithGetterExceptionAttrGe
tterCallback, TestObjV8Internal::attrWithGetterExceptionAttrSetterCallback, 0, 0
, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::
PropertyAttribute>(v8::None), 0 /* on instance */}, | |
4047 // Attribute 'attrWithSetterException' (Type: 'attribute' ExtAttr: 'SetterRa
isesException') | |
4048 {"attrWithSetterException", TestObjV8Internal::attrWithSetterExceptionAttrGe
tterCallback, TestObjV8Internal::attrWithSetterExceptionAttrSetterCallback, 0, 0
, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::
PropertyAttribute>(v8::None), 0 /* on instance */}, | |
4049 // Attribute 'stringAttrWithGetterException' (Type: 'attribute' ExtAttr: 'Ge
tterRaisesException') | |
4050 {"stringAttrWithGetterException", TestObjV8Internal::stringAttrWithGetterExc
eptionAttrGetterCallback, TestObjV8Internal::stringAttrWithGetterExceptionAttrSe
tterCallback, 0, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT)
, static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | |
4051 // Attribute 'stringAttrWithSetterException' (Type: 'attribute' ExtAttr: 'Se
tterRaisesException') | |
4052 {"stringAttrWithSetterException", TestObjV8Internal::stringAttrWithSetterExc
eptionAttrGetterCallback, TestObjV8Internal::stringAttrWithSetterExceptionAttrSe
tterCallback, 0, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT)
, static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | |
4053 // Attribute 'customAttr' (Type: 'attribute' ExtAttr: 'Custom') | |
4054 {"customAttr", TestObjV8Internal::customAttrAttrGetterCallback, TestObjV8Int
ernal::customAttrAttrSetterCallback, 0, 0, 0 /* no data */, static_cast<v8::Acce
ssControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on i
nstance */}, | |
4055 // Attribute 'withScriptStateAttribute' (Type: 'attribute' ExtAttr: 'CallWit
h') | |
4056 {"withScriptStateAttribute", TestObjV8Internal::withScriptStateAttributeAttr
GetterCallback, TestObjV8Internal::withScriptStateAttributeAttrSetterCallback, 0
, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v
8::PropertyAttribute>(v8::None), 0 /* on instance */}, | |
4057 // Attribute 'withScriptExecutionContextAttribute' (Type: 'attribute' ExtAtt
r: 'CallWith') | |
4058 {"withScriptExecutionContextAttribute", TestObjV8Internal::withScriptExecuti
onContextAttributeAttrGetterCallback, TestObjV8Internal::withScriptExecutionCont
extAttributeAttrSetterCallback, 0, 0, 0 /* no data */, static_cast<v8::AccessCon
trol>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instan
ce */}, | |
4059 // Attribute 'withScriptStateAttributeRaises' (Type: 'attribute' ExtAttr: 'G
etterRaisesException CallWith') | |
4060 {"withScriptStateAttributeRaises", TestObjV8Internal::withScriptStateAttribu
teRaisesAttrGetterCallback, TestObjV8Internal::withScriptStateAttributeRaisesAtt
rSetterCallback, 0, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAU
LT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | |
4061 // Attribute 'withScriptExecutionContextAttributeRaises' (Type: 'attribute'
ExtAttr: 'GetterRaisesException CallWith') | |
4062 {"withScriptExecutionContextAttributeRaises", TestObjV8Internal::withScriptE
xecutionContextAttributeRaisesAttrGetterCallback, TestObjV8Internal::withScriptE
xecutionContextAttributeRaisesAttrSetterCallback, 0, 0, 0 /* no data */, static_
cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::Non
e), 0 /* on instance */}, | |
4063 // Attribute 'withScriptExecutionContextAndScriptStateAttribute' (Type: 'att
ribute' ExtAttr: 'CallWith') | |
4064 {"withScriptExecutionContextAndScriptStateAttribute", TestObjV8Internal::wit
hScriptExecutionContextAndScriptStateAttributeAttrGetterCallback, TestObjV8Inter
nal::withScriptExecutionContextAndScriptStateAttributeAttrSetterCallback, 0, 0,
0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Pr
opertyAttribute>(v8::None), 0 /* on instance */}, | |
4065 // Attribute 'withScriptExecutionContextAndScriptStateAttributeRaises' (Type
: 'attribute' ExtAttr: 'GetterRaisesException CallWith') | |
4066 {"withScriptExecutionContextAndScriptStateAttributeRaises", TestObjV8Interna
l::withScriptExecutionContextAndScriptStateAttributeRaisesAttrGetterCallback, Te
stObjV8Internal::withScriptExecutionContextAndScriptStateAttributeRaisesAttrSett
erCallback, 0, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT),
static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | |
4067 // Attribute 'withScriptExecutionContextAndScriptStateWithSpacesAttribute' (
Type: 'attribute' ExtAttr: 'CallWith') | |
4068 {"withScriptExecutionContextAndScriptStateWithSpacesAttribute", TestObjV8Int
ernal::withScriptExecutionContextAndScriptStateWithSpacesAttributeAttrGetterCall
back, TestObjV8Internal::withScriptExecutionContextAndScriptStateWithSpacesAttri
buteAttrSetterCallback, 0, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8
::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | |
4069 // Attribute 'enforcedRangeLongAttr' (Type: 'attribute' ExtAttr: 'EnforceRan
ge') | |
4070 {"enforcedRangeLongAttr", TestObjV8Internal::enforcedRangeLongAttrAttrGetter
Callback, TestObjV8Internal::enforcedRangeLongAttrAttrSetterCallback, 0, 0, 0 /*
no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Proper
tyAttribute>(v8::None), 0 /* on instance */}, | |
4071 // Attribute 'enforcedRangeUnsignedLongAttr' (Type: 'attribute' ExtAttr: 'En
forceRange') | |
4072 {"enforcedRangeUnsignedLongAttr", TestObjV8Internal::enforcedRangeUnsignedLo
ngAttrAttrGetterCallback, TestObjV8Internal::enforcedRangeUnsignedLongAttrAttrSe
tterCallback, 0, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT)
, static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | |
4073 // Attribute 'enforcedRangeLongLongAttr' (Type: 'attribute' ExtAttr: 'Enforc
eRange') | |
4074 {"enforcedRangeLongLongAttr", TestObjV8Internal::enforcedRangeLongLongAttrAt
trGetterCallback, TestObjV8Internal::enforcedRangeLongLongAttrAttrSetterCallback
, 0, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cas
t<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | |
4075 // Attribute 'enforcedRangeUnsignedLongLongAttr' (Type: 'attribute' ExtAttr:
'EnforceRange') | |
4076 {"enforcedRangeUnsignedLongLongAttr", TestObjV8Internal::enforcedRangeUnsign
edLongLongAttrAttrGetterCallback, TestObjV8Internal::enforcedRangeUnsignedLongLo
ngAttrAttrSetterCallback, 0, 0, 0 /* no data */, static_cast<v8::AccessControl>(
v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}
, | |
4077 #if ENABLE(Condition1) | |
4078 // Attribute 'conditionalAttr1' (Type: 'attribute' ExtAttr: 'Conditional') | |
4079 {"conditionalAttr1", TestObjV8Internal::conditionalAttr1AttrGetterCallback,
TestObjV8Internal::conditionalAttr1AttrSetterCallback, 0, 0, 0 /* no data */, st
atic_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8
::None), 0 /* on instance */}, | |
4080 #endif // ENABLE(Condition1) | |
4081 #if ENABLE(Condition1) && ENABLE(Condition2) | |
4082 // Attribute 'conditionalAttr2' (Type: 'attribute' ExtAttr: 'Conditional') | |
4083 {"conditionalAttr2", TestObjV8Internal::conditionalAttr2AttrGetterCallback,
TestObjV8Internal::conditionalAttr2AttrSetterCallback, 0, 0, 0 /* no data */, st
atic_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8
::None), 0 /* on instance */}, | |
4084 #endif // ENABLE(Condition1) && ENABLE(Condition2) | |
4085 #if ENABLE(Condition1) || ENABLE(Condition2) | |
4086 // Attribute 'conditionalAttr3' (Type: 'attribute' ExtAttr: 'Conditional') | |
4087 {"conditionalAttr3", TestObjV8Internal::conditionalAttr3AttrGetterCallback,
TestObjV8Internal::conditionalAttr3AttrSetterCallback, 0, 0, 0 /* no data */, st
atic_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8
::None), 0 /* on instance */}, | |
4088 #endif // ENABLE(Condition1) || ENABLE(Condition2) | |
4089 #if ENABLE(Condition1) | |
4090 // Attribute 'conditionalAttr4' (Type: 'attribute' ExtAttr: 'Conditional') | |
4091 {"conditionalAttr4", TestObjV8Internal::TestObjConstructorGetter, TestObjV8I
nternal::TestObjReplaceableAttrSetterCallback, 0, 0, &V8TestObjectA::info, stati
c_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::N
one | v8::DontEnum), 0 /* on instance */}, | |
4092 #endif // ENABLE(Condition1) | |
4093 #if ENABLE(Condition1) && ENABLE(Condition2) | |
4094 // Attribute 'conditionalAttr5' (Type: 'attribute' ExtAttr: 'Conditional') | |
4095 {"conditionalAttr5", TestObjV8Internal::TestObjConstructorGetter, TestObjV8I
nternal::TestObjReplaceableAttrSetterCallback, 0, 0, &V8TestObjectB::info, stati
c_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::N
one | v8::DontEnum), 0 /* on instance */}, | |
4096 #endif // ENABLE(Condition1) && ENABLE(Condition2) | |
4097 #if ENABLE(Condition1) || ENABLE(Condition2) | |
4098 // Attribute 'conditionalAttr6' (Type: 'attribute' ExtAttr: 'Conditional') | |
4099 {"conditionalAttr6", TestObjV8Internal::TestObjConstructorGetter, TestObjV8I
nternal::TestObjReplaceableAttrSetterCallback, 0, 0, &V8TestObjectC::info, stati
c_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::N
one | v8::DontEnum), 0 /* on instance */}, | |
4100 #endif // ENABLE(Condition1) || ENABLE(Condition2) | |
4101 // Attribute 'cachedAttribute1' (Type: 'attribute' ExtAttr: 'CachedAttribute
') | |
4102 {"cachedAttribute1", TestObjV8Internal::cachedAttribute1AttrGetterCallback,
0, 0, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_ca
st<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | |
4103 // Attribute 'cachedAttribute2' (Type: 'attribute' ExtAttr: 'CachedAttribute
') | |
4104 {"cachedAttribute2", TestObjV8Internal::cachedAttribute2AttrGetterCallback,
0, 0, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_ca
st<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | |
4105 // Attribute 'anyAttribute' (Type: 'attribute' ExtAttr: '') | |
4106 {"anyAttribute", TestObjV8Internal::anyAttributeAttrGetterCallback, TestObjV
8Internal::anyAttributeAttrSetterCallback, 0, 0, 0 /* no data */, static_cast<v8
::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /
* on instance */}, | |
4107 // Attribute 'floatArray' (Type: 'attribute' ExtAttr: '') | |
4108 {"floatArray", TestObjV8Internal::floatArrayAttrGetterCallback, TestObjV8Int
ernal::floatArrayAttrSetterCallback, 0, 0, 0 /* no data */, static_cast<v8::Acce
ssControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on i
nstance */}, | |
4109 // Attribute 'doubleArray' (Type: 'attribute' ExtAttr: '') | |
4110 {"doubleArray", TestObjV8Internal::doubleArrayAttrGetterCallback, TestObjV8I
nternal::doubleArrayAttrSetterCallback, 0, 0, 0 /* no data */, static_cast<v8::A
ccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* o
n instance */}, | |
4111 // Attribute 'contentDocument' (Type: 'attribute' ExtAttr: 'CheckSecurityFor
Node') | |
4112 {"contentDocument", TestObjV8Internal::contentDocumentAttrGetterCallback, 0,
0, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast
<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | |
4113 // Attribute 'mutablePoint' (Type: 'attribute' ExtAttr: '') | |
4114 {"mutablePoint", TestObjV8Internal::mutablePointAttrGetterCallback, TestObjV
8Internal::mutablePointAttrSetterCallback, 0, 0, 0 /* no data */, static_cast<v8
::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /
* on instance */}, | |
4115 // Attribute 'immutablePoint' (Type: 'attribute' ExtAttr: 'Immutable') | |
4116 {"immutablePoint", TestObjV8Internal::immutablePointAttrGetterCallback, Test
ObjV8Internal::immutablePointAttrSetterCallback, 0, 0, 0 /* no data */, static_c
ast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None
), 0 /* on instance */}, | |
4117 // Attribute 'strawberry' (Type: 'attribute' ExtAttr: 'ImplementedAs') | |
4118 {"strawberry", TestObjV8Internal::strawberryAttrGetterCallback, TestObjV8Int
ernal::strawberryAttrSetterCallback, 0, 0, 0 /* no data */, static_cast<v8::Acce
ssControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on i
nstance */}, | |
4119 // Attribute 'strictFloat' (Type: 'attribute' ExtAttr: 'StrictTypeChecking') | |
4120 {"strictFloat", TestObjV8Internal::strictFloatAttrGetterCallback, TestObjV8I
nternal::strictFloatAttrSetterCallback, 0, 0, 0 /* no data */, static_cast<v8::A
ccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* o
n instance */}, | |
4121 // Attribute 'description' (Type: 'attribute' ExtAttr: '') | |
4122 {"description", TestObjV8Internal::descriptionAttrGetterCallback, 0, 0, 0, 0
/* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Pro
pertyAttribute>(v8::None), 0 /* on instance */}, | |
4123 // Attribute 'id' (Type: 'attribute' ExtAttr: '') | |
4124 {"id", TestObjV8Internal::idAttrGetterCallback, TestObjV8Internal::idAttrSet
terCallback, 0, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT),
static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | |
4125 // Attribute 'hash' (Type: 'attribute' ExtAttr: '') | |
4126 {"hash", TestObjV8Internal::hashAttrGetterCallback, 0, 0, 0, 0 /* no data */
, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute
>(v8::None), 0 /* on instance */}, | |
4127 // Attribute 'replaceableAttribute' (Type: 'attribute' ExtAttr: 'Replaceable
') | |
4128 {"replaceableAttribute", TestObjV8Internal::replaceableAttributeAttrGetterCa
llback, TestObjV8Internal::TestObjReplaceableAttrSetterCallback, 0, 0, 0 /* no d
ata */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAtt
ribute>(v8::None), 0 /* on instance */}, | |
4129 // Attribute 'nullableDoubleAttribute' (Type: 'attribute' ExtAttr: '') | |
4130 {"nullableDoubleAttribute", TestObjV8Internal::nullableDoubleAttributeAttrGe
tterCallback, 0, 0, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAU
LT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | |
4131 // Attribute 'nullableLongAttribute' (Type: 'attribute' ExtAttr: '') | |
4132 {"nullableLongAttribute", TestObjV8Internal::nullableLongAttributeAttrGetter
Callback, 0, 0, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT),
static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | |
4133 // Attribute 'nullableBooleanAttribute' (Type: 'attribute' ExtAttr: '') | |
4134 {"nullableBooleanAttribute", TestObjV8Internal::nullableBooleanAttributeAttr
GetterCallback, 0, 0, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEF
AULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | |
4135 // Attribute 'nullableStringAttribute' (Type: 'attribute' ExtAttr: '') | |
4136 {"nullableStringAttribute", TestObjV8Internal::nullableStringAttributeAttrGe
tterCallback, 0, 0, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAU
LT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | |
4137 // Attribute 'nullableLongSettableAttribute' (Type: 'attribute' ExtAttr: '') | |
4138 {"nullableLongSettableAttribute", TestObjV8Internal::nullableLongSettableAtt
ributeAttrGetterCallback, TestObjV8Internal::nullableLongSettableAttributeAttrSe
tterCallback, 0, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT)
, static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | |
4139 // Attribute 'nullableStringValue' (Type: 'attribute' ExtAttr: 'GetterRaises
Exception') | |
4140 {"nullableStringValue", TestObjV8Internal::nullableStringValueAttrGetterCall
back, TestObjV8Internal::nullableStringValueAttrSetterCallback, 0, 0, 0 /* no da
ta */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttr
ibute>(v8::None), 0 /* on instance */}, | |
4141 // Attribute 'perWorldReadOnlyAttribute' (Type: 'attribute' ExtAttr: 'PerWor
ldBindings') | |
4142 {"perWorldReadOnlyAttribute", TestObjV8Internal::perWorldReadOnlyAttributeAt
trGetterCallback, 0, TestObjV8Internal::perWorldReadOnlyAttributeAttrGetterCallb
ackForMainWorld, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT)
, static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | |
4143 // Attribute 'perWorldAttribute' (Type: 'attribute' ExtAttr: 'PerWorldBindin
gs') | |
4144 {"perWorldAttribute", TestObjV8Internal::perWorldAttributeAttrGetterCallback
, TestObjV8Internal::perWorldAttributeAttrSetterCallback, TestObjV8Internal::per
WorldAttributeAttrGetterCallbackForMainWorld, TestObjV8Internal::perWorldAttribu
teAttrSetterCallbackForMainWorld, 0 /* no data */, static_cast<v8::AccessControl
>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance *
/}, | |
4145 // Attribute 'activityLoggedAttr1' (Type: 'attribute' ExtAttr: 'ActivityLog'
) | |
4146 {"activityLoggedAttr1", TestObjV8Internal::activityLoggedAttr1AttrGetterCall
back, TestObjV8Internal::activityLoggedAttr1AttrSetterCallback, 0, 0, 0 /* no da
ta */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttr
ibute>(v8::None), 0 /* on instance */}, | |
4147 // Attribute 'activityLoggedAttr2' (Type: 'attribute' ExtAttr: 'PerWorldBind
ings ActivityLog') | |
4148 {"activityLoggedAttr2", TestObjV8Internal::activityLoggedAttr2AttrGetterCall
back, TestObjV8Internal::activityLoggedAttr2AttrSetterCallback, TestObjV8Interna
l::activityLoggedAttr2AttrGetterCallbackForMainWorld, TestObjV8Internal::activit
yLoggedAttr2AttrSetterCallbackForMainWorld, 0 /* no data */, static_cast<v8::Acc
essControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on
instance */}, | |
4149 // Attribute 'activityLoggedInIsolatedWorldsAttr' (Type: 'attribute' ExtAttr
: 'PerWorldBindings ActivityLog') | |
4150 {"activityLoggedInIsolatedWorldsAttr", TestObjV8Internal::activityLoggedInIs
olatedWorldsAttrAttrGetterCallback, TestObjV8Internal::activityLoggedInIsolatedW
orldsAttrAttrSetterCallback, TestObjV8Internal::activityLoggedInIsolatedWorldsAt
trAttrGetterCallbackForMainWorld, TestObjV8Internal::activityLoggedInIsolatedWor
ldsAttrAttrSetterCallbackForMainWorld, 0 /* no data */, static_cast<v8::AccessCo
ntrol>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on insta
nce */}, | |
4151 // Attribute 'activityLoggedAttrSetter1' (Type: 'attribute' ExtAttr: 'Activi
tyLog') | |
4152 {"activityLoggedAttrSetter1", TestObjV8Internal::activityLoggedAttrSetter1At
trGetterCallback, TestObjV8Internal::activityLoggedAttrSetter1AttrSetterCallback
, 0, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cas
t<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | |
4153 // Attribute 'activityLoggedAttrSetter2' (Type: 'attribute' ExtAttr: 'PerWor
ldBindings ActivityLog') | |
4154 {"activityLoggedAttrSetter2", TestObjV8Internal::activityLoggedAttrSetter2At
trGetterCallback, TestObjV8Internal::activityLoggedAttrSetter2AttrSetterCallback
, TestObjV8Internal::activityLoggedAttrSetter2AttrGetterCallbackForMainWorld, Te
stObjV8Internal::activityLoggedAttrSetter2AttrSetterCallbackForMainWorld, 0 /* n
o data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Property
Attribute>(v8::None), 0 /* on instance */}, | |
4155 // Attribute 'activityLoggedInIsolatedWorldsAttrSetter' (Type: 'attribute' E
xtAttr: 'PerWorldBindings ActivityLog') | |
4156 {"activityLoggedInIsolatedWorldsAttrSetter", TestObjV8Internal::activityLogg
edInIsolatedWorldsAttrSetterAttrGetterCallback, TestObjV8Internal::activityLogge
dInIsolatedWorldsAttrSetterAttrSetterCallback, TestObjV8Internal::activityLogged
InIsolatedWorldsAttrSetterAttrGetterCallbackForMainWorld, TestObjV8Internal::act
ivityLoggedInIsolatedWorldsAttrSetterAttrSetterCallbackForMainWorld, 0 /* no dat
a */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttri
bute>(v8::None), 0 /* on instance */}, | |
4157 // Attribute 'activityLoggedAttrGetter1' (Type: 'attribute' ExtAttr: 'Activi
tyLog') | |
4158 {"activityLoggedAttrGetter1", TestObjV8Internal::activityLoggedAttrGetter1At
trGetterCallback, TestObjV8Internal::activityLoggedAttrGetter1AttrSetterCallback
, 0, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cas
t<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | |
4159 // Attribute 'activityLoggedAttrGetter2' (Type: 'attribute' ExtAttr: 'PerWor
ldBindings ActivityLog') | |
4160 {"activityLoggedAttrGetter2", TestObjV8Internal::activityLoggedAttrGetter2At
trGetterCallback, TestObjV8Internal::activityLoggedAttrGetter2AttrSetterCallback
, TestObjV8Internal::activityLoggedAttrGetter2AttrGetterCallbackForMainWorld, Te
stObjV8Internal::activityLoggedAttrGetter2AttrSetterCallbackForMainWorld, 0 /* n
o data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Property
Attribute>(v8::None), 0 /* on instance */}, | |
4161 // Attribute 'activityLoggedInIsolatedWorldsAttrGetter' (Type: 'attribute' E
xtAttr: 'PerWorldBindings ActivityLog') | |
4162 {"activityLoggedInIsolatedWorldsAttrGetter", TestObjV8Internal::activityLogg
edInIsolatedWorldsAttrGetterAttrGetterCallback, TestObjV8Internal::activityLogge
dInIsolatedWorldsAttrGetterAttrSetterCallback, TestObjV8Internal::activityLogged
InIsolatedWorldsAttrGetterAttrGetterCallbackForMainWorld, TestObjV8Internal::act
ivityLoggedInIsolatedWorldsAttrGetterAttrSetterCallbackForMainWorld, 0 /* no dat
a */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttri
bute>(v8::None), 0 /* on instance */}, | |
4163 // Attribute 'deprecatedStaticReadOnlyAttr' (Type: 'attribute' ExtAttr: 'Dep
recateAs') | |
4164 {"deprecatedStaticReadOnlyAttr", TestObjV8Internal::deprecatedStaticReadOnly
AttrAttrGetterCallback, 0, 0, 0, 0 /* no data */, static_cast<v8::AccessControl>
(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */
}, | |
4165 // Attribute 'deprecatedStaticAttr' (Type: 'attribute' ExtAttr: 'DeprecateAs
') | |
4166 {"deprecatedStaticAttr", TestObjV8Internal::deprecatedStaticAttrAttrGetterCa
llback, TestObjV8Internal::deprecatedStaticAttrAttrSetterCallback, 0, 0, 0 /* no
data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyA
ttribute>(v8::None), 0 /* on instance */}, | |
4167 // Attribute 'deprecatedReadonlyAttr' (Type: 'attribute' ExtAttr: 'Deprecate
As') | |
4168 {"deprecatedReadonlyAttr", TestObjV8Internal::deprecatedReadonlyAttrAttrGett
erCallback, 0, 0, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT
), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | |
4169 // Attribute 'deprecatedAttr' (Type: 'attribute' ExtAttr: 'DeprecateAs') | |
4170 {"deprecatedAttr", TestObjV8Internal::deprecatedAttrAttrGetterCallback, Test
ObjV8Internal::deprecatedAttrAttrSetterCallback, 0, 0, 0 /* no data */, static_c
ast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None
), 0 /* on instance */}, | |
4171 }; | |
4172 | |
4173 static const V8DOMConfiguration::BatchedMethod V8TestObjMethods[] = { | |
4174 {"voidMethod", TestObjV8Internal::voidMethodMethodCallback, 0, 0}, | |
4175 {"longMethod", TestObjV8Internal::longMethodMethodCallback, 0, 0}, | |
4176 {"objMethod", TestObjV8Internal::objMethodMethodCallback, 0, 0}, | |
4177 {"methodWithSequenceArg", TestObjV8Internal::methodWithSequenceArgMethodCall
back, 0, 1}, | |
4178 {"methodReturningSequence", TestObjV8Internal::methodReturningSequenceMethod
Callback, 0, 1}, | |
4179 {"methodWithEnumArg", TestObjV8Internal::methodWithEnumArgMethodCallback, 0,
1}, | |
4180 {"serializedValue", TestObjV8Internal::serializedValueMethodCallback, 0, 1}, | |
4181 {"optionsObject", TestObjV8Internal::optionsObjectMethodCallback, 0, 1}, | |
4182 {"methodWithException", TestObjV8Internal::methodWithExceptionMethodCallback
, 0, 0}, | |
4183 {"customMethod", TestObjV8Internal::customMethodMethodCallback, 0, 0}, | |
4184 {"customMethodWithArgs", TestObjV8Internal::customMethodWithArgsMethodCallba
ck, 0, 3}, | |
4185 {"addEventListener", TestObjV8Internal::addEventListenerMethodCallback, 0, 2
}, | |
4186 {"removeEventListener", TestObjV8Internal::removeEventListenerMethodCallback
, 0, 2}, | |
4187 {"withScriptStateVoid", TestObjV8Internal::withScriptStateVoidMethodCallback
, 0, 0}, | |
4188 {"withScriptStateObj", TestObjV8Internal::withScriptStateObjMethodCallback,
0, 0}, | |
4189 {"withScriptStateVoidException", TestObjV8Internal::withScriptStateVoidExcep
tionMethodCallback, 0, 0}, | |
4190 {"withScriptStateObjException", TestObjV8Internal::withScriptStateObjExcepti
onMethodCallback, 0, 0}, | |
4191 {"withScriptExecutionContext", TestObjV8Internal::withScriptExecutionContext
MethodCallback, 0, 0}, | |
4192 {"withScriptExecutionContextAndScriptState", TestObjV8Internal::withScriptEx
ecutionContextAndScriptStateMethodCallback, 0, 0}, | |
4193 {"withScriptExecutionContextAndScriptStateObjException", TestObjV8Internal::
withScriptExecutionContextAndScriptStateObjExceptionMethodCallback, 0, 0}, | |
4194 {"withScriptExecutionContextAndScriptStateWithSpaces", TestObjV8Internal::wi
thScriptExecutionContextAndScriptStateWithSpacesMethodCallback, 0, 0}, | |
4195 {"methodWithOptionalArg", TestObjV8Internal::methodWithOptionalArgMethodCall
back, 0, 0}, | |
4196 {"methodWithNonOptionalArgAndOptionalArg", TestObjV8Internal::methodWithNonO
ptionalArgAndOptionalArgMethodCallback, 0, 1}, | |
4197 {"methodWithNonOptionalArgAndTwoOptionalArgs", TestObjV8Internal::methodWith
NonOptionalArgAndTwoOptionalArgsMethodCallback, 0, 1}, | |
4198 {"methodWithOptionalString", TestObjV8Internal::methodWithOptionalStringMeth
odCallback, 0, 0}, | |
4199 {"methodWithOptionalStringIsUndefined", TestObjV8Internal::methodWithOptiona
lStringIsUndefinedMethodCallback, 0, 0}, | |
4200 {"methodWithOptionalStringIsNullString", TestObjV8Internal::methodWithOption
alStringIsNullStringMethodCallback, 0, 0}, | |
4201 {"methodWithCallbackArg", TestObjV8Internal::methodWithCallbackArgMethodCall
back, 0, 1}, | |
4202 {"methodWithNonCallbackArgAndCallbackArg", TestObjV8Internal::methodWithNonC
allbackArgAndCallbackArgMethodCallback, 0, 2}, | |
4203 {"methodWithCallbackAndOptionalArg", TestObjV8Internal::methodWithCallbackAn
dOptionalArgMethodCallback, 0, 0}, | |
4204 {"methodWithEnforceRangeInt32", TestObjV8Internal::methodWithEnforceRangeInt
32MethodCallback, 0, 1}, | |
4205 {"methodWithEnforceRangeUInt32", TestObjV8Internal::methodWithEnforceRangeUI
nt32MethodCallback, 0, 1}, | |
4206 {"methodWithEnforceRangeInt64", TestObjV8Internal::methodWithEnforceRangeInt
64MethodCallback, 0, 1}, | |
4207 {"methodWithEnforceRangeUInt64", TestObjV8Internal::methodWithEnforceRangeUI
nt64MethodCallback, 0, 1}, | |
4208 #if ENABLE(Condition1) | |
4209 {"conditionalMethod1", TestObjV8Internal::conditionalMethod1MethodCallback,
0, 0}, | |
4210 #endif | |
4211 #if ENABLE(Condition1) && ENABLE(Condition2) | |
4212 {"conditionalMethod2", TestObjV8Internal::conditionalMethod2MethodCallback,
0, 0}, | |
4213 #endif | |
4214 #if ENABLE(Condition1) || ENABLE(Condition2) | |
4215 {"conditionalMethod3", TestObjV8Internal::conditionalMethod3MethodCallback,
0, 0}, | |
4216 #endif | |
4217 {"overloadedMethod", TestObjV8Internal::overloadedMethodMethodCallback, 0, 2
}, | |
4218 {"classMethodWithClamp", TestObjV8Internal::classMethodWithClampMethodCallba
ck, 0, 2}, | |
4219 {"methodWithUnsignedLongSequence", TestObjV8Internal::methodWithUnsignedLong
SequenceMethodCallback, 0, 1}, | |
4220 {"stringArrayFunction", TestObjV8Internal::stringArrayFunctionMethodCallback
, 0, 1}, | |
4221 {"getSVGDocument", TestObjV8Internal::getSVGDocumentMethodCallback, 0, 0}, | |
4222 {"mutablePointFunction", TestObjV8Internal::mutablePointFunctionMethodCallba
ck, 0, 0}, | |
4223 {"immutablePointFunction", TestObjV8Internal::immutablePointFunctionMethodCa
llback, 0, 0}, | |
4224 {"orange", TestObjV8Internal::orangeMethodCallback, 0, 0}, | |
4225 {"strictFunction", TestObjV8Internal::strictFunctionMethodCallback, 0, 3}, | |
4226 {"variadicStringMethod", TestObjV8Internal::variadicStringMethodMethodCallba
ck, 0, 2}, | |
4227 {"variadicDoubleMethod", TestObjV8Internal::variadicDoubleMethodMethodCallba
ck, 0, 2}, | |
4228 {"perWorldMethod", TestObjV8Internal::perWorldMethodMethodCallback, TestObjV
8Internal::perWorldMethodMethodCallbackForMainWorld, 0}, | |
4229 {"overloadedPerWorldMethod", TestObjV8Internal::overloadedPerWorldMethodMeth
odCallback, TestObjV8Internal::overloadedPerWorldMethodMethodCallbackForMainWorl
d, 1}, | |
4230 {"activityLoggedMethod1", TestObjV8Internal::activityLoggedMethod1MethodCall
back, 0, 1}, | |
4231 {"activityLoggedMethod2", TestObjV8Internal::activityLoggedMethod2MethodCall
back, TestObjV8Internal::activityLoggedMethod2MethodCallbackForMainWorld, 1}, | |
4232 {"activityLoggedInIsolatedWorldMethod", TestObjV8Internal::activityLoggedInI
solatedWorldMethodMethodCallback, TestObjV8Internal::activityLoggedInIsolatedWor
ldMethodMethodCallbackForMainWorld, 1}, | |
4233 {"overloadedActivityLoggedMethod", TestObjV8Internal::overloadedActivityLogg
edMethodMethodCallback, TestObjV8Internal::overloadedActivityLoggedMethodMethodC
allbackForMainWorld, 1}, | |
4234 {"deprecatedMethod", TestObjV8Internal::deprecatedMethodMethodCallback, 0, 0
}, | |
4235 }; | |
4236 | |
4237 static const V8DOMConfiguration::BatchedConstant V8TestObjConsts[] = { | |
4238 #if ENABLE(Condition1) | |
4239 {"CONDITIONAL_CONST", 0}, | |
4240 #endif | |
4241 {"CONST_VALUE_0", 0}, | |
4242 {"CONST_VALUE_1", 1}, | |
4243 {"CONST_VALUE_2", 2}, | |
4244 {"CONST_VALUE_4", 4}, | |
4245 {"CONST_VALUE_8", 8}, | |
4246 {"CONST_VALUE_9", -1}, | |
4247 {"CONST_VALUE_10", "my constant string"}, | |
4248 {"CONST_VALUE_11", -1}, | |
4249 {"CONST_VALUE_12", 1}, | |
4250 {"CONST_VALUE_13", 0X20}, | |
4251 {"CONST_VALUE_14", 6844}, | |
4252 {"CONST_JAVASCRIPT", 15}, | |
4253 {"DEPRECATED_CONSTANT", 1}, | |
4254 }; | |
4255 | |
4256 | |
4257 #if ENABLE(Condition1) | |
4258 COMPILE_ASSERT(0 == TestObj::CONDITIONAL_CONST, TestObjEnumCONDITIONAL_CONSTIsWr
ongUseDoNotCheckConstants); | |
4259 #endif | |
4260 COMPILE_ASSERT(0 == TestObj::CONST_VALUE_0, TestObjEnumCONST_VALUE_0IsWrongUseDo
NotCheckConstants); | |
4261 COMPILE_ASSERT(1 == TestObj::CONST_VALUE_1, TestObjEnumCONST_VALUE_1IsWrongUseDo
NotCheckConstants); | |
4262 COMPILE_ASSERT(2 == TestObj::CONST_VALUE_2, TestObjEnumCONST_VALUE_2IsWrongUseDo
NotCheckConstants); | |
4263 COMPILE_ASSERT(4 == TestObj::CONST_VALUE_4, TestObjEnumCONST_VALUE_4IsWrongUseDo
NotCheckConstants); | |
4264 COMPILE_ASSERT(8 == TestObj::CONST_VALUE_8, TestObjEnumCONST_VALUE_8IsWrongUseDo
NotCheckConstants); | |
4265 COMPILE_ASSERT(-1 == TestObj::CONST_VALUE_9, TestObjEnumCONST_VALUE_9IsWrongUseD
oNotCheckConstants); | |
4266 COMPILE_ASSERT("my constant string" == TestObj::CONST_VALUE_10, TestObjEnumCONST
_VALUE_10IsWrongUseDoNotCheckConstants); | |
4267 COMPILE_ASSERT(0xffffffff == TestObj::CONST_VALUE_11, TestObjEnumCONST_VALUE_11I
sWrongUseDoNotCheckConstants); | |
4268 COMPILE_ASSERT(0x01 == TestObj::CONST_VALUE_12, TestObjEnumCONST_VALUE_12IsWrong
UseDoNotCheckConstants); | |
4269 COMPILE_ASSERT(0X20 == TestObj::CONST_VALUE_13, TestObjEnumCONST_VALUE_13IsWrong
UseDoNotCheckConstants); | |
4270 COMPILE_ASSERT(0x1abc == TestObj::CONST_VALUE_14, TestObjEnumCONST_VALUE_14IsWro
ngUseDoNotCheckConstants); | |
4271 COMPILE_ASSERT(15 == TestObj::CONST_IMPL, TestObjEnumCONST_IMPLIsWrongUseDoNotCh
eckConstants); | |
4272 COMPILE_ASSERT(1 == TestObj::DEPRECATED_CONSTANT, TestObjEnumDEPRECATED_CONSTANT
IsWrongUseDoNotCheckConstants); | |
4273 | |
4274 v8::Handle<v8::Value> V8TestObj::constructorCallback(const v8::Arguments& args) | |
4275 { | |
4276 if (!args.IsConstructCall()) | |
4277 return throwTypeError("DOM object constructor cannot be called as a func
tion.", args.GetIsolate()); | |
4278 | |
4279 if (ConstructorMode::current() == ConstructorMode::WrapExistingObject) | |
4280 return args.Holder(); | |
4281 | |
4282 return TestObjV8Internal::constructor(args); | |
4283 } | |
4284 | |
4285 v8::Handle<v8::Value> V8TestObj::indexedPropertyGetter(uint32_t index, const v8:
:AccessorInfo& info) | |
4286 { | |
4287 ASSERT(V8DOMWrapper::maybeDOMWrapper(info.Holder())); | |
4288 TestObj* collection = toNative(info.Holder()); | |
4289 RefPtr<Node> element = collection->item(index); | |
4290 if (!element) | |
4291 return v8Undefined(); | |
4292 return toV8Fast(element.release(), info, collection); | |
4293 } | |
4294 static v8::Persistent<v8::FunctionTemplate> ConfigureV8TestObjTemplate(v8::Persi
stent<v8::FunctionTemplate> desc, v8::Isolate* isolate, WrapperWorldType current
WorldType) | |
4295 { | |
4296 desc->ReadOnlyPrototype(); | |
4297 | |
4298 v8::Local<v8::Signature> defaultSignature; | |
4299 defaultSignature = V8DOMConfiguration::configureTemplate(desc, "TestObject",
v8::Persistent<v8::FunctionTemplate>(), V8TestObj::internalFieldCount, | |
4300 V8TestObjAttrs, WTF_ARRAY_LENGTH(V8TestObjAttrs), | |
4301 V8TestObjMethods, WTF_ARRAY_LENGTH(V8TestObjMethods), isolate, currentWo
rldType); | |
4302 UNUSED_PARAM(defaultSignature); // In some cases, it will not be used. | |
4303 desc->SetCallHandler(V8TestObj::constructorCallback); | |
4304 desc->SetLength(1); | |
4305 v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate(); | |
4306 v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate(); | |
4307 UNUSED_PARAM(instance); // In some cases, it will not be used. | |
4308 UNUSED_PARAM(proto); // In some cases, it will not be used. | |
4309 if (RuntimeEnabledFeatures::enabledAtRuntimeAttr1Enabled()) { | |
4310 static const V8DOMConfiguration::BatchedAttribute attrData =\ | |
4311 // Attribute 'enabledAtRuntimeAttr1' (Type: 'attribute' ExtAttr: 'Enable
dAtRuntime') | |
4312 {"enabledAtRuntimeAttr1", TestObjV8Internal::enabledAtRuntimeAttr1AttrGe
tterCallback, TestObjV8Internal::enabledAtRuntimeAttr1AttrSetterCallback, 0, 0,
0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Pr
opertyAttribute>(v8::None), 0 /* on instance */}; | |
4313 V8DOMConfiguration::configureAttribute(instance, proto, attrData, isolat
e, currentWorldType); | |
4314 } | |
4315 if (RuntimeEnabledFeatures::featureNameEnabled()) { | |
4316 static const V8DOMConfiguration::BatchedAttribute attrData =\ | |
4317 // Attribute 'enabledAtRuntimeAttr2' (Type: 'attribute' ExtAttr: 'Enable
dAtRuntime') | |
4318 {"enabledAtRuntimeAttr2", TestObjV8Internal::enabledAtRuntimeAttr2AttrGe
tterCallback, TestObjV8Internal::enabledAtRuntimeAttr2AttrSetterCallback, 0, 0,
0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Pr
opertyAttribute>(v8::None), 0 /* on instance */}; | |
4319 V8DOMConfiguration::configureAttribute(instance, proto, attrData, isolat
e, currentWorldType); | |
4320 } | |
4321 desc->InstanceTemplate()->SetIndexedPropertyHandler(V8TestObj::indexedProper
tyGetter, 0, 0, 0, nodeCollectionIndexedPropertyEnumerator<TestObj>); | |
4322 | |
4323 // Custom Signature 'voidMethodWithArgs' | |
4324 const int voidMethodWithArgsArgc = 3; | |
4325 v8::Handle<v8::FunctionTemplate> voidMethodWithArgsArgv[voidMethodWithArgsAr
gc] = { v8::Handle<v8::FunctionTemplate>(), v8::Handle<v8::FunctionTemplate>(),
V8PerIsolateData::from(isolate)->rawTemplate(&V8TestObj::info, currentWorldType)
}; | |
4326 v8::Handle<v8::Signature> voidMethodWithArgsSignature = v8::Signature::New(d
esc, voidMethodWithArgsArgc, voidMethodWithArgsArgv); | |
4327 proto->Set(v8::String::NewSymbol("voidMethodWithArgs"), v8::FunctionTemplate
::New(TestObjV8Internal::voidMethodWithArgsMethodCallback, v8Undefined(), voidMe
thodWithArgsSignature, 3)); | |
4328 | |
4329 // Custom Signature 'longMethodWithArgs' | |
4330 const int longMethodWithArgsArgc = 3; | |
4331 v8::Handle<v8::FunctionTemplate> longMethodWithArgsArgv[longMethodWithArgsAr
gc] = { v8::Handle<v8::FunctionTemplate>(), v8::Handle<v8::FunctionTemplate>(),
V8PerIsolateData::from(isolate)->rawTemplate(&V8TestObj::info, currentWorldType)
}; | |
4332 v8::Handle<v8::Signature> longMethodWithArgsSignature = v8::Signature::New(d
esc, longMethodWithArgsArgc, longMethodWithArgsArgv); | |
4333 proto->Set(v8::String::NewSymbol("longMethodWithArgs"), v8::FunctionTemplate
::New(TestObjV8Internal::longMethodWithArgsMethodCallback, v8Undefined(), longMe
thodWithArgsSignature, 3)); | |
4334 | |
4335 // Custom Signature 'objMethodWithArgs' | |
4336 const int objMethodWithArgsArgc = 3; | |
4337 v8::Handle<v8::FunctionTemplate> objMethodWithArgsArgv[objMethodWithArgsArgc
] = { v8::Handle<v8::FunctionTemplate>(), v8::Handle<v8::FunctionTemplate>(), V8
PerIsolateData::from(isolate)->rawTemplate(&V8TestObj::info, currentWorldType) }
; | |
4338 v8::Handle<v8::Signature> objMethodWithArgsSignature = v8::Signature::New(de
sc, objMethodWithArgsArgc, objMethodWithArgsArgv); | |
4339 proto->Set(v8::String::NewSymbol("objMethodWithArgs"), v8::FunctionTemplate:
:New(TestObjV8Internal::objMethodWithArgsMethodCallback, v8Undefined(), objMetho
dWithArgsSignature, 3)); | |
4340 | |
4341 // Custom Signature 'methodThatRequiresAllArgsAndThrows' | |
4342 const int methodThatRequiresAllArgsAndThrowsArgc = 2; | |
4343 v8::Handle<v8::FunctionTemplate> methodThatRequiresAllArgsAndThrowsArgv[meth
odThatRequiresAllArgsAndThrowsArgc] = { v8::Handle<v8::FunctionTemplate>(), V8Pe
rIsolateData::from(isolate)->rawTemplate(&V8TestObj::info, currentWorldType) }; | |
4344 v8::Handle<v8::Signature> methodThatRequiresAllArgsAndThrowsSignature = v8::
Signature::New(desc, methodThatRequiresAllArgsAndThrowsArgc, methodThatRequiresA
llArgsAndThrowsArgv); | |
4345 proto->Set(v8::String::NewSymbol("methodThatRequiresAllArgsAndThrows"), v8::
FunctionTemplate::New(TestObjV8Internal::methodThatRequiresAllArgsAndThrowsMetho
dCallback, v8Undefined(), methodThatRequiresAllArgsAndThrowsSignature, 2)); | |
4346 desc->Set(v8::String::NewSymbol("staticMethodWithCallbackAndOptionalArg"), v
8::FunctionTemplate::New(TestObjV8Internal::staticMethodWithCallbackAndOptionalA
rgMethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 0)); | |
4347 desc->Set(v8::String::NewSymbol("staticMethodWithCallbackArg"), v8::Function
Template::New(TestObjV8Internal::staticMethodWithCallbackArgMethodCallback, v8Un
defined(), v8::Local<v8::Signature>(), 1)); | |
4348 desc->Set(v8::String::NewSymbol("classMethod"), v8::FunctionTemplate::New(Te
stObjV8Internal::classMethodMethodCallback, v8Undefined(), v8::Local<v8::Signatu
re>(), 0)); | |
4349 desc->Set(v8::String::NewSymbol("classMethodWithOptional"), v8::FunctionTemp
late::New(TestObjV8Internal::classMethodWithOptionalMethodCallback, v8Undefined(
), v8::Local<v8::Signature>(), 0)); | |
4350 desc->Set(v8::String::NewSymbol("classMethod2"), v8::FunctionTemplate::New(T
estObjV8Internal::classMethod2MethodCallback, v8Undefined(), v8::Local<v8::Signa
ture>(), 1)); | |
4351 #if ENABLE(Condition1) | |
4352 desc->Set(v8::String::NewSymbol("overloadedMethod1"), v8::FunctionTemplate::
New(TestObjV8Internal::overloadedMethod1MethodCallback, v8Undefined(), v8::Local
<v8::Signature>(), 1)); | |
4353 #endif // ENABLE(Condition1) | |
4354 if (RuntimeEnabledFeatures::enabledAtRuntimeMethod1Enabled()) | |
4355 proto->Set(v8::String::NewSymbol("enabledAtRuntimeMethod1"), v8::Functio
nTemplate::New(TestObjV8Internal::enabledAtRuntimeMethod1MethodCallback, v8Undef
ined(), defaultSignature, 1)); | |
4356 if (RuntimeEnabledFeatures::featureNameEnabled()) | |
4357 proto->Set(v8::String::NewSymbol("enabledAtRuntimeMethod2"), v8::Functio
nTemplate::New(TestObjV8Internal::enabledAtRuntimeMethod2MethodCallback, v8Undef
ined(), defaultSignature, 1)); | |
4358 | |
4359 // Custom Signature 'domStringListFunction' | |
4360 const int domStringListFunctionArgc = 1; | |
4361 v8::Handle<v8::FunctionTemplate> domStringListFunctionArgv[domStringListFunc
tionArgc] = { V8PerIsolateData::from(isolate)->rawTemplate(&V8DOMStringList::inf
o, currentWorldType) }; | |
4362 v8::Handle<v8::Signature> domStringListFunctionSignature = v8::Signature::Ne
w(desc, domStringListFunctionArgc, domStringListFunctionArgv); | |
4363 proto->Set(v8::String::NewSymbol("domStringListFunction"), v8::FunctionTempl
ate::New(TestObjV8Internal::domStringListFunctionMethodCallback, v8Undefined(),
domStringListFunctionSignature, 1)); | |
4364 | |
4365 // Custom Signature 'convert1' | |
4366 const int convert1Argc = 1; | |
4367 v8::Handle<v8::FunctionTemplate> convert1Argv[convert1Argc] = { V8PerIsolate
Data::from(isolate)->rawTemplate(&V8TestNode::info, currentWorldType) }; | |
4368 v8::Handle<v8::Signature> convert1Signature = v8::Signature::New(desc, conve
rt1Argc, convert1Argv); | |
4369 proto->Set(v8::String::NewSymbol("convert1"), v8::FunctionTemplate::New(Test
ObjV8Internal::convert1MethodCallback, v8Undefined(), convert1Signature, 1)); | |
4370 | |
4371 // Custom Signature 'convert2' | |
4372 const int convert2Argc = 1; | |
4373 v8::Handle<v8::FunctionTemplate> convert2Argv[convert2Argc] = { V8PerIsolate
Data::from(isolate)->rawTemplate(&V8TestNode::info, currentWorldType) }; | |
4374 v8::Handle<v8::Signature> convert2Signature = v8::Signature::New(desc, conve
rt2Argc, convert2Argv); | |
4375 proto->Set(v8::String::NewSymbol("convert2"), v8::FunctionTemplate::New(Test
ObjV8Internal::convert2MethodCallback, v8Undefined(), convert2Signature, 1)); | |
4376 | |
4377 // Custom Signature 'convert4' | |
4378 const int convert4Argc = 1; | |
4379 v8::Handle<v8::FunctionTemplate> convert4Argv[convert4Argc] = { V8PerIsolate
Data::from(isolate)->rawTemplate(&V8TestNode::info, currentWorldType) }; | |
4380 v8::Handle<v8::Signature> convert4Signature = v8::Signature::New(desc, conve
rt4Argc, convert4Argv); | |
4381 proto->Set(v8::String::NewSymbol("convert4"), v8::FunctionTemplate::New(Test
ObjV8Internal::convert4MethodCallback, v8Undefined(), convert4Signature, 1)); | |
4382 | |
4383 // Custom Signature 'convert5' | |
4384 const int convert5Argc = 1; | |
4385 v8::Handle<v8::FunctionTemplate> convert5Argv[convert5Argc] = { V8PerIsolate
Data::from(isolate)->rawTemplate(&V8TestNode::info, currentWorldType) }; | |
4386 v8::Handle<v8::Signature> convert5Signature = v8::Signature::New(desc, conve
rt5Argc, convert5Argv); | |
4387 proto->Set(v8::String::NewSymbol("convert5"), v8::FunctionTemplate::New(Test
ObjV8Internal::convert5MethodCallback, v8Undefined(), convert5Signature, 1)); | |
4388 | |
4389 // Custom Signature 'variadicNodeMethod' | |
4390 const int variadicNodeMethodArgc = 2; | |
4391 v8::Handle<v8::FunctionTemplate> variadicNodeMethodArgv[variadicNodeMethodAr
gc] = { V8PerIsolateData::from(isolate)->rawTemplate(&V8Node::info, currentWorld
Type), V8PerIsolateData::from(isolate)->rawTemplate(&V8Node::info, currentWorldT
ype) }; | |
4392 v8::Handle<v8::Signature> variadicNodeMethodSignature = v8::Signature::New(d
esc, variadicNodeMethodArgc, variadicNodeMethodArgv); | |
4393 proto->Set(v8::String::NewSymbol("variadicNodeMethod"), v8::FunctionTemplate
::New(TestObjV8Internal::variadicNodeMethodMethodCallback, v8Undefined(), variad
icNodeMethodSignature, 2)); | |
4394 desc->Set(v8::String::NewSymbol("deprecatedStaticMethod"), v8::FunctionTempl
ate::New(TestObjV8Internal::deprecatedStaticMethodMethodCallback, v8Undefined(),
v8::Local<v8::Signature>(), 0)); | |
4395 V8DOMConfiguration::batchConfigureConstants(desc, proto, V8TestObjConsts, WT
F_ARRAY_LENGTH(V8TestObjConsts), isolate); | |
4396 | |
4397 // Custom toString template | |
4398 desc->Set(v8::String::NewSymbol("toString"), V8PerIsolateData::current()->to
StringTemplate()); | |
4399 return desc; | |
4400 } | |
4401 | |
4402 v8::Persistent<v8::FunctionTemplate> V8TestObj::GetTemplate(v8::Isolate* isolate
, WrapperWorldType currentWorldType) | |
4403 { | |
4404 V8PerIsolateData* data = V8PerIsolateData::from(isolate); | |
4405 V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWo
rldType).find(&info); | |
4406 if (result != data->templateMap(currentWorldType).end()) | |
4407 return result->value; | |
4408 | |
4409 v8::HandleScope handleScope; | |
4410 v8::Persistent<v8::FunctionTemplate> templ = | |
4411 ConfigureV8TestObjTemplate(data->rawTemplate(&info, currentWorldType), i
solate, currentWorldType); | |
4412 data->templateMap(currentWorldType).add(&info, templ); | |
4413 return templ; | |
4414 } | |
4415 | |
4416 bool V8TestObj::HasInstance(v8::Handle<v8::Value> value, v8::Isolate* isolate, W
rapperWorldType currentWorldType) | |
4417 { | |
4418 return V8PerIsolateData::from(isolate)->hasInstance(&info, value, currentWor
ldType); | |
4419 } | |
4420 | |
4421 bool V8TestObj::HasInstanceInAnyWorld(v8::Handle<v8::Value> value, v8::Isolate*
isolate) | |
4422 { | |
4423 return V8PerIsolateData::from(isolate)->hasInstance(&info, value, MainWorld) | |
4424 || V8PerIsolateData::from(isolate)->hasInstance(&info, value, IsolatedWo
rld) | |
4425 || V8PerIsolateData::from(isolate)->hasInstance(&info, value, WorkerWorl
d); | |
4426 } | |
4427 | |
4428 void V8TestObj::installPerContextProperties(v8::Handle<v8::Object> instance, Tes
tObj* impl, v8::Isolate* isolate) | |
4429 { | |
4430 v8::Local<v8::Object> proto = v8::Local<v8::Object>::Cast(instance->GetProto
type()); | |
4431 if (ContextFeatures::enabledPerContextAttr1Enabled(impl->document())) { | |
4432 static const V8DOMConfiguration::BatchedAttribute attrData =\ | |
4433 // Attribute 'enabledPerContextAttr1' (Type: 'attribute' ExtAttr: 'Enabl
edPerContext') | |
4434 {"enabledPerContextAttr1", TestObjV8Internal::enabledPerContextAttr1Attr
GetterCallback, TestObjV8Internal::enabledPerContextAttr1AttrSetterCallback, 0,
0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8:
:PropertyAttribute>(v8::None), 0 /* on instance */}; | |
4435 V8DOMConfiguration::configureAttribute(instance, proto, attrData, isolat
e); | |
4436 } | |
4437 if (ContextFeatures::featureNameEnabled(impl->document())) { | |
4438 static const V8DOMConfiguration::BatchedAttribute attrData =\ | |
4439 // Attribute 'enabledPerContextAttr2' (Type: 'attribute' ExtAttr: 'Enabl
edPerContext') | |
4440 {"enabledPerContextAttr2", TestObjV8Internal::enabledPerContextAttr2Attr
GetterCallback, TestObjV8Internal::enabledPerContextAttr2AttrSetterCallback, 0,
0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8:
:PropertyAttribute>(v8::None), 0 /* on instance */}; | |
4441 V8DOMConfiguration::configureAttribute(instance, proto, attrData, isolat
e); | |
4442 } | |
4443 } | |
4444 | |
4445 void V8TestObj::installPerContextPrototypeProperties(v8::Handle<v8::Object> prot
o, v8::Isolate* isolate) | |
4446 { | |
4447 UNUSED_PARAM(proto); | |
4448 v8::Local<v8::Signature> defaultSignature = v8::Signature::New(GetTemplate(i
solate, worldType(isolate))); | |
4449 UNUSED_PARAM(defaultSignature); // In some cases, it will not be used. | |
4450 | |
4451 ScriptExecutionContext* context = toScriptExecutionContext(proto->CreationCo
ntext()); | |
4452 if (context && context->isDocument() && ContextFeatures::enabledPerContextMe
thod1Enabled(toDocument(context))) { | |
4453 proto->Set(v8::String::NewSymbol("enabledPerContextMethod1"), v8::Functi
onTemplate::New(TestObjV8Internal::enabledPerContextMethod1MethodCallback, v8Und
efined(), defaultSignature, 1)->GetFunction()); | |
4454 } | |
4455 if (context && context->isDocument() && ContextFeatures::featureNameEnabled(
toDocument(context))) { | |
4456 proto->Set(v8::String::NewSymbol("enabledPerContextMethod2"), v8::Functi
onTemplate::New(TestObjV8Internal::enabledPerContextMethod2MethodCallback, v8Und
efined(), defaultSignature, 1)->GetFunction()); | |
4457 } | |
4458 } | |
4459 | |
4460 | |
4461 v8::Handle<v8::Object> V8TestObj::createWrapper(PassRefPtr<TestObj> impl, v8::Ha
ndle<v8::Object> creationContext, v8::Isolate* isolate) | |
4462 { | |
4463 ASSERT(impl.get()); | |
4464 ASSERT(DOMDataStore::getWrapper(impl.get(), isolate).IsEmpty()); | |
4465 | |
4466 #if ENABLE(BINDING_INTEGRITY) | |
4467 checkTypeOrDieTrying(impl.get()); | |
4468 #endif | |
4469 | |
4470 v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext
, &info, impl.get(), isolate); | |
4471 if (UNLIKELY(wrapper.IsEmpty())) | |
4472 return wrapper; | |
4473 | |
4474 installPerContextProperties(wrapper, impl.get(), isolate); | |
4475 V8DOMWrapper::associateObjectWithWrapper(impl, &info, wrapper, isolate, hasD
ependentLifetime ? WrapperConfiguration::Dependent : WrapperConfiguration::Indep
endent); | |
4476 return wrapper; | |
4477 } | |
4478 void V8TestObj::derefObject(void* object) | |
4479 { | |
4480 static_cast<TestObj*>(object)->deref(); | |
4481 } | |
4482 | |
4483 } // namespace WebCore | |
OLD | NEW |