| OLD | NEW |
| (Empty) |
| 1 /* | |
| 2 This file is part of the WebKit open source project. | |
| 3 This file has been generated by generate-bindings.pl. DO NOT MODIFY! | |
| 4 | |
| 5 This library is free software; you can redistribute it and/or | |
| 6 modify it under the terms of the GNU Library General Public | |
| 7 License as published by the Free Software Foundation; either | |
| 8 version 2 of the License, or (at your option) any later version. | |
| 9 | |
| 10 This library is distributed in the hope that it will be useful, | |
| 11 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 Library General Public License for more details. | |
| 14 | |
| 15 You should have received a copy of the GNU Library General Public License | |
| 16 along with this library; see the file COPYING.LIB. If not, write to | |
| 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
| 18 Boston, MA 02111-1307, USA. | |
| 19 */ | |
| 20 | |
| 21 #include "config.h" | |
| 22 #include "V8TestObj.h" | |
| 23 | |
| 24 #include "BindingState.h" | |
| 25 #include "ContextFeatures.h" | |
| 26 #include "DOMStringList.h" | |
| 27 #include "Dictionary.h" | |
| 28 #include "ExceptionCode.h" | |
| 29 #include "FeatureObserver.h" | |
| 30 #include "Frame.h" | |
| 31 #include "HTMLNames.h" | |
| 32 #include "RuntimeEnabledFeatures.h" | |
| 33 #include "SVGPropertyTearOff.h" | |
| 34 #include "SVGStaticPropertyTearOff.h" | |
| 35 #include "ScriptArguments.h" | |
| 36 #include "ScriptCallStackFactory.h" | |
| 37 #include "ScriptProfile.h" | |
| 38 #include "ScriptValue.h" | |
| 39 #include "SerializedScriptValue.h" | |
| 40 #include "V8Binding.h" | |
| 41 #include "V8DOMStringList.h" | |
| 42 #include "V8DOMWrapper.h" | |
| 43 #include "V8Document.h" | |
| 44 #include "V8EventListenerList.h" | |
| 45 #include "V8Float32Array.h" | |
| 46 #include "V8Node.h" | |
| 47 #include "V8SVGDocument.h" | |
| 48 #include "V8SVGPoint.h" | |
| 49 #include "V8ScriptProfile.h" | |
| 50 #include "V8TestCallback.h" | |
| 51 #include "V8TestEnumType.h" | |
| 52 #include "V8TestSubObj.h" | |
| 53 #include "V8a.h" | |
| 54 #include "V8b.h" | |
| 55 #include "V8bool.h" | |
| 56 #include "V8d.h" | |
| 57 #include "V8e.h" | |
| 58 #include <wtf/Float32Array.h> | |
| 59 #include <wtf/GetPtr.h> | |
| 60 #include <wtf/RefCounted.h> | |
| 61 #include <wtf/RefPtr.h> | |
| 62 #include <wtf/UnusedParam.h> | |
| 63 | |
| 64 #if ENABLE(Condition1) | |
| 65 #include "V8TestObjectA.h" | |
| 66 #endif | |
| 67 | |
| 68 #if ENABLE(Condition1) && ENABLE(Condition2) | |
| 69 #include "V8TestObjectB.h" | |
| 70 #endif | |
| 71 | |
| 72 #if ENABLE(Condition1) || ENABLE(Condition2) | |
| 73 #include "V8TestObjectC.h" | |
| 74 #endif | |
| 75 | |
| 76 #if ENABLE(BINDING_INTEGRITY) | |
| 77 #if defined(OS_WIN) | |
| 78 #pragma warning(disable: 4483) | |
| 79 extern "C" { extern void (*const __identifier("??_7TestObj@WebCore@@6B@")[])();
} | |
| 80 #else | |
| 81 extern "C" { extern void* _ZTVN7WebCore7TestObjE[]; } | |
| 82 #endif | |
| 83 #endif // ENABLE(BINDING_INTEGRITY) | |
| 84 | |
| 85 namespace WebCore { | |
| 86 | |
| 87 #if ENABLE(BINDING_INTEGRITY) | |
| 88 // This checks if a DOM object that is about to be wrapped is valid. | |
| 89 // Specifically, it checks that a vtable of the DOM object is equal to | |
| 90 // a vtable of an expected class. | |
| 91 // Due to a dangling pointer, the DOM object you are wrapping might be | |
| 92 // already freed or realloced. If freed, the check will fail because | |
| 93 // a free list pointer should be stored at the head of the DOM object. | |
| 94 // If realloced, the check will fail because the vtable of the DOM object | |
| 95 // differs from the expected vtable (unless the same class of DOM object | |
| 96 // is realloced on the slot). | |
| 97 inline void checkTypeOrDieTrying(TestObj* object) | |
| 98 { | |
| 99 void* actualVTablePointer = *(reinterpret_cast<void**>(object)); | |
| 100 #if defined(OS_WIN) | |
| 101 void* expectedVTablePointer = reinterpret_cast<void*>(__identifier("??_7Test
Obj@WebCore@@6B@")); | |
| 102 #else | |
| 103 void* expectedVTablePointer = &_ZTVN7WebCore7TestObjE[2]; | |
| 104 #endif | |
| 105 if (actualVTablePointer != expectedVTablePointer) | |
| 106 CRASH(); | |
| 107 } | |
| 108 #endif // ENABLE(BINDING_INTEGRITY) | |
| 109 | |
| 110 WrapperTypeInfo V8TestObj::info = { V8TestObj::GetTemplate, V8TestObj::derefObje
ct, 0, 0, 0, V8TestObj::installPerContextPrototypeProperties, 0, WrapperTypeObje
ctPrototype }; | |
| 111 | |
| 112 namespace TestObjV8Internal { | |
| 113 | |
| 114 template <typename T> void V8_USE(T) { } | |
| 115 | |
| 116 static v8::Handle<v8::Value> readOnlyLongAttrAttrGetter(v8::Local<v8::String> na
me, const v8::AccessorInfo& info) | |
| 117 { | |
| 118 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 119 return v8Integer(imp->readOnlyLongAttr(), info.GetIsolate()); | |
| 120 } | |
| 121 | |
| 122 static v8::Handle<v8::Value> readOnlyLongAttrAttrGetterCallback(v8::Local<v8::St
ring> name, const v8::AccessorInfo& info) | |
| 123 { | |
| 124 return TestObjV8Internal::readOnlyLongAttrAttrGetter(name, info); | |
| 125 } | |
| 126 | |
| 127 static v8::Handle<v8::Value> readOnlyStringAttrAttrGetter(v8::Local<v8::String>
name, const v8::AccessorInfo& info) | |
| 128 { | |
| 129 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 130 return v8String(imp->readOnlyStringAttr(), info.GetIsolate(), ReturnUnsafeHa
ndle); | |
| 131 } | |
| 132 | |
| 133 static v8::Handle<v8::Value> readOnlyStringAttrAttrGetterCallback(v8::Local<v8::
String> name, const v8::AccessorInfo& info) | |
| 134 { | |
| 135 return TestObjV8Internal::readOnlyStringAttrAttrGetter(name, info); | |
| 136 } | |
| 137 | |
| 138 static v8::Handle<v8::Value> readOnlyTestObjAttrAttrGetter(v8::Local<v8::String>
name, const v8::AccessorInfo& info) | |
| 139 { | |
| 140 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 141 RefPtr<TestObj> result = imp->readOnlyTestObjAttr(); | |
| 142 v8::Handle<v8::Value> wrapper = result.get() ? v8::Handle<v8::Value>(DOMData
Store::getWrapper(result.get(), info.GetIsolate())) : v8Undefined(); | |
| 143 if (wrapper.IsEmpty()) { | |
| 144 wrapper = toV8(result.get(), info.Holder(), info.GetIsolate()); | |
| 145 if (!wrapper.IsEmpty()) | |
| 146 V8HiddenPropertyName::setNamedHiddenReference(info.Holder(), "readOn
lyTestObjAttr", wrapper); | |
| 147 } | |
| 148 return wrapper; | |
| 149 } | |
| 150 | |
| 151 static v8::Handle<v8::Value> readOnlyTestObjAttrAttrGetterCallback(v8::Local<v8:
:String> name, const v8::AccessorInfo& info) | |
| 152 { | |
| 153 return TestObjV8Internal::readOnlyTestObjAttrAttrGetter(name, info); | |
| 154 } | |
| 155 | |
| 156 static v8::Handle<v8::Value> staticReadOnlyLongAttrAttrGetter(v8::Local<v8::Stri
ng> name, const v8::AccessorInfo& info) | |
| 157 { | |
| 158 return v8Integer(TestObj::staticReadOnlyLongAttr(), info.GetIsolate()); | |
| 159 } | |
| 160 | |
| 161 static v8::Handle<v8::Value> staticReadOnlyLongAttrAttrGetterCallback(v8::Local<
v8::String> name, const v8::AccessorInfo& info) | |
| 162 { | |
| 163 return TestObjV8Internal::staticReadOnlyLongAttrAttrGetter(name, info); | |
| 164 } | |
| 165 | |
| 166 static v8::Handle<v8::Value> staticStringAttrAttrGetter(v8::Local<v8::String> na
me, const v8::AccessorInfo& info) | |
| 167 { | |
| 168 return v8String(TestObj::staticStringAttr(), info.GetIsolate(), ReturnUnsafe
Handle); | |
| 169 } | |
| 170 | |
| 171 static v8::Handle<v8::Value> staticStringAttrAttrGetterCallback(v8::Local<v8::St
ring> name, const v8::AccessorInfo& info) | |
| 172 { | |
| 173 return TestObjV8Internal::staticStringAttrAttrGetter(name, info); | |
| 174 } | |
| 175 | |
| 176 static void staticStringAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8:
:Value> value, const v8::AccessorInfo& info) | |
| 177 { | |
| 178 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, v, value); | |
| 179 TestObj::setStaticStringAttr(v); | |
| 180 return; | |
| 181 } | |
| 182 | |
| 183 static void staticStringAttrAttrSetterCallback(v8::Local<v8::String> name, v8::L
ocal<v8::Value> value, const v8::AccessorInfo& info) | |
| 184 { | |
| 185 TestObjV8Internal::staticStringAttrAttrSetter(name, value, info); | |
| 186 } | |
| 187 | |
| 188 static v8::Handle<v8::Value> enumAttrAttrGetter(v8::Local<v8::String> name, cons
t v8::AccessorInfo& info) | |
| 189 { | |
| 190 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 191 return v8String(imp->enumAttr(), info.GetIsolate(), ReturnUnsafeHandle); | |
| 192 } | |
| 193 | |
| 194 static v8::Handle<v8::Value> enumAttrAttrGetterCallback(v8::Local<v8::String> na
me, const v8::AccessorInfo& info) | |
| 195 { | |
| 196 return TestObjV8Internal::enumAttrAttrGetter(name, info); | |
| 197 } | |
| 198 | |
| 199 static void enumAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value>
value, const v8::AccessorInfo& info) | |
| 200 { | |
| 201 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 202 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, v, value); | |
| 203 String string = v; | |
| 204 if (!(string == "" || string == "EnumValue1" || string == "EnumValue2" || st
ring == "EnumValue3")) | |
| 205 return; | |
| 206 imp->setEnumAttr(v); | |
| 207 return; | |
| 208 } | |
| 209 | |
| 210 static void enumAttrAttrSetterCallback(v8::Local<v8::String> name, v8::Local<v8:
:Value> value, const v8::AccessorInfo& info) | |
| 211 { | |
| 212 TestObjV8Internal::enumAttrAttrSetter(name, value, info); | |
| 213 } | |
| 214 | |
| 215 static v8::Handle<v8::Value> shortAttrAttrGetter(v8::Local<v8::String> name, con
st v8::AccessorInfo& info) | |
| 216 { | |
| 217 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 218 return v8Integer(imp->shortAttr(), info.GetIsolate()); | |
| 219 } | |
| 220 | |
| 221 static v8::Handle<v8::Value> shortAttrAttrGetterCallback(v8::Local<v8::String> n
ame, const v8::AccessorInfo& info) | |
| 222 { | |
| 223 return TestObjV8Internal::shortAttrAttrGetter(name, info); | |
| 224 } | |
| 225 | |
| 226 static void shortAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value>
value, const v8::AccessorInfo& info) | |
| 227 { | |
| 228 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 229 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
| 230 imp->setShortAttr(v); | |
| 231 return; | |
| 232 } | |
| 233 | |
| 234 static void shortAttrAttrSetterCallback(v8::Local<v8::String> name, v8::Local<v8
::Value> value, const v8::AccessorInfo& info) | |
| 235 { | |
| 236 TestObjV8Internal::shortAttrAttrSetter(name, value, info); | |
| 237 } | |
| 238 | |
| 239 static v8::Handle<v8::Value> unsignedShortAttrAttrGetter(v8::Local<v8::String> n
ame, const v8::AccessorInfo& info) | |
| 240 { | |
| 241 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 242 return v8Integer(imp->unsignedShortAttr(), info.GetIsolate()); | |
| 243 } | |
| 244 | |
| 245 static v8::Handle<v8::Value> unsignedShortAttrAttrGetterCallback(v8::Local<v8::S
tring> name, const v8::AccessorInfo& info) | |
| 246 { | |
| 247 return TestObjV8Internal::unsignedShortAttrAttrGetter(name, info); | |
| 248 } | |
| 249 | |
| 250 static void unsignedShortAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8
::Value> value, const v8::AccessorInfo& info) | |
| 251 { | |
| 252 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 253 V8TRYCATCH_VOID(int, v, toUInt32(value)); | |
| 254 imp->setUnsignedShortAttr(v); | |
| 255 return; | |
| 256 } | |
| 257 | |
| 258 static void unsignedShortAttrAttrSetterCallback(v8::Local<v8::String> name, v8::
Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 259 { | |
| 260 TestObjV8Internal::unsignedShortAttrAttrSetter(name, value, info); | |
| 261 } | |
| 262 | |
| 263 static v8::Handle<v8::Value> longAttrAttrGetter(v8::Local<v8::String> name, cons
t v8::AccessorInfo& info) | |
| 264 { | |
| 265 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 266 return v8Integer(imp->longAttr(), info.GetIsolate()); | |
| 267 } | |
| 268 | |
| 269 static v8::Handle<v8::Value> longAttrAttrGetterCallback(v8::Local<v8::String> na
me, const v8::AccessorInfo& info) | |
| 270 { | |
| 271 return TestObjV8Internal::longAttrAttrGetter(name, info); | |
| 272 } | |
| 273 | |
| 274 static void longAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value>
value, const v8::AccessorInfo& info) | |
| 275 { | |
| 276 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 277 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
| 278 imp->setLongAttr(v); | |
| 279 return; | |
| 280 } | |
| 281 | |
| 282 static void longAttrAttrSetterCallback(v8::Local<v8::String> name, v8::Local<v8:
:Value> value, const v8::AccessorInfo& info) | |
| 283 { | |
| 284 TestObjV8Internal::longAttrAttrSetter(name, value, info); | |
| 285 } | |
| 286 | |
| 287 static v8::Handle<v8::Value> longLongAttrAttrGetter(v8::Local<v8::String> name,
const v8::AccessorInfo& info) | |
| 288 { | |
| 289 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 290 return v8::Number::New(static_cast<double>(imp->longLongAttr())); | |
| 291 } | |
| 292 | |
| 293 static v8::Handle<v8::Value> longLongAttrAttrGetterCallback(v8::Local<v8::String
> name, const v8::AccessorInfo& info) | |
| 294 { | |
| 295 return TestObjV8Internal::longLongAttrAttrGetter(name, info); | |
| 296 } | |
| 297 | |
| 298 static void longLongAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Val
ue> value, const v8::AccessorInfo& info) | |
| 299 { | |
| 300 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 301 V8TRYCATCH_VOID(long long, v, toInt64(value)); | |
| 302 imp->setLongLongAttr(v); | |
| 303 return; | |
| 304 } | |
| 305 | |
| 306 static void longLongAttrAttrSetterCallback(v8::Local<v8::String> name, v8::Local
<v8::Value> value, const v8::AccessorInfo& info) | |
| 307 { | |
| 308 TestObjV8Internal::longLongAttrAttrSetter(name, value, info); | |
| 309 } | |
| 310 | |
| 311 static v8::Handle<v8::Value> unsignedLongLongAttrAttrGetter(v8::Local<v8::String
> name, const v8::AccessorInfo& info) | |
| 312 { | |
| 313 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 314 return v8::Number::New(static_cast<double>(imp->unsignedLongLongAttr())); | |
| 315 } | |
| 316 | |
| 317 static v8::Handle<v8::Value> unsignedLongLongAttrAttrGetterCallback(v8::Local<v8
::String> name, const v8::AccessorInfo& info) | |
| 318 { | |
| 319 return TestObjV8Internal::unsignedLongLongAttrAttrGetter(name, info); | |
| 320 } | |
| 321 | |
| 322 static void unsignedLongLongAttrAttrSetter(v8::Local<v8::String> name, v8::Local
<v8::Value> value, const v8::AccessorInfo& info) | |
| 323 { | |
| 324 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 325 V8TRYCATCH_VOID(unsigned long long, v, toUInt64(value)); | |
| 326 imp->setUnsignedLongLongAttr(v); | |
| 327 return; | |
| 328 } | |
| 329 | |
| 330 static void unsignedLongLongAttrAttrSetterCallback(v8::Local<v8::String> name, v
8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 331 { | |
| 332 TestObjV8Internal::unsignedLongLongAttrAttrSetter(name, value, info); | |
| 333 } | |
| 334 | |
| 335 static v8::Handle<v8::Value> stringAttrAttrGetter(v8::Local<v8::String> name, co
nst v8::AccessorInfo& info) | |
| 336 { | |
| 337 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 338 return v8String(imp->stringAttr(), info.GetIsolate(), ReturnUnsafeHandle); | |
| 339 } | |
| 340 | |
| 341 static v8::Handle<v8::Value> stringAttrAttrGetterCallback(v8::Local<v8::String>
name, const v8::AccessorInfo& info) | |
| 342 { | |
| 343 return TestObjV8Internal::stringAttrAttrGetter(name, info); | |
| 344 } | |
| 345 | |
| 346 static void stringAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value
> value, const v8::AccessorInfo& info) | |
| 347 { | |
| 348 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 349 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, v, value); | |
| 350 imp->setStringAttr(v); | |
| 351 return; | |
| 352 } | |
| 353 | |
| 354 static void stringAttrAttrSetterCallback(v8::Local<v8::String> name, v8::Local<v
8::Value> value, const v8::AccessorInfo& info) | |
| 355 { | |
| 356 TestObjV8Internal::stringAttrAttrSetter(name, value, info); | |
| 357 } | |
| 358 | |
| 359 static v8::Handle<v8::Value> testObjAttrAttrGetter(v8::Local<v8::String> name, c
onst v8::AccessorInfo& info) | |
| 360 { | |
| 361 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 362 return toV8Fast(imp->testObjAttr(), info, imp); | |
| 363 } | |
| 364 | |
| 365 static v8::Handle<v8::Value> testObjAttrAttrGetterCallback(v8::Local<v8::String>
name, const v8::AccessorInfo& info) | |
| 366 { | |
| 367 FeatureObserver::observe(activeDOMWindow(BindingState::instance()), FeatureO
bserver::TestFeature); | |
| 368 return TestObjV8Internal::testObjAttrAttrGetter(name, info); | |
| 369 } | |
| 370 | |
| 371 static void testObjAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Valu
e> value, const v8::AccessorInfo& info) | |
| 372 { | |
| 373 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 374 V8TRYCATCH_VOID(TestObj*, v, V8TestObj::HasInstance(value, info.GetIsolate()
, worldType(info.GetIsolate())) ? V8TestObj::toNative(v8::Handle<v8::Object>::Ca
st(value)) : 0); | |
| 375 imp->setTestObjAttr(WTF::getPtr(v)); | |
| 376 return; | |
| 377 } | |
| 378 | |
| 379 static void testObjAttrAttrSetterCallback(v8::Local<v8::String> name, v8::Local<
v8::Value> value, const v8::AccessorInfo& info) | |
| 380 { | |
| 381 FeatureObserver::observe(activeDOMWindow(BindingState::instance()), FeatureO
bserver::TestFeature); | |
| 382 TestObjV8Internal::testObjAttrAttrSetter(name, value, info); | |
| 383 } | |
| 384 | |
| 385 static v8::Handle<v8::Value> XMLObjAttrAttrGetter(v8::Local<v8::String> name, co
nst v8::AccessorInfo& info) | |
| 386 { | |
| 387 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 388 return toV8Fast(imp->xmlObjAttr(), info, imp); | |
| 389 } | |
| 390 | |
| 391 static v8::Handle<v8::Value> XMLObjAttrAttrGetterCallback(v8::Local<v8::String>
name, const v8::AccessorInfo& info) | |
| 392 { | |
| 393 return TestObjV8Internal::XMLObjAttrAttrGetter(name, info); | |
| 394 } | |
| 395 | |
| 396 static void XMLObjAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value
> value, const v8::AccessorInfo& info) | |
| 397 { | |
| 398 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 399 V8TRYCATCH_VOID(TestObj*, v, V8TestObj::HasInstance(value, info.GetIsolate()
, worldType(info.GetIsolate())) ? V8TestObj::toNative(v8::Handle<v8::Object>::Ca
st(value)) : 0); | |
| 400 imp->setXMLObjAttr(WTF::getPtr(v)); | |
| 401 return; | |
| 402 } | |
| 403 | |
| 404 static void XMLObjAttrAttrSetterCallback(v8::Local<v8::String> name, v8::Local<v
8::Value> value, const v8::AccessorInfo& info) | |
| 405 { | |
| 406 TestObjV8Internal::XMLObjAttrAttrSetter(name, value, info); | |
| 407 } | |
| 408 | |
| 409 static v8::Handle<v8::Value> createAttrGetter(v8::Local<v8::String> name, const
v8::AccessorInfo& info) | |
| 410 { | |
| 411 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 412 return v8Boolean(imp->isCreate(), info.GetIsolate()); | |
| 413 } | |
| 414 | |
| 415 static v8::Handle<v8::Value> createAttrGetterCallback(v8::Local<v8::String> name
, const v8::AccessorInfo& info) | |
| 416 { | |
| 417 return TestObjV8Internal::createAttrGetter(name, info); | |
| 418 } | |
| 419 | |
| 420 static void createAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> va
lue, const v8::AccessorInfo& info) | |
| 421 { | |
| 422 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 423 V8TRYCATCH_VOID(bool, v, value->BooleanValue()); | |
| 424 imp->setCreate(v); | |
| 425 return; | |
| 426 } | |
| 427 | |
| 428 static void createAttrSetterCallback(v8::Local<v8::String> name, v8::Local<v8::V
alue> value, const v8::AccessorInfo& info) | |
| 429 { | |
| 430 TestObjV8Internal::createAttrSetter(name, value, info); | |
| 431 } | |
| 432 | |
| 433 static v8::Handle<v8::Value> reflectedStringAttrAttrGetter(v8::Local<v8::String>
name, const v8::AccessorInfo& info) | |
| 434 { | |
| 435 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 436 return v8String(imp->fastGetAttribute(WebCore::HTMLNames::reflectedstringatt
rAttr), info.GetIsolate(), ReturnUnsafeHandle); | |
| 437 } | |
| 438 | |
| 439 static v8::Handle<v8::Value> reflectedStringAttrAttrGetterCallback(v8::Local<v8:
:String> name, const v8::AccessorInfo& info) | |
| 440 { | |
| 441 return TestObjV8Internal::reflectedStringAttrAttrGetter(name, info); | |
| 442 } | |
| 443 | |
| 444 static void reflectedStringAttrAttrSetter(v8::Local<v8::String> name, v8::Local<
v8::Value> value, const v8::AccessorInfo& info) | |
| 445 { | |
| 446 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 447 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, v, val
ue); | |
| 448 imp->setAttribute(WebCore::HTMLNames::reflectedstringattrAttr, v); | |
| 449 return; | |
| 450 } | |
| 451 | |
| 452 static void reflectedStringAttrAttrSetterCallback(v8::Local<v8::String> name, v8
::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 453 { | |
| 454 TestObjV8Internal::reflectedStringAttrAttrSetter(name, value, info); | |
| 455 } | |
| 456 | |
| 457 static v8::Handle<v8::Value> reflectedIntegralAttrAttrGetter(v8::Local<v8::Strin
g> name, const v8::AccessorInfo& info) | |
| 458 { | |
| 459 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 460 return v8Integer(imp->getIntegralAttribute(WebCore::HTMLNames::reflectedinte
gralattrAttr), info.GetIsolate()); | |
| 461 } | |
| 462 | |
| 463 static v8::Handle<v8::Value> reflectedIntegralAttrAttrGetterCallback(v8::Local<v
8::String> name, const v8::AccessorInfo& info) | |
| 464 { | |
| 465 return TestObjV8Internal::reflectedIntegralAttrAttrGetter(name, info); | |
| 466 } | |
| 467 | |
| 468 static void reflectedIntegralAttrAttrSetter(v8::Local<v8::String> name, v8::Loca
l<v8::Value> value, const v8::AccessorInfo& info) | |
| 469 { | |
| 470 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 471 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
| 472 imp->setIntegralAttribute(WebCore::HTMLNames::reflectedintegralattrAttr, v); | |
| 473 return; | |
| 474 } | |
| 475 | |
| 476 static void reflectedIntegralAttrAttrSetterCallback(v8::Local<v8::String> name,
v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 477 { | |
| 478 TestObjV8Internal::reflectedIntegralAttrAttrSetter(name, value, info); | |
| 479 } | |
| 480 | |
| 481 static v8::Handle<v8::Value> reflectedUnsignedIntegralAttrAttrGetter(v8::Local<v
8::String> name, const v8::AccessorInfo& info) | |
| 482 { | |
| 483 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 484 return v8UnsignedInteger(std::max(0, imp->getIntegralAttribute(WebCore::HTML
Names::reflectedunsignedintegralattrAttr)), info.GetIsolate()); | |
| 485 } | |
| 486 | |
| 487 static v8::Handle<v8::Value> reflectedUnsignedIntegralAttrAttrGetterCallback(v8:
:Local<v8::String> name, const v8::AccessorInfo& info) | |
| 488 { | |
| 489 return TestObjV8Internal::reflectedUnsignedIntegralAttrAttrGetter(name, info
); | |
| 490 } | |
| 491 | |
| 492 static void reflectedUnsignedIntegralAttrAttrSetter(v8::Local<v8::String> name,
v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 493 { | |
| 494 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 495 V8TRYCATCH_VOID(unsigned, v, toUInt32(value)); | |
| 496 imp->setUnsignedIntegralAttribute(WebCore::HTMLNames::reflectedunsignedinteg
ralattrAttr, v); | |
| 497 return; | |
| 498 } | |
| 499 | |
| 500 static void reflectedUnsignedIntegralAttrAttrSetterCallback(v8::Local<v8::String
> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 501 { | |
| 502 TestObjV8Internal::reflectedUnsignedIntegralAttrAttrSetter(name, value, info
); | |
| 503 } | |
| 504 | |
| 505 static v8::Handle<v8::Value> reflectedBooleanAttrAttrGetter(v8::Local<v8::String
> name, const v8::AccessorInfo& info) | |
| 506 { | |
| 507 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 508 return v8Boolean(imp->fastHasAttribute(WebCore::HTMLNames::reflectedbooleana
ttrAttr), info.GetIsolate()); | |
| 509 } | |
| 510 | |
| 511 static v8::Handle<v8::Value> reflectedBooleanAttrAttrGetterCallback(v8::Local<v8
::String> name, const v8::AccessorInfo& info) | |
| 512 { | |
| 513 return TestObjV8Internal::reflectedBooleanAttrAttrGetter(name, info); | |
| 514 } | |
| 515 | |
| 516 static void reflectedBooleanAttrAttrSetter(v8::Local<v8::String> name, v8::Local
<v8::Value> value, const v8::AccessorInfo& info) | |
| 517 { | |
| 518 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 519 V8TRYCATCH_VOID(bool, v, value->BooleanValue()); | |
| 520 imp->setBooleanAttribute(WebCore::HTMLNames::reflectedbooleanattrAttr, v); | |
| 521 return; | |
| 522 } | |
| 523 | |
| 524 static void reflectedBooleanAttrAttrSetterCallback(v8::Local<v8::String> name, v
8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 525 { | |
| 526 TestObjV8Internal::reflectedBooleanAttrAttrSetter(name, value, info); | |
| 527 } | |
| 528 | |
| 529 static v8::Handle<v8::Value> reflectedURLAttrAttrGetter(v8::Local<v8::String> na
me, const v8::AccessorInfo& info) | |
| 530 { | |
| 531 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 532 return v8String(imp->getURLAttribute(WebCore::HTMLNames::reflectedurlattrAtt
r), info.GetIsolate(), ReturnUnsafeHandle); | |
| 533 } | |
| 534 | |
| 535 static v8::Handle<v8::Value> reflectedURLAttrAttrGetterCallback(v8::Local<v8::St
ring> name, const v8::AccessorInfo& info) | |
| 536 { | |
| 537 return TestObjV8Internal::reflectedURLAttrAttrGetter(name, info); | |
| 538 } | |
| 539 | |
| 540 static void reflectedURLAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8:
:Value> value, const v8::AccessorInfo& info) | |
| 541 { | |
| 542 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 543 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, v, val
ue); | |
| 544 imp->setAttribute(WebCore::HTMLNames::reflectedurlattrAttr, v); | |
| 545 return; | |
| 546 } | |
| 547 | |
| 548 static void reflectedURLAttrAttrSetterCallback(v8::Local<v8::String> name, v8::L
ocal<v8::Value> value, const v8::AccessorInfo& info) | |
| 549 { | |
| 550 TestObjV8Internal::reflectedURLAttrAttrSetter(name, value, info); | |
| 551 } | |
| 552 | |
| 553 static v8::Handle<v8::Value> reflectedStringAttrAttrGetter(v8::Local<v8::String>
name, const v8::AccessorInfo& info) | |
| 554 { | |
| 555 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 556 return v8String(imp->fastGetAttribute(WebCore::HTMLNames::customContentStrin
gAttrAttr), info.GetIsolate(), ReturnUnsafeHandle); | |
| 557 } | |
| 558 | |
| 559 static v8::Handle<v8::Value> reflectedStringAttrAttrGetterCallback(v8::Local<v8:
:String> name, const v8::AccessorInfo& info) | |
| 560 { | |
| 561 return TestObjV8Internal::reflectedStringAttrAttrGetter(name, info); | |
| 562 } | |
| 563 | |
| 564 static void reflectedStringAttrAttrSetter(v8::Local<v8::String> name, v8::Local<
v8::Value> value, const v8::AccessorInfo& info) | |
| 565 { | |
| 566 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 567 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, v, val
ue); | |
| 568 imp->setAttribute(WebCore::HTMLNames::customContentStringAttrAttr, v); | |
| 569 return; | |
| 570 } | |
| 571 | |
| 572 static void reflectedStringAttrAttrSetterCallback(v8::Local<v8::String> name, v8
::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 573 { | |
| 574 TestObjV8Internal::reflectedStringAttrAttrSetter(name, value, info); | |
| 575 } | |
| 576 | |
| 577 static v8::Handle<v8::Value> reflectedCustomIntegralAttrAttrGetter(v8::Local<v8:
:String> name, const v8::AccessorInfo& info) | |
| 578 { | |
| 579 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 580 return v8Integer(imp->getIntegralAttribute(WebCore::HTMLNames::customContent
IntegralAttrAttr), info.GetIsolate()); | |
| 581 } | |
| 582 | |
| 583 static v8::Handle<v8::Value> reflectedCustomIntegralAttrAttrGetterCallback(v8::L
ocal<v8::String> name, const v8::AccessorInfo& info) | |
| 584 { | |
| 585 return TestObjV8Internal::reflectedCustomIntegralAttrAttrGetter(name, info); | |
| 586 } | |
| 587 | |
| 588 static void reflectedCustomIntegralAttrAttrSetter(v8::Local<v8::String> name, v8
::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 589 { | |
| 590 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 591 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
| 592 imp->setIntegralAttribute(WebCore::HTMLNames::customContentIntegralAttrAttr,
v); | |
| 593 return; | |
| 594 } | |
| 595 | |
| 596 static void reflectedCustomIntegralAttrAttrSetterCallback(v8::Local<v8::String>
name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 597 { | |
| 598 TestObjV8Internal::reflectedCustomIntegralAttrAttrSetter(name, value, info); | |
| 599 } | |
| 600 | |
| 601 static v8::Handle<v8::Value> reflectedCustomBooleanAttrAttrGetter(v8::Local<v8::
String> name, const v8::AccessorInfo& info) | |
| 602 { | |
| 603 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 604 return v8Boolean(imp->fastHasAttribute(WebCore::HTMLNames::customContentBool
eanAttrAttr), info.GetIsolate()); | |
| 605 } | |
| 606 | |
| 607 static v8::Handle<v8::Value> reflectedCustomBooleanAttrAttrGetterCallback(v8::Lo
cal<v8::String> name, const v8::AccessorInfo& info) | |
| 608 { | |
| 609 return TestObjV8Internal::reflectedCustomBooleanAttrAttrGetter(name, info); | |
| 610 } | |
| 611 | |
| 612 static void reflectedCustomBooleanAttrAttrSetter(v8::Local<v8::String> name, v8:
:Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 613 { | |
| 614 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 615 V8TRYCATCH_VOID(bool, v, value->BooleanValue()); | |
| 616 imp->setBooleanAttribute(WebCore::HTMLNames::customContentBooleanAttrAttr, v
); | |
| 617 return; | |
| 618 } | |
| 619 | |
| 620 static void reflectedCustomBooleanAttrAttrSetterCallback(v8::Local<v8::String> n
ame, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 621 { | |
| 622 TestObjV8Internal::reflectedCustomBooleanAttrAttrSetter(name, value, info); | |
| 623 } | |
| 624 | |
| 625 static v8::Handle<v8::Value> reflectedCustomURLAttrAttrGetter(v8::Local<v8::Stri
ng> name, const v8::AccessorInfo& info) | |
| 626 { | |
| 627 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 628 return v8String(imp->getURLAttribute(WebCore::HTMLNames::customContentURLAtt
rAttr), info.GetIsolate(), ReturnUnsafeHandle); | |
| 629 } | |
| 630 | |
| 631 static v8::Handle<v8::Value> reflectedCustomURLAttrAttrGetterCallback(v8::Local<
v8::String> name, const v8::AccessorInfo& info) | |
| 632 { | |
| 633 return TestObjV8Internal::reflectedCustomURLAttrAttrGetter(name, info); | |
| 634 } | |
| 635 | |
| 636 static void reflectedCustomURLAttrAttrSetter(v8::Local<v8::String> name, v8::Loc
al<v8::Value> value, const v8::AccessorInfo& info) | |
| 637 { | |
| 638 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 639 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, v, val
ue); | |
| 640 imp->setAttribute(WebCore::HTMLNames::customContentURLAttrAttr, v); | |
| 641 return; | |
| 642 } | |
| 643 | |
| 644 static void reflectedCustomURLAttrAttrSetterCallback(v8::Local<v8::String> name,
v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 645 { | |
| 646 TestObjV8Internal::reflectedCustomURLAttrAttrSetter(name, value, info); | |
| 647 } | |
| 648 | |
| 649 static v8::Handle<v8::Value> typedArrayAttrAttrGetter(v8::Local<v8::String> name
, const v8::AccessorInfo& info) | |
| 650 { | |
| 651 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 652 return toV8Fast(imp->typedArrayAttr(), info, imp); | |
| 653 } | |
| 654 | |
| 655 static v8::Handle<v8::Value> typedArrayAttrAttrGetterCallback(v8::Local<v8::Stri
ng> name, const v8::AccessorInfo& info) | |
| 656 { | |
| 657 return TestObjV8Internal::typedArrayAttrAttrGetter(name, info); | |
| 658 } | |
| 659 | |
| 660 static void typedArrayAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::V
alue> value, const v8::AccessorInfo& info) | |
| 661 { | |
| 662 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 663 V8TRYCATCH_VOID(Float32Array*, v, V8Float32Array::HasInstance(value, info.Ge
tIsolate(), worldType(info.GetIsolate())) ? V8Float32Array::toNative(v8::Handle<
v8::Object>::Cast(value)) : 0); | |
| 664 imp->setTypedArrayAttr(WTF::getPtr(v)); | |
| 665 return; | |
| 666 } | |
| 667 | |
| 668 static void typedArrayAttrAttrSetterCallback(v8::Local<v8::String> name, v8::Loc
al<v8::Value> value, const v8::AccessorInfo& info) | |
| 669 { | |
| 670 TestObjV8Internal::typedArrayAttrAttrSetter(name, value, info); | |
| 671 } | |
| 672 | |
| 673 static v8::Handle<v8::Value> attrWithGetterExceptionAttrGetter(v8::Local<v8::Str
ing> name, const v8::AccessorInfo& info) | |
| 674 { | |
| 675 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 676 ExceptionCode ec = 0; | |
| 677 int v = imp->attrWithGetterException(ec); | |
| 678 if (UNLIKELY(ec)) | |
| 679 return setDOMException(ec, info.GetIsolate()); | |
| 680 return v8Integer(v, info.GetIsolate()); | |
| 681 } | |
| 682 | |
| 683 static v8::Handle<v8::Value> attrWithGetterExceptionAttrGetterCallback(v8::Local
<v8::String> name, const v8::AccessorInfo& info) | |
| 684 { | |
| 685 return TestObjV8Internal::attrWithGetterExceptionAttrGetter(name, info); | |
| 686 } | |
| 687 | |
| 688 static void attrWithGetterExceptionAttrSetter(v8::Local<v8::String> name, v8::Lo
cal<v8::Value> value, const v8::AccessorInfo& info) | |
| 689 { | |
| 690 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 691 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
| 692 imp->setAttrWithGetterException(v); | |
| 693 return; | |
| 694 } | |
| 695 | |
| 696 static void attrWithGetterExceptionAttrSetterCallback(v8::Local<v8::String> name
, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 697 { | |
| 698 TestObjV8Internal::attrWithGetterExceptionAttrSetter(name, value, info); | |
| 699 } | |
| 700 | |
| 701 static v8::Handle<v8::Value> attrWithSetterExceptionAttrGetter(v8::Local<v8::Str
ing> name, const v8::AccessorInfo& info) | |
| 702 { | |
| 703 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 704 return v8Integer(imp->attrWithSetterException(), info.GetIsolate()); | |
| 705 } | |
| 706 | |
| 707 static v8::Handle<v8::Value> attrWithSetterExceptionAttrGetterCallback(v8::Local
<v8::String> name, const v8::AccessorInfo& info) | |
| 708 { | |
| 709 return TestObjV8Internal::attrWithSetterExceptionAttrGetter(name, info); | |
| 710 } | |
| 711 | |
| 712 static void attrWithSetterExceptionAttrSetter(v8::Local<v8::String> name, v8::Lo
cal<v8::Value> value, const v8::AccessorInfo& info) | |
| 713 { | |
| 714 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 715 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
| 716 ExceptionCode ec = 0; | |
| 717 imp->setAttrWithSetterException(v, ec); | |
| 718 if (UNLIKELY(ec)) | |
| 719 setDOMException(ec, info.GetIsolate()); | |
| 720 return; | |
| 721 } | |
| 722 | |
| 723 static void attrWithSetterExceptionAttrSetterCallback(v8::Local<v8::String> name
, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 724 { | |
| 725 TestObjV8Internal::attrWithSetterExceptionAttrSetter(name, value, info); | |
| 726 } | |
| 727 | |
| 728 static v8::Handle<v8::Value> stringAttrWithGetterExceptionAttrGetter(v8::Local<v
8::String> name, const v8::AccessorInfo& info) | |
| 729 { | |
| 730 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 731 ExceptionCode ec = 0; | |
| 732 String v = imp->stringAttrWithGetterException(ec); | |
| 733 if (UNLIKELY(ec)) | |
| 734 return setDOMException(ec, info.GetIsolate()); | |
| 735 return v8String(v, info.GetIsolate(), ReturnUnsafeHandle); | |
| 736 } | |
| 737 | |
| 738 static v8::Handle<v8::Value> stringAttrWithGetterExceptionAttrGetterCallback(v8:
:Local<v8::String> name, const v8::AccessorInfo& info) | |
| 739 { | |
| 740 return TestObjV8Internal::stringAttrWithGetterExceptionAttrGetter(name, info
); | |
| 741 } | |
| 742 | |
| 743 static void stringAttrWithGetterExceptionAttrSetter(v8::Local<v8::String> name,
v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 744 { | |
| 745 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 746 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, v, value); | |
| 747 imp->setStringAttrWithGetterException(v); | |
| 748 return; | |
| 749 } | |
| 750 | |
| 751 static void stringAttrWithGetterExceptionAttrSetterCallback(v8::Local<v8::String
> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 752 { | |
| 753 TestObjV8Internal::stringAttrWithGetterExceptionAttrSetter(name, value, info
); | |
| 754 } | |
| 755 | |
| 756 static v8::Handle<v8::Value> stringAttrWithSetterExceptionAttrGetter(v8::Local<v
8::String> name, const v8::AccessorInfo& info) | |
| 757 { | |
| 758 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 759 return v8String(imp->stringAttrWithSetterException(), info.GetIsolate(), Ret
urnUnsafeHandle); | |
| 760 } | |
| 761 | |
| 762 static v8::Handle<v8::Value> stringAttrWithSetterExceptionAttrGetterCallback(v8:
:Local<v8::String> name, const v8::AccessorInfo& info) | |
| 763 { | |
| 764 return TestObjV8Internal::stringAttrWithSetterExceptionAttrGetter(name, info
); | |
| 765 } | |
| 766 | |
| 767 static void stringAttrWithSetterExceptionAttrSetter(v8::Local<v8::String> name,
v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 768 { | |
| 769 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 770 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, v, value); | |
| 771 ExceptionCode ec = 0; | |
| 772 imp->setStringAttrWithSetterException(v, ec); | |
| 773 if (UNLIKELY(ec)) | |
| 774 setDOMException(ec, info.GetIsolate()); | |
| 775 return; | |
| 776 } | |
| 777 | |
| 778 static void stringAttrWithSetterExceptionAttrSetterCallback(v8::Local<v8::String
> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 779 { | |
| 780 TestObjV8Internal::stringAttrWithSetterExceptionAttrSetter(name, value, info
); | |
| 781 } | |
| 782 | |
| 783 static v8::Handle<v8::Value> customAttrAttrGetterCallback(v8::Local<v8::String>
name, const v8::AccessorInfo& info) | |
| 784 { | |
| 785 return V8TestObj::customAttrAttrGetterCustom(name, info); | |
| 786 } | |
| 787 | |
| 788 static void customAttrAttrSetterCallback(v8::Local<v8::String> name, v8::Local<v
8::Value> value, const v8::AccessorInfo& info) | |
| 789 { | |
| 790 V8TestObj::customAttrAttrSetterCustom(name, value, info); | |
| 791 } | |
| 792 | |
| 793 static v8::Handle<v8::Value> withScriptStateAttributeAttrGetter(v8::Local<v8::St
ring> name, const v8::AccessorInfo& info) | |
| 794 { | |
| 795 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 796 ScriptState* currentState = ScriptState::current(); | |
| 797 if (!currentState) | |
| 798 return v8Undefined(); | |
| 799 ScriptState& state = *currentState; | |
| 800 return v8Integer(imp->withScriptStateAttribute(&state), info.GetIsolate()); | |
| 801 } | |
| 802 | |
| 803 static v8::Handle<v8::Value> withScriptStateAttributeAttrGetterCallback(v8::Loca
l<v8::String> name, const v8::AccessorInfo& info) | |
| 804 { | |
| 805 return TestObjV8Internal::withScriptStateAttributeAttrGetter(name, info); | |
| 806 } | |
| 807 | |
| 808 static void withScriptStateAttributeAttrSetter(v8::Local<v8::String> name, v8::L
ocal<v8::Value> value, const v8::AccessorInfo& info) | |
| 809 { | |
| 810 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 811 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
| 812 ScriptState* currentState = ScriptState::current(); | |
| 813 if (!currentState) | |
| 814 return; | |
| 815 ScriptState& state = *currentState; | |
| 816 imp->setWithScriptStateAttribute(&state, v); | |
| 817 if (state.hadException()) | |
| 818 throwError(state.exception(), info.GetIsolate()); | |
| 819 return; | |
| 820 } | |
| 821 | |
| 822 static void withScriptStateAttributeAttrSetterCallback(v8::Local<v8::String> nam
e, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 823 { | |
| 824 TestObjV8Internal::withScriptStateAttributeAttrSetter(name, value, info); | |
| 825 } | |
| 826 | |
| 827 static v8::Handle<v8::Value> withScriptExecutionContextAttributeAttrGetter(v8::L
ocal<v8::String> name, const v8::AccessorInfo& info) | |
| 828 { | |
| 829 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 830 ScriptExecutionContext* scriptContext = getScriptExecutionContext(); | |
| 831 return toV8Fast(imp->withScriptExecutionContextAttribute(scriptContext), inf
o, imp); | |
| 832 } | |
| 833 | |
| 834 static v8::Handle<v8::Value> withScriptExecutionContextAttributeAttrGetterCallba
ck(v8::Local<v8::String> name, const v8::AccessorInfo& info) | |
| 835 { | |
| 836 return TestObjV8Internal::withScriptExecutionContextAttributeAttrGetter(name
, info); | |
| 837 } | |
| 838 | |
| 839 static void withScriptExecutionContextAttributeAttrSetter(v8::Local<v8::String>
name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 840 { | |
| 841 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 842 V8TRYCATCH_VOID(TestObj*, v, V8TestObj::HasInstance(value, info.GetIsolate()
, worldType(info.GetIsolate())) ? V8TestObj::toNative(v8::Handle<v8::Object>::Ca
st(value)) : 0); | |
| 843 ScriptExecutionContext* scriptContext = getScriptExecutionContext(); | |
| 844 imp->setWithScriptExecutionContextAttribute(scriptContext, WTF::getPtr(v)); | |
| 845 return; | |
| 846 } | |
| 847 | |
| 848 static void withScriptExecutionContextAttributeAttrSetterCallback(v8::Local<v8::
String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 849 { | |
| 850 TestObjV8Internal::withScriptExecutionContextAttributeAttrSetter(name, value
, info); | |
| 851 } | |
| 852 | |
| 853 static v8::Handle<v8::Value> withScriptStateAttributeRaisesAttrGetter(v8::Local<
v8::String> name, const v8::AccessorInfo& info) | |
| 854 { | |
| 855 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 856 ExceptionCode ec = 0; | |
| 857 ScriptState* currentState = ScriptState::current(); | |
| 858 if (!currentState) | |
| 859 return v8Undefined(); | |
| 860 ScriptState& state = *currentState; | |
| 861 RefPtr<TestObj> v = imp->withScriptStateAttributeRaises(&state, ec); | |
| 862 if (UNLIKELY(ec)) | |
| 863 return setDOMException(ec, info.GetIsolate()); | |
| 864 if (state.hadException()) | |
| 865 return throwError(state.exception(), info.GetIsolate()); | |
| 866 return toV8Fast(v.release(), info, imp); | |
| 867 } | |
| 868 | |
| 869 static v8::Handle<v8::Value> withScriptStateAttributeRaisesAttrGetterCallback(v8
::Local<v8::String> name, const v8::AccessorInfo& info) | |
| 870 { | |
| 871 return TestObjV8Internal::withScriptStateAttributeRaisesAttrGetter(name, inf
o); | |
| 872 } | |
| 873 | |
| 874 static void withScriptStateAttributeRaisesAttrSetter(v8::Local<v8::String> name,
v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 875 { | |
| 876 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 877 V8TRYCATCH_VOID(TestObj*, v, V8TestObj::HasInstance(value, info.GetIsolate()
, worldType(info.GetIsolate())) ? V8TestObj::toNative(v8::Handle<v8::Object>::Ca
st(value)) : 0); | |
| 878 ScriptState* currentState = ScriptState::current(); | |
| 879 if (!currentState) | |
| 880 return; | |
| 881 ScriptState& state = *currentState; | |
| 882 imp->setWithScriptStateAttributeRaises(&state, WTF::getPtr(v)); | |
| 883 if (state.hadException()) | |
| 884 throwError(state.exception(), info.GetIsolate()); | |
| 885 return; | |
| 886 } | |
| 887 | |
| 888 static void withScriptStateAttributeRaisesAttrSetterCallback(v8::Local<v8::Strin
g> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 889 { | |
| 890 TestObjV8Internal::withScriptStateAttributeRaisesAttrSetter(name, value, inf
o); | |
| 891 } | |
| 892 | |
| 893 static v8::Handle<v8::Value> withScriptExecutionContextAttributeRaisesAttrGetter
(v8::Local<v8::String> name, const v8::AccessorInfo& info) | |
| 894 { | |
| 895 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 896 ExceptionCode ec = 0; | |
| 897 ScriptExecutionContext* scriptContext = getScriptExecutionContext(); | |
| 898 RefPtr<TestObj> v = imp->withScriptExecutionContextAttributeRaises(scriptCon
text, ec); | |
| 899 if (UNLIKELY(ec)) | |
| 900 return setDOMException(ec, info.GetIsolate()); | |
| 901 return toV8Fast(v.release(), info, imp); | |
| 902 } | |
| 903 | |
| 904 static v8::Handle<v8::Value> withScriptExecutionContextAttributeRaisesAttrGetter
Callback(v8::Local<v8::String> name, const v8::AccessorInfo& info) | |
| 905 { | |
| 906 return TestObjV8Internal::withScriptExecutionContextAttributeRaisesAttrGette
r(name, info); | |
| 907 } | |
| 908 | |
| 909 static void withScriptExecutionContextAttributeRaisesAttrSetter(v8::Local<v8::St
ring> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 910 { | |
| 911 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 912 V8TRYCATCH_VOID(TestObj*, v, V8TestObj::HasInstance(value, info.GetIsolate()
, worldType(info.GetIsolate())) ? V8TestObj::toNative(v8::Handle<v8::Object>::Ca
st(value)) : 0); | |
| 913 ScriptExecutionContext* scriptContext = getScriptExecutionContext(); | |
| 914 imp->setWithScriptExecutionContextAttributeRaises(scriptContext, WTF::getPtr
(v)); | |
| 915 return; | |
| 916 } | |
| 917 | |
| 918 static void withScriptExecutionContextAttributeRaisesAttrSetterCallback(v8::Loca
l<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 919 { | |
| 920 TestObjV8Internal::withScriptExecutionContextAttributeRaisesAttrSetter(name,
value, info); | |
| 921 } | |
| 922 | |
| 923 static v8::Handle<v8::Value> withScriptExecutionContextAndScriptStateAttributeAt
trGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) | |
| 924 { | |
| 925 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 926 ScriptState* currentState = ScriptState::current(); | |
| 927 if (!currentState) | |
| 928 return v8Undefined(); | |
| 929 ScriptState& state = *currentState; | |
| 930 ScriptExecutionContext* scriptContext = getScriptExecutionContext(); | |
| 931 return toV8Fast(imp->withScriptExecutionContextAndScriptStateAttribute(&stat
e, scriptContext), info, imp); | |
| 932 } | |
| 933 | |
| 934 static v8::Handle<v8::Value> withScriptExecutionContextAndScriptStateAttributeAt
trGetterCallback(v8::Local<v8::String> name, const v8::AccessorInfo& info) | |
| 935 { | |
| 936 return TestObjV8Internal::withScriptExecutionContextAndScriptStateAttributeA
ttrGetter(name, info); | |
| 937 } | |
| 938 | |
| 939 static void withScriptExecutionContextAndScriptStateAttributeAttrSetter(v8::Loca
l<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 940 { | |
| 941 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 942 V8TRYCATCH_VOID(TestObj*, v, V8TestObj::HasInstance(value, info.GetIsolate()
, worldType(info.GetIsolate())) ? V8TestObj::toNative(v8::Handle<v8::Object>::Ca
st(value)) : 0); | |
| 943 ScriptState* currentState = ScriptState::current(); | |
| 944 if (!currentState) | |
| 945 return; | |
| 946 ScriptState& state = *currentState; | |
| 947 ScriptExecutionContext* scriptContext = getScriptExecutionContext(); | |
| 948 imp->setWithScriptExecutionContextAndScriptStateAttribute(&state, scriptCont
ext, WTF::getPtr(v)); | |
| 949 if (state.hadException()) | |
| 950 throwError(state.exception(), info.GetIsolate()); | |
| 951 return; | |
| 952 } | |
| 953 | |
| 954 static void withScriptExecutionContextAndScriptStateAttributeAttrSetterCallback(
v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo&
info) | |
| 955 { | |
| 956 TestObjV8Internal::withScriptExecutionContextAndScriptStateAttributeAttrSett
er(name, value, info); | |
| 957 } | |
| 958 | |
| 959 static v8::Handle<v8::Value> withScriptExecutionContextAndScriptStateAttributeRa
isesAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) | |
| 960 { | |
| 961 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 962 ExceptionCode ec = 0; | |
| 963 ScriptState* currentState = ScriptState::current(); | |
| 964 if (!currentState) | |
| 965 return v8Undefined(); | |
| 966 ScriptState& state = *currentState; | |
| 967 ScriptExecutionContext* scriptContext = getScriptExecutionContext(); | |
| 968 RefPtr<TestObj> v = imp->withScriptExecutionContextAndScriptStateAttributeRa
ises(&state, scriptContext, ec); | |
| 969 if (UNLIKELY(ec)) | |
| 970 return setDOMException(ec, info.GetIsolate()); | |
| 971 if (state.hadException()) | |
| 972 return throwError(state.exception(), info.GetIsolate()); | |
| 973 return toV8Fast(v.release(), info, imp); | |
| 974 } | |
| 975 | |
| 976 static v8::Handle<v8::Value> withScriptExecutionContextAndScriptStateAttributeRa
isesAttrGetterCallback(v8::Local<v8::String> name, const v8::AccessorInfo& info) | |
| 977 { | |
| 978 return TestObjV8Internal::withScriptExecutionContextAndScriptStateAttributeR
aisesAttrGetter(name, info); | |
| 979 } | |
| 980 | |
| 981 static void withScriptExecutionContextAndScriptStateAttributeRaisesAttrSetter(v8
::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& in
fo) | |
| 982 { | |
| 983 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 984 V8TRYCATCH_VOID(TestObj*, v, V8TestObj::HasInstance(value, info.GetIsolate()
, worldType(info.GetIsolate())) ? V8TestObj::toNative(v8::Handle<v8::Object>::Ca
st(value)) : 0); | |
| 985 ScriptState* currentState = ScriptState::current(); | |
| 986 if (!currentState) | |
| 987 return; | |
| 988 ScriptState& state = *currentState; | |
| 989 ScriptExecutionContext* scriptContext = getScriptExecutionContext(); | |
| 990 imp->setWithScriptExecutionContextAndScriptStateAttributeRaises(&state, scri
ptContext, WTF::getPtr(v)); | |
| 991 if (state.hadException()) | |
| 992 throwError(state.exception(), info.GetIsolate()); | |
| 993 return; | |
| 994 } | |
| 995 | |
| 996 static void withScriptExecutionContextAndScriptStateAttributeRaisesAttrSetterCal
lback(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::Accessor
Info& info) | |
| 997 { | |
| 998 TestObjV8Internal::withScriptExecutionContextAndScriptStateAttributeRaisesAt
trSetter(name, value, info); | |
| 999 } | |
| 1000 | |
| 1001 static v8::Handle<v8::Value> withScriptExecutionContextAndScriptStateWithSpacesA
ttributeAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) | |
| 1002 { | |
| 1003 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1004 ScriptState* currentState = ScriptState::current(); | |
| 1005 if (!currentState) | |
| 1006 return v8Undefined(); | |
| 1007 ScriptState& state = *currentState; | |
| 1008 ScriptExecutionContext* scriptContext = getScriptExecutionContext(); | |
| 1009 return toV8Fast(imp->withScriptExecutionContextAndScriptStateWithSpacesAttri
bute(&state, scriptContext), info, imp); | |
| 1010 } | |
| 1011 | |
| 1012 static v8::Handle<v8::Value> withScriptExecutionContextAndScriptStateWithSpacesA
ttributeAttrGetterCallback(v8::Local<v8::String> name, const v8::AccessorInfo& i
nfo) | |
| 1013 { | |
| 1014 return TestObjV8Internal::withScriptExecutionContextAndScriptStateWithSpaces
AttributeAttrGetter(name, info); | |
| 1015 } | |
| 1016 | |
| 1017 static void withScriptExecutionContextAndScriptStateWithSpacesAttributeAttrSette
r(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo
& info) | |
| 1018 { | |
| 1019 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1020 V8TRYCATCH_VOID(TestObj*, v, V8TestObj::HasInstance(value, info.GetIsolate()
, worldType(info.GetIsolate())) ? V8TestObj::toNative(v8::Handle<v8::Object>::Ca
st(value)) : 0); | |
| 1021 ScriptState* currentState = ScriptState::current(); | |
| 1022 if (!currentState) | |
| 1023 return; | |
| 1024 ScriptState& state = *currentState; | |
| 1025 ScriptExecutionContext* scriptContext = getScriptExecutionContext(); | |
| 1026 imp->setWithScriptExecutionContextAndScriptStateWithSpacesAttribute(&state,
scriptContext, WTF::getPtr(v)); | |
| 1027 if (state.hadException()) | |
| 1028 throwError(state.exception(), info.GetIsolate()); | |
| 1029 return; | |
| 1030 } | |
| 1031 | |
| 1032 static void withScriptExecutionContextAndScriptStateWithSpacesAttributeAttrSette
rCallback(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::Acce
ssorInfo& info) | |
| 1033 { | |
| 1034 TestObjV8Internal::withScriptExecutionContextAndScriptStateWithSpacesAttribu
teAttrSetter(name, value, info); | |
| 1035 } | |
| 1036 | |
| 1037 static v8::Handle<v8::Value> withScriptArgumentsAndCallStackAttributeAttrGetter(
v8::Local<v8::String> name, const v8::AccessorInfo& info) | |
| 1038 { | |
| 1039 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1040 return toV8Fast(imp->withScriptArgumentsAndCallStackAttribute(), info, imp); | |
| 1041 } | |
| 1042 | |
| 1043 static v8::Handle<v8::Value> withScriptArgumentsAndCallStackAttributeAttrGetterC
allback(v8::Local<v8::String> name, const v8::AccessorInfo& info) | |
| 1044 { | |
| 1045 return TestObjV8Internal::withScriptArgumentsAndCallStackAttributeAttrGetter
(name, info); | |
| 1046 } | |
| 1047 | |
| 1048 static void withScriptArgumentsAndCallStackAttributeAttrSetter(v8::Local<v8::Str
ing> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 1049 { | |
| 1050 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1051 V8TRYCATCH_VOID(TestObj*, v, V8TestObj::HasInstance(value, info.GetIsolate()
, worldType(info.GetIsolate())) ? V8TestObj::toNative(v8::Handle<v8::Object>::Ca
st(value)) : 0); | |
| 1052 imp->setWithScriptArgumentsAndCallStackAttribute(WTF::getPtr(v)); | |
| 1053 return; | |
| 1054 } | |
| 1055 | |
| 1056 static void withScriptArgumentsAndCallStackAttributeAttrSetterCallback(v8::Local
<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 1057 { | |
| 1058 TestObjV8Internal::withScriptArgumentsAndCallStackAttributeAttrSetter(name,
value, info); | |
| 1059 } | |
| 1060 | |
| 1061 static v8::Handle<v8::Value> enforcedRangeLongAttrAttrGetter(v8::Local<v8::Strin
g> name, const v8::AccessorInfo& info) | |
| 1062 { | |
| 1063 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1064 return v8Integer(imp->enforcedRangeLongAttr(), info.GetIsolate()); | |
| 1065 } | |
| 1066 | |
| 1067 static v8::Handle<v8::Value> enforcedRangeLongAttrAttrGetterCallback(v8::Local<v
8::String> name, const v8::AccessorInfo& info) | |
| 1068 { | |
| 1069 return TestObjV8Internal::enforcedRangeLongAttrAttrGetter(name, info); | |
| 1070 } | |
| 1071 | |
| 1072 static void enforcedRangeLongAttrAttrSetter(v8::Local<v8::String> name, v8::Loca
l<v8::Value> value, const v8::AccessorInfo& info) | |
| 1073 { | |
| 1074 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1075 V8TRYCATCH_WITH_TYPECHECK_VOID(int, v, toInt32(value, EnforceRange, ok), inf
o.GetIsolate()); | |
| 1076 imp->setEnforcedRangeLongAttr(v); | |
| 1077 return; | |
| 1078 } | |
| 1079 | |
| 1080 static void enforcedRangeLongAttrAttrSetterCallback(v8::Local<v8::String> name,
v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 1081 { | |
| 1082 TestObjV8Internal::enforcedRangeLongAttrAttrSetter(name, value, info); | |
| 1083 } | |
| 1084 | |
| 1085 static v8::Handle<v8::Value> enforcedRangeUnsignedLongAttrAttrGetter(v8::Local<v
8::String> name, const v8::AccessorInfo& info) | |
| 1086 { | |
| 1087 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1088 return v8UnsignedInteger(imp->enforcedRangeUnsignedLongAttr(), info.GetIsola
te()); | |
| 1089 } | |
| 1090 | |
| 1091 static v8::Handle<v8::Value> enforcedRangeUnsignedLongAttrAttrGetterCallback(v8:
:Local<v8::String> name, const v8::AccessorInfo& info) | |
| 1092 { | |
| 1093 return TestObjV8Internal::enforcedRangeUnsignedLongAttrAttrGetter(name, info
); | |
| 1094 } | |
| 1095 | |
| 1096 static void enforcedRangeUnsignedLongAttrAttrSetter(v8::Local<v8::String> name,
v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 1097 { | |
| 1098 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1099 V8TRYCATCH_WITH_TYPECHECK_VOID(unsigned, v, toUInt32(value, EnforceRange, ok
), info.GetIsolate()); | |
| 1100 imp->setEnforcedRangeUnsignedLongAttr(v); | |
| 1101 return; | |
| 1102 } | |
| 1103 | |
| 1104 static void enforcedRangeUnsignedLongAttrAttrSetterCallback(v8::Local<v8::String
> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 1105 { | |
| 1106 TestObjV8Internal::enforcedRangeUnsignedLongAttrAttrSetter(name, value, info
); | |
| 1107 } | |
| 1108 | |
| 1109 static v8::Handle<v8::Value> enforcedRangeLongLongAttrAttrGetter(v8::Local<v8::S
tring> name, const v8::AccessorInfo& info) | |
| 1110 { | |
| 1111 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1112 return v8::Number::New(static_cast<double>(imp->enforcedRangeLongLongAttr())
); | |
| 1113 } | |
| 1114 | |
| 1115 static v8::Handle<v8::Value> enforcedRangeLongLongAttrAttrGetterCallback(v8::Loc
al<v8::String> name, const v8::AccessorInfo& info) | |
| 1116 { | |
| 1117 return TestObjV8Internal::enforcedRangeLongLongAttrAttrGetter(name, info); | |
| 1118 } | |
| 1119 | |
| 1120 static void enforcedRangeLongLongAttrAttrSetter(v8::Local<v8::String> name, v8::
Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 1121 { | |
| 1122 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1123 V8TRYCATCH_WITH_TYPECHECK_VOID(long long, v, toInt64(value, EnforceRange, ok
), info.GetIsolate()); | |
| 1124 imp->setEnforcedRangeLongLongAttr(v); | |
| 1125 return; | |
| 1126 } | |
| 1127 | |
| 1128 static void enforcedRangeLongLongAttrAttrSetterCallback(v8::Local<v8::String> na
me, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 1129 { | |
| 1130 TestObjV8Internal::enforcedRangeLongLongAttrAttrSetter(name, value, info); | |
| 1131 } | |
| 1132 | |
| 1133 static v8::Handle<v8::Value> enforcedRangeUnsignedLongLongAttrAttrGetter(v8::Loc
al<v8::String> name, const v8::AccessorInfo& info) | |
| 1134 { | |
| 1135 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1136 return v8::Number::New(static_cast<double>(imp->enforcedRangeUnsignedLongLon
gAttr())); | |
| 1137 } | |
| 1138 | |
| 1139 static v8::Handle<v8::Value> enforcedRangeUnsignedLongLongAttrAttrGetterCallback
(v8::Local<v8::String> name, const v8::AccessorInfo& info) | |
| 1140 { | |
| 1141 return TestObjV8Internal::enforcedRangeUnsignedLongLongAttrAttrGetter(name,
info); | |
| 1142 } | |
| 1143 | |
| 1144 static void enforcedRangeUnsignedLongLongAttrAttrSetter(v8::Local<v8::String> na
me, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 1145 { | |
| 1146 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1147 V8TRYCATCH_WITH_TYPECHECK_VOID(unsigned long long, v, toUInt64(value, Enforc
eRange, ok), info.GetIsolate()); | |
| 1148 imp->setEnforcedRangeUnsignedLongLongAttr(v); | |
| 1149 return; | |
| 1150 } | |
| 1151 | |
| 1152 static void enforcedRangeUnsignedLongLongAttrAttrSetterCallback(v8::Local<v8::St
ring> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 1153 { | |
| 1154 TestObjV8Internal::enforcedRangeUnsignedLongLongAttrAttrSetter(name, value,
info); | |
| 1155 } | |
| 1156 | |
| 1157 #if ENABLE(Condition1) | |
| 1158 | |
| 1159 static v8::Handle<v8::Value> conditionalAttr1AttrGetter(v8::Local<v8::String> na
me, const v8::AccessorInfo& info) | |
| 1160 { | |
| 1161 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1162 return v8Integer(imp->conditionalAttr1(), info.GetIsolate()); | |
| 1163 } | |
| 1164 | |
| 1165 #endif // ENABLE(Condition1) | |
| 1166 | |
| 1167 #if ENABLE(Condition1) | |
| 1168 | |
| 1169 static v8::Handle<v8::Value> conditionalAttr1AttrGetterCallback(v8::Local<v8::St
ring> name, const v8::AccessorInfo& info) | |
| 1170 { | |
| 1171 return TestObjV8Internal::conditionalAttr1AttrGetter(name, info); | |
| 1172 } | |
| 1173 | |
| 1174 #endif // ENABLE(Condition1) | |
| 1175 | |
| 1176 #if ENABLE(Condition1) | |
| 1177 | |
| 1178 static void conditionalAttr1AttrSetter(v8::Local<v8::String> name, v8::Local<v8:
:Value> value, const v8::AccessorInfo& info) | |
| 1179 { | |
| 1180 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1181 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
| 1182 imp->setConditionalAttr1(v); | |
| 1183 return; | |
| 1184 } | |
| 1185 | |
| 1186 #endif // ENABLE(Condition1) | |
| 1187 | |
| 1188 #if ENABLE(Condition1) | |
| 1189 | |
| 1190 static void conditionalAttr1AttrSetterCallback(v8::Local<v8::String> name, v8::L
ocal<v8::Value> value, const v8::AccessorInfo& info) | |
| 1191 { | |
| 1192 TestObjV8Internal::conditionalAttr1AttrSetter(name, value, info); | |
| 1193 } | |
| 1194 | |
| 1195 #endif // ENABLE(Condition1) | |
| 1196 | |
| 1197 #if ENABLE(Condition1) && ENABLE(Condition2) | |
| 1198 | |
| 1199 static v8::Handle<v8::Value> conditionalAttr2AttrGetter(v8::Local<v8::String> na
me, const v8::AccessorInfo& info) | |
| 1200 { | |
| 1201 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1202 return v8Integer(imp->conditionalAttr2(), info.GetIsolate()); | |
| 1203 } | |
| 1204 | |
| 1205 #endif // ENABLE(Condition1) && ENABLE(Condition2) | |
| 1206 | |
| 1207 #if ENABLE(Condition1) && ENABLE(Condition2) | |
| 1208 | |
| 1209 static v8::Handle<v8::Value> conditionalAttr2AttrGetterCallback(v8::Local<v8::St
ring> name, const v8::AccessorInfo& info) | |
| 1210 { | |
| 1211 return TestObjV8Internal::conditionalAttr2AttrGetter(name, info); | |
| 1212 } | |
| 1213 | |
| 1214 #endif // ENABLE(Condition1) && ENABLE(Condition2) | |
| 1215 | |
| 1216 #if ENABLE(Condition1) && ENABLE(Condition2) | |
| 1217 | |
| 1218 static void conditionalAttr2AttrSetter(v8::Local<v8::String> name, v8::Local<v8:
:Value> value, const v8::AccessorInfo& info) | |
| 1219 { | |
| 1220 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1221 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
| 1222 imp->setConditionalAttr2(v); | |
| 1223 return; | |
| 1224 } | |
| 1225 | |
| 1226 #endif // ENABLE(Condition1) && ENABLE(Condition2) | |
| 1227 | |
| 1228 #if ENABLE(Condition1) && ENABLE(Condition2) | |
| 1229 | |
| 1230 static void conditionalAttr2AttrSetterCallback(v8::Local<v8::String> name, v8::L
ocal<v8::Value> value, const v8::AccessorInfo& info) | |
| 1231 { | |
| 1232 TestObjV8Internal::conditionalAttr2AttrSetter(name, value, info); | |
| 1233 } | |
| 1234 | |
| 1235 #endif // ENABLE(Condition1) && ENABLE(Condition2) | |
| 1236 | |
| 1237 #if ENABLE(Condition1) || ENABLE(Condition2) | |
| 1238 | |
| 1239 static v8::Handle<v8::Value> conditionalAttr3AttrGetter(v8::Local<v8::String> na
me, const v8::AccessorInfo& info) | |
| 1240 { | |
| 1241 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1242 return v8Integer(imp->conditionalAttr3(), info.GetIsolate()); | |
| 1243 } | |
| 1244 | |
| 1245 #endif // ENABLE(Condition1) || ENABLE(Condition2) | |
| 1246 | |
| 1247 #if ENABLE(Condition1) || ENABLE(Condition2) | |
| 1248 | |
| 1249 static v8::Handle<v8::Value> conditionalAttr3AttrGetterCallback(v8::Local<v8::St
ring> name, const v8::AccessorInfo& info) | |
| 1250 { | |
| 1251 return TestObjV8Internal::conditionalAttr3AttrGetter(name, info); | |
| 1252 } | |
| 1253 | |
| 1254 #endif // ENABLE(Condition1) || ENABLE(Condition2) | |
| 1255 | |
| 1256 #if ENABLE(Condition1) || ENABLE(Condition2) | |
| 1257 | |
| 1258 static void conditionalAttr3AttrSetter(v8::Local<v8::String> name, v8::Local<v8:
:Value> value, const v8::AccessorInfo& info) | |
| 1259 { | |
| 1260 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1261 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
| 1262 imp->setConditionalAttr3(v); | |
| 1263 return; | |
| 1264 } | |
| 1265 | |
| 1266 #endif // ENABLE(Condition1) || ENABLE(Condition2) | |
| 1267 | |
| 1268 #if ENABLE(Condition1) || ENABLE(Condition2) | |
| 1269 | |
| 1270 static void conditionalAttr3AttrSetterCallback(v8::Local<v8::String> name, v8::L
ocal<v8::Value> value, const v8::AccessorInfo& info) | |
| 1271 { | |
| 1272 TestObjV8Internal::conditionalAttr3AttrSetter(name, value, info); | |
| 1273 } | |
| 1274 | |
| 1275 #endif // ENABLE(Condition1) || ENABLE(Condition2) | |
| 1276 | |
| 1277 static v8::Handle<v8::Value> cachedAttribute1AttrGetter(v8::Local<v8::String> na
me, const v8::AccessorInfo& info) | |
| 1278 { | |
| 1279 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1280 return imp->cachedAttribute1().v8Value(); | |
| 1281 } | |
| 1282 | |
| 1283 static v8::Handle<v8::Value> cachedAttribute1AttrGetterCallback(v8::Local<v8::St
ring> name, const v8::AccessorInfo& info) | |
| 1284 { | |
| 1285 return TestObjV8Internal::cachedAttribute1AttrGetter(name, info); | |
| 1286 } | |
| 1287 | |
| 1288 static v8::Handle<v8::Value> cachedAttribute2AttrGetter(v8::Local<v8::String> na
me, const v8::AccessorInfo& info) | |
| 1289 { | |
| 1290 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1291 return imp->cachedAttribute2().v8Value(); | |
| 1292 } | |
| 1293 | |
| 1294 static v8::Handle<v8::Value> cachedAttribute2AttrGetterCallback(v8::Local<v8::St
ring> name, const v8::AccessorInfo& info) | |
| 1295 { | |
| 1296 return TestObjV8Internal::cachedAttribute2AttrGetter(name, info); | |
| 1297 } | |
| 1298 | |
| 1299 static v8::Handle<v8::Value> anyAttributeAttrGetter(v8::Local<v8::String> name,
const v8::AccessorInfo& info) | |
| 1300 { | |
| 1301 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1302 return imp->anyAttribute().v8Value(); | |
| 1303 } | |
| 1304 | |
| 1305 static v8::Handle<v8::Value> anyAttributeAttrGetterCallback(v8::Local<v8::String
> name, const v8::AccessorInfo& info) | |
| 1306 { | |
| 1307 return TestObjV8Internal::anyAttributeAttrGetter(name, info); | |
| 1308 } | |
| 1309 | |
| 1310 static void anyAttributeAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Val
ue> value, const v8::AccessorInfo& info) | |
| 1311 { | |
| 1312 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1313 V8TRYCATCH_VOID(ScriptValue, v, ScriptValue(value)); | |
| 1314 imp->setAnyAttribute(WTF::getPtr(v)); | |
| 1315 return; | |
| 1316 } | |
| 1317 | |
| 1318 static void anyAttributeAttrSetterCallback(v8::Local<v8::String> name, v8::Local
<v8::Value> value, const v8::AccessorInfo& info) | |
| 1319 { | |
| 1320 TestObjV8Internal::anyAttributeAttrSetter(name, value, info); | |
| 1321 } | |
| 1322 | |
| 1323 static v8::Handle<v8::Value> enabledAtRuntimeAttr1AttrGetter(v8::Local<v8::Strin
g> name, const v8::AccessorInfo& info) | |
| 1324 { | |
| 1325 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1326 return v8Integer(imp->enabledAtRuntimeAttr1(), info.GetIsolate()); | |
| 1327 } | |
| 1328 | |
| 1329 static v8::Handle<v8::Value> enabledAtRuntimeAttr1AttrGetterCallback(v8::Local<v
8::String> name, const v8::AccessorInfo& info) | |
| 1330 { | |
| 1331 return TestObjV8Internal::enabledAtRuntimeAttr1AttrGetter(name, info); | |
| 1332 } | |
| 1333 | |
| 1334 static void enabledAtRuntimeAttr1AttrSetter(v8::Local<v8::String> name, v8::Loca
l<v8::Value> value, const v8::AccessorInfo& info) | |
| 1335 { | |
| 1336 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1337 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
| 1338 imp->setEnabledAtRuntimeAttr1(v); | |
| 1339 return; | |
| 1340 } | |
| 1341 | |
| 1342 static void enabledAtRuntimeAttr1AttrSetterCallback(v8::Local<v8::String> name,
v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 1343 { | |
| 1344 TestObjV8Internal::enabledAtRuntimeAttr1AttrSetter(name, value, info); | |
| 1345 } | |
| 1346 | |
| 1347 static v8::Handle<v8::Value> enabledAtRuntimeAttr2AttrGetter(v8::Local<v8::Strin
g> name, const v8::AccessorInfo& info) | |
| 1348 { | |
| 1349 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1350 return v8Integer(imp->enabledAtRuntimeAttr2(), info.GetIsolate()); | |
| 1351 } | |
| 1352 | |
| 1353 static v8::Handle<v8::Value> enabledAtRuntimeAttr2AttrGetterCallback(v8::Local<v
8::String> name, const v8::AccessorInfo& info) | |
| 1354 { | |
| 1355 return TestObjV8Internal::enabledAtRuntimeAttr2AttrGetter(name, info); | |
| 1356 } | |
| 1357 | |
| 1358 static void enabledAtRuntimeAttr2AttrSetter(v8::Local<v8::String> name, v8::Loca
l<v8::Value> value, const v8::AccessorInfo& info) | |
| 1359 { | |
| 1360 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1361 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
| 1362 imp->setEnabledAtRuntimeAttr2(v); | |
| 1363 return; | |
| 1364 } | |
| 1365 | |
| 1366 static void enabledAtRuntimeAttr2AttrSetterCallback(v8::Local<v8::String> name,
v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 1367 { | |
| 1368 TestObjV8Internal::enabledAtRuntimeAttr2AttrSetter(name, value, info); | |
| 1369 } | |
| 1370 | |
| 1371 static v8::Handle<v8::Value> enabledPerContextAttr1AttrGetter(v8::Local<v8::Stri
ng> name, const v8::AccessorInfo& info) | |
| 1372 { | |
| 1373 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1374 return v8Integer(imp->enabledPerContextAttr1(), info.GetIsolate()); | |
| 1375 } | |
| 1376 | |
| 1377 static v8::Handle<v8::Value> enabledPerContextAttr1AttrGetterCallback(v8::Local<
v8::String> name, const v8::AccessorInfo& info) | |
| 1378 { | |
| 1379 return TestObjV8Internal::enabledPerContextAttr1AttrGetter(name, info); | |
| 1380 } | |
| 1381 | |
| 1382 static void enabledPerContextAttr1AttrSetter(v8::Local<v8::String> name, v8::Loc
al<v8::Value> value, const v8::AccessorInfo& info) | |
| 1383 { | |
| 1384 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1385 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
| 1386 imp->setEnabledPerContextAttr1(v); | |
| 1387 return; | |
| 1388 } | |
| 1389 | |
| 1390 static void enabledPerContextAttr1AttrSetterCallback(v8::Local<v8::String> name,
v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 1391 { | |
| 1392 TestObjV8Internal::enabledPerContextAttr1AttrSetter(name, value, info); | |
| 1393 } | |
| 1394 | |
| 1395 static v8::Handle<v8::Value> enabledPerContextAttr2AttrGetter(v8::Local<v8::Stri
ng> name, const v8::AccessorInfo& info) | |
| 1396 { | |
| 1397 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1398 return v8Integer(imp->enabledPerContextAttr2(), info.GetIsolate()); | |
| 1399 } | |
| 1400 | |
| 1401 static v8::Handle<v8::Value> enabledPerContextAttr2AttrGetterCallback(v8::Local<
v8::String> name, const v8::AccessorInfo& info) | |
| 1402 { | |
| 1403 return TestObjV8Internal::enabledPerContextAttr2AttrGetter(name, info); | |
| 1404 } | |
| 1405 | |
| 1406 static void enabledPerContextAttr2AttrSetter(v8::Local<v8::String> name, v8::Loc
al<v8::Value> value, const v8::AccessorInfo& info) | |
| 1407 { | |
| 1408 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1409 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
| 1410 imp->setEnabledPerContextAttr2(v); | |
| 1411 return; | |
| 1412 } | |
| 1413 | |
| 1414 static void enabledPerContextAttr2AttrSetterCallback(v8::Local<v8::String> name,
v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 1415 { | |
| 1416 TestObjV8Internal::enabledPerContextAttr2AttrSetter(name, value, info); | |
| 1417 } | |
| 1418 | |
| 1419 static v8::Handle<v8::Value> floatArrayAttrGetter(v8::Local<v8::String> name, co
nst v8::AccessorInfo& info) | |
| 1420 { | |
| 1421 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1422 return v8Array(imp->floatArray(), info.GetIsolate()); | |
| 1423 } | |
| 1424 | |
| 1425 static v8::Handle<v8::Value> floatArrayAttrGetterCallback(v8::Local<v8::String>
name, const v8::AccessorInfo& info) | |
| 1426 { | |
| 1427 return TestObjV8Internal::floatArrayAttrGetter(name, info); | |
| 1428 } | |
| 1429 | |
| 1430 static void floatArrayAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value
> value, const v8::AccessorInfo& info) | |
| 1431 { | |
| 1432 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1433 V8TRYCATCH_VOID(Vector<float>, v, toNativeArray<float>(value)); | |
| 1434 imp->setFloatArray(v); | |
| 1435 return; | |
| 1436 } | |
| 1437 | |
| 1438 static void floatArrayAttrSetterCallback(v8::Local<v8::String> name, v8::Local<v
8::Value> value, const v8::AccessorInfo& info) | |
| 1439 { | |
| 1440 TestObjV8Internal::floatArrayAttrSetter(name, value, info); | |
| 1441 } | |
| 1442 | |
| 1443 static v8::Handle<v8::Value> doubleArrayAttrGetter(v8::Local<v8::String> name, c
onst v8::AccessorInfo& info) | |
| 1444 { | |
| 1445 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1446 return v8Array(imp->doubleArray(), info.GetIsolate()); | |
| 1447 } | |
| 1448 | |
| 1449 static v8::Handle<v8::Value> doubleArrayAttrGetterCallback(v8::Local<v8::String>
name, const v8::AccessorInfo& info) | |
| 1450 { | |
| 1451 return TestObjV8Internal::doubleArrayAttrGetter(name, info); | |
| 1452 } | |
| 1453 | |
| 1454 static void doubleArrayAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Valu
e> value, const v8::AccessorInfo& info) | |
| 1455 { | |
| 1456 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1457 V8TRYCATCH_VOID(Vector<double>, v, toNativeArray<double>(value)); | |
| 1458 imp->setDoubleArray(v); | |
| 1459 return; | |
| 1460 } | |
| 1461 | |
| 1462 static void doubleArrayAttrSetterCallback(v8::Local<v8::String> name, v8::Local<
v8::Value> value, const v8::AccessorInfo& info) | |
| 1463 { | |
| 1464 TestObjV8Internal::doubleArrayAttrSetter(name, value, info); | |
| 1465 } | |
| 1466 | |
| 1467 static v8::Handle<v8::Value> contentDocumentAttrGetter(v8::Local<v8::String> nam
e, const v8::AccessorInfo& info) | |
| 1468 { | |
| 1469 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1470 if (!BindingSecurity::shouldAllowAccessToNode(BindingState::instance(), imp-
>contentDocument())) | |
| 1471 return v8::Handle<v8::Value>(v8Null(info.GetIsolate())); | |
| 1472 | |
| 1473 return toV8Fast(imp->contentDocument(), info, imp); | |
| 1474 } | |
| 1475 | |
| 1476 static v8::Handle<v8::Value> contentDocumentAttrGetterCallback(v8::Local<v8::Str
ing> name, const v8::AccessorInfo& info) | |
| 1477 { | |
| 1478 return TestObjV8Internal::contentDocumentAttrGetter(name, info); | |
| 1479 } | |
| 1480 | |
| 1481 static v8::Handle<v8::Value> mutablePointAttrGetter(v8::Local<v8::String> name,
const v8::AccessorInfo& info) | |
| 1482 { | |
| 1483 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1484 return toV8Fast(WTF::getPtr(SVGStaticPropertyTearOff<TestObj, FloatPoint>::c
reate(imp, imp->mutablePoint(), &TestObj::updateMutablePoint)), info, imp); | |
| 1485 } | |
| 1486 | |
| 1487 static v8::Handle<v8::Value> mutablePointAttrGetterCallback(v8::Local<v8::String
> name, const v8::AccessorInfo& info) | |
| 1488 { | |
| 1489 return TestObjV8Internal::mutablePointAttrGetter(name, info); | |
| 1490 } | |
| 1491 | |
| 1492 static void mutablePointAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Val
ue> value, const v8::AccessorInfo& info) | |
| 1493 { | |
| 1494 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1495 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); | |
| 1496 imp->setMutablePoint(WTF::getPtr(v)); | |
| 1497 return; | |
| 1498 } | |
| 1499 | |
| 1500 static void mutablePointAttrSetterCallback(v8::Local<v8::String> name, v8::Local
<v8::Value> value, const v8::AccessorInfo& info) | |
| 1501 { | |
| 1502 TestObjV8Internal::mutablePointAttrSetter(name, value, info); | |
| 1503 } | |
| 1504 | |
| 1505 static v8::Handle<v8::Value> immutablePointAttrGetter(v8::Local<v8::String> name
, const v8::AccessorInfo& info) | |
| 1506 { | |
| 1507 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1508 return toV8Fast(WTF::getPtr(SVGPropertyTearOff<FloatPoint>::create(imp->immu
tablePoint())), info, imp); | |
| 1509 } | |
| 1510 | |
| 1511 static v8::Handle<v8::Value> immutablePointAttrGetterCallback(v8::Local<v8::Stri
ng> name, const v8::AccessorInfo& info) | |
| 1512 { | |
| 1513 return TestObjV8Internal::immutablePointAttrGetter(name, info); | |
| 1514 } | |
| 1515 | |
| 1516 static void immutablePointAttrSetter(v8::Local<v8::String> name, v8::Local<v8::V
alue> value, const v8::AccessorInfo& info) | |
| 1517 { | |
| 1518 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1519 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); | |
| 1520 imp->setImmutablePoint(WTF::getPtr(v)); | |
| 1521 return; | |
| 1522 } | |
| 1523 | |
| 1524 static void immutablePointAttrSetterCallback(v8::Local<v8::String> name, v8::Loc
al<v8::Value> value, const v8::AccessorInfo& info) | |
| 1525 { | |
| 1526 TestObjV8Internal::immutablePointAttrSetter(name, value, info); | |
| 1527 } | |
| 1528 | |
| 1529 static v8::Handle<v8::Value> strawberryAttrGetter(v8::Local<v8::String> name, co
nst v8::AccessorInfo& info) | |
| 1530 { | |
| 1531 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1532 return v8Integer(imp->blueberry(), info.GetIsolate()); | |
| 1533 } | |
| 1534 | |
| 1535 static v8::Handle<v8::Value> strawberryAttrGetterCallback(v8::Local<v8::String>
name, const v8::AccessorInfo& info) | |
| 1536 { | |
| 1537 return TestObjV8Internal::strawberryAttrGetter(name, info); | |
| 1538 } | |
| 1539 | |
| 1540 static void strawberryAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value
> value, const v8::AccessorInfo& info) | |
| 1541 { | |
| 1542 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1543 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
| 1544 imp->setBlueberry(v); | |
| 1545 return; | |
| 1546 } | |
| 1547 | |
| 1548 static void strawberryAttrSetterCallback(v8::Local<v8::String> name, v8::Local<v
8::Value> value, const v8::AccessorInfo& info) | |
| 1549 { | |
| 1550 TestObjV8Internal::strawberryAttrSetter(name, value, info); | |
| 1551 } | |
| 1552 | |
| 1553 static v8::Handle<v8::Value> strictFloatAttrGetter(v8::Local<v8::String> name, c
onst v8::AccessorInfo& info) | |
| 1554 { | |
| 1555 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1556 return v8::Number::New(imp->strictFloat()); | |
| 1557 } | |
| 1558 | |
| 1559 static v8::Handle<v8::Value> strictFloatAttrGetterCallback(v8::Local<v8::String>
name, const v8::AccessorInfo& info) | |
| 1560 { | |
| 1561 return TestObjV8Internal::strictFloatAttrGetter(name, info); | |
| 1562 } | |
| 1563 | |
| 1564 static void strictFloatAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Valu
e> value, const v8::AccessorInfo& info) | |
| 1565 { | |
| 1566 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1567 V8TRYCATCH_VOID(float, v, static_cast<float>(value->NumberValue())); | |
| 1568 imp->setStrictFloat(v); | |
| 1569 return; | |
| 1570 } | |
| 1571 | |
| 1572 static void strictFloatAttrSetterCallback(v8::Local<v8::String> name, v8::Local<
v8::Value> value, const v8::AccessorInfo& info) | |
| 1573 { | |
| 1574 TestObjV8Internal::strictFloatAttrSetter(name, value, info); | |
| 1575 } | |
| 1576 | |
| 1577 static v8::Handle<v8::Value> descriptionAttrGetter(v8::Local<v8::String> name, c
onst v8::AccessorInfo& info) | |
| 1578 { | |
| 1579 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1580 return v8Integer(imp->description(), info.GetIsolate()); | |
| 1581 } | |
| 1582 | |
| 1583 static v8::Handle<v8::Value> descriptionAttrGetterCallback(v8::Local<v8::String>
name, const v8::AccessorInfo& info) | |
| 1584 { | |
| 1585 return TestObjV8Internal::descriptionAttrGetter(name, info); | |
| 1586 } | |
| 1587 | |
| 1588 static v8::Handle<v8::Value> idAttrGetter(v8::Local<v8::String> name, const v8::
AccessorInfo& info) | |
| 1589 { | |
| 1590 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1591 return v8Integer(imp->id(), info.GetIsolate()); | |
| 1592 } | |
| 1593 | |
| 1594 static v8::Handle<v8::Value> idAttrGetterCallback(v8::Local<v8::String> name, co
nst v8::AccessorInfo& info) | |
| 1595 { | |
| 1596 return TestObjV8Internal::idAttrGetter(name, info); | |
| 1597 } | |
| 1598 | |
| 1599 static void idAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value,
const v8::AccessorInfo& info) | |
| 1600 { | |
| 1601 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1602 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
| 1603 imp->setId(v); | |
| 1604 return; | |
| 1605 } | |
| 1606 | |
| 1607 static void idAttrSetterCallback(v8::Local<v8::String> name, v8::Local<v8::Value
> value, const v8::AccessorInfo& info) | |
| 1608 { | |
| 1609 TestObjV8Internal::idAttrSetter(name, value, info); | |
| 1610 } | |
| 1611 | |
| 1612 static v8::Handle<v8::Value> hashAttrGetter(v8::Local<v8::String> name, const v8
::AccessorInfo& info) | |
| 1613 { | |
| 1614 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1615 return v8String(imp->hash(), info.GetIsolate(), ReturnUnsafeHandle); | |
| 1616 } | |
| 1617 | |
| 1618 static v8::Handle<v8::Value> hashAttrGetterCallback(v8::Local<v8::String> name,
const v8::AccessorInfo& info) | |
| 1619 { | |
| 1620 return TestObjV8Internal::hashAttrGetter(name, info); | |
| 1621 } | |
| 1622 | |
| 1623 static v8::Handle<v8::Value> replaceableAttributeAttrGetter(v8::Local<v8::String
> name, const v8::AccessorInfo& info) | |
| 1624 { | |
| 1625 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1626 return v8Integer(imp->replaceableAttribute(), info.GetIsolate()); | |
| 1627 } | |
| 1628 | |
| 1629 static v8::Handle<v8::Value> replaceableAttributeAttrGetterCallback(v8::Local<v8
::String> name, const v8::AccessorInfo& info) | |
| 1630 { | |
| 1631 return TestObjV8Internal::replaceableAttributeAttrGetter(name, info); | |
| 1632 } | |
| 1633 | |
| 1634 static v8::Handle<v8::Value> nullableDoubleAttributeAttrGetter(v8::Local<v8::Str
ing> name, const v8::AccessorInfo& info) | |
| 1635 { | |
| 1636 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1637 bool isNull = false; | |
| 1638 double v = imp->nullableDoubleAttribute(isNull); | |
| 1639 if (isNull) | |
| 1640 return v8Null(info.GetIsolate()); | |
| 1641 return v8::Number::New(v); | |
| 1642 } | |
| 1643 | |
| 1644 static v8::Handle<v8::Value> nullableDoubleAttributeAttrGetterCallback(v8::Local
<v8::String> name, const v8::AccessorInfo& info) | |
| 1645 { | |
| 1646 return TestObjV8Internal::nullableDoubleAttributeAttrGetter(name, info); | |
| 1647 } | |
| 1648 | |
| 1649 static v8::Handle<v8::Value> nullableLongAttributeAttrGetter(v8::Local<v8::Strin
g> name, const v8::AccessorInfo& info) | |
| 1650 { | |
| 1651 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1652 bool isNull = false; | |
| 1653 int v = imp->nullableLongAttribute(isNull); | |
| 1654 if (isNull) | |
| 1655 return v8Null(info.GetIsolate()); | |
| 1656 return v8Integer(v, info.GetIsolate()); | |
| 1657 } | |
| 1658 | |
| 1659 static v8::Handle<v8::Value> nullableLongAttributeAttrGetterCallback(v8::Local<v
8::String> name, const v8::AccessorInfo& info) | |
| 1660 { | |
| 1661 return TestObjV8Internal::nullableLongAttributeAttrGetter(name, info); | |
| 1662 } | |
| 1663 | |
| 1664 static v8::Handle<v8::Value> nullableBooleanAttributeAttrGetter(v8::Local<v8::St
ring> name, const v8::AccessorInfo& info) | |
| 1665 { | |
| 1666 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1667 bool isNull = false; | |
| 1668 bool v = imp->nullableBooleanAttribute(isNull); | |
| 1669 if (isNull) | |
| 1670 return v8Null(info.GetIsolate()); | |
| 1671 return v8Boolean(v, info.GetIsolate()); | |
| 1672 } | |
| 1673 | |
| 1674 static v8::Handle<v8::Value> nullableBooleanAttributeAttrGetterCallback(v8::Loca
l<v8::String> name, const v8::AccessorInfo& info) | |
| 1675 { | |
| 1676 return TestObjV8Internal::nullableBooleanAttributeAttrGetter(name, info); | |
| 1677 } | |
| 1678 | |
| 1679 static v8::Handle<v8::Value> nullableStringAttributeAttrGetter(v8::Local<v8::Str
ing> name, const v8::AccessorInfo& info) | |
| 1680 { | |
| 1681 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1682 bool isNull = false; | |
| 1683 String v = imp->nullableStringAttribute(isNull); | |
| 1684 if (isNull) | |
| 1685 return v8Null(info.GetIsolate()); | |
| 1686 return v8String(v, info.GetIsolate(), ReturnUnsafeHandle); | |
| 1687 } | |
| 1688 | |
| 1689 static v8::Handle<v8::Value> nullableStringAttributeAttrGetterCallback(v8::Local
<v8::String> name, const v8::AccessorInfo& info) | |
| 1690 { | |
| 1691 return TestObjV8Internal::nullableStringAttributeAttrGetter(name, info); | |
| 1692 } | |
| 1693 | |
| 1694 static v8::Handle<v8::Value> nullableLongSettableAttributeAttrGetter(v8::Local<v
8::String> name, const v8::AccessorInfo& info) | |
| 1695 { | |
| 1696 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1697 bool isNull = false; | |
| 1698 int v = imp->nullableLongSettableAttribute(isNull); | |
| 1699 if (isNull) | |
| 1700 return v8Null(info.GetIsolate()); | |
| 1701 return v8Integer(v, info.GetIsolate()); | |
| 1702 } | |
| 1703 | |
| 1704 static v8::Handle<v8::Value> nullableLongSettableAttributeAttrGetterCallback(v8:
:Local<v8::String> name, const v8::AccessorInfo& info) | |
| 1705 { | |
| 1706 return TestObjV8Internal::nullableLongSettableAttributeAttrGetter(name, info
); | |
| 1707 } | |
| 1708 | |
| 1709 static void nullableLongSettableAttributeAttrSetter(v8::Local<v8::String> name,
v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 1710 { | |
| 1711 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1712 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
| 1713 imp->setNullableLongSettableAttribute(v); | |
| 1714 return; | |
| 1715 } | |
| 1716 | |
| 1717 static void nullableLongSettableAttributeAttrSetterCallback(v8::Local<v8::String
> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 1718 { | |
| 1719 TestObjV8Internal::nullableLongSettableAttributeAttrSetter(name, value, info
); | |
| 1720 } | |
| 1721 | |
| 1722 static v8::Handle<v8::Value> nullableStringValueAttrGetter(v8::Local<v8::String>
name, const v8::AccessorInfo& info) | |
| 1723 { | |
| 1724 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1725 ExceptionCode ec = 0; | |
| 1726 bool isNull = false; | |
| 1727 int v = imp->nullableStringValue(isNull, ec); | |
| 1728 if (isNull) | |
| 1729 return v8Null(info.GetIsolate()); | |
| 1730 if (UNLIKELY(ec)) | |
| 1731 return setDOMException(ec, info.GetIsolate()); | |
| 1732 return v8Integer(v, info.GetIsolate()); | |
| 1733 } | |
| 1734 | |
| 1735 static v8::Handle<v8::Value> nullableStringValueAttrGetterCallback(v8::Local<v8:
:String> name, const v8::AccessorInfo& info) | |
| 1736 { | |
| 1737 return TestObjV8Internal::nullableStringValueAttrGetter(name, info); | |
| 1738 } | |
| 1739 | |
| 1740 static void nullableStringValueAttrSetter(v8::Local<v8::String> name, v8::Local<
v8::Value> value, const v8::AccessorInfo& info) | |
| 1741 { | |
| 1742 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1743 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
| 1744 imp->setNullableStringValue(v); | |
| 1745 return; | |
| 1746 } | |
| 1747 | |
| 1748 static void nullableStringValueAttrSetterCallback(v8::Local<v8::String> name, v8
::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 1749 { | |
| 1750 TestObjV8Internal::nullableStringValueAttrSetter(name, value, info); | |
| 1751 } | |
| 1752 | |
| 1753 static v8::Handle<v8::Value> perWorldReadOnlyAttributeAttrGetter(v8::Local<v8::S
tring> name, const v8::AccessorInfo& info) | |
| 1754 { | |
| 1755 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1756 RefPtr<TestObj> result = imp->perWorldReadOnlyAttribute(); | |
| 1757 v8::Handle<v8::Value> wrapper = result.get() ? v8::Handle<v8::Value>(DOMData
Store::getWrapper(result.get(), info.GetIsolate())) : v8Undefined(); | |
| 1758 if (wrapper.IsEmpty()) { | |
| 1759 wrapper = toV8(result.get(), info.Holder(), info.GetIsolate()); | |
| 1760 if (!wrapper.IsEmpty()) | |
| 1761 V8HiddenPropertyName::setNamedHiddenReference(info.Holder(), "perWor
ldReadOnlyAttribute", wrapper); | |
| 1762 } | |
| 1763 return wrapper; | |
| 1764 } | |
| 1765 | |
| 1766 static v8::Handle<v8::Value> perWorldReadOnlyAttributeAttrGetterCallback(v8::Loc
al<v8::String> name, const v8::AccessorInfo& info) | |
| 1767 { | |
| 1768 return TestObjV8Internal::perWorldReadOnlyAttributeAttrGetter(name, info); | |
| 1769 } | |
| 1770 | |
| 1771 static v8::Handle<v8::Value> perWorldReadOnlyAttributeAttrGetterForMainWorld(v8:
:Local<v8::String> name, const v8::AccessorInfo& info) | |
| 1772 { | |
| 1773 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1774 RefPtr<TestObj> result = imp->perWorldReadOnlyAttribute(); | |
| 1775 v8::Handle<v8::Value> wrapper = result.get() ? v8::Handle<v8::Value>(DOMData
Store::getWrapper(result.get(), info.GetIsolate())) : v8Undefined(); | |
| 1776 if (wrapper.IsEmpty()) { | |
| 1777 wrapper = toV8(result.get(), info.Holder(), info.GetIsolate()); | |
| 1778 if (!wrapper.IsEmpty()) | |
| 1779 V8HiddenPropertyName::setNamedHiddenReference(info.Holder(), "perWor
ldReadOnlyAttribute", wrapper); | |
| 1780 } | |
| 1781 return wrapper; | |
| 1782 } | |
| 1783 | |
| 1784 static v8::Handle<v8::Value> perWorldReadOnlyAttributeAttrGetterCallbackForMainW
orld(v8::Local<v8::String> name, const v8::AccessorInfo& info) | |
| 1785 { | |
| 1786 return TestObjV8Internal::perWorldReadOnlyAttributeAttrGetterForMainWorld(na
me, info); | |
| 1787 } | |
| 1788 | |
| 1789 static v8::Handle<v8::Value> perWorldAttributeAttrGetter(v8::Local<v8::String> n
ame, const v8::AccessorInfo& info) | |
| 1790 { | |
| 1791 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1792 return toV8Fast(imp->perWorldAttribute(), info, imp); | |
| 1793 } | |
| 1794 | |
| 1795 static v8::Handle<v8::Value> perWorldAttributeAttrGetterCallback(v8::Local<v8::S
tring> name, const v8::AccessorInfo& info) | |
| 1796 { | |
| 1797 return TestObjV8Internal::perWorldAttributeAttrGetter(name, info); | |
| 1798 } | |
| 1799 | |
| 1800 static v8::Handle<v8::Value> perWorldAttributeAttrGetterForMainWorld(v8::Local<v
8::String> name, const v8::AccessorInfo& info) | |
| 1801 { | |
| 1802 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1803 return toV8FastForMainWorld(imp->perWorldAttribute(), info, imp); | |
| 1804 } | |
| 1805 | |
| 1806 static v8::Handle<v8::Value> perWorldAttributeAttrGetterCallbackForMainWorld(v8:
:Local<v8::String> name, const v8::AccessorInfo& info) | |
| 1807 { | |
| 1808 return TestObjV8Internal::perWorldAttributeAttrGetterForMainWorld(name, info
); | |
| 1809 } | |
| 1810 | |
| 1811 static void perWorldAttributeAttrSetter(v8::Local<v8::String> name, v8::Local<v8
::Value> value, const v8::AccessorInfo& info) | |
| 1812 { | |
| 1813 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1814 V8TRYCATCH_VOID(TestObj*, v, V8TestObj::HasInstance(value, info.GetIsolate()
, worldType(info.GetIsolate())) ? V8TestObj::toNative(v8::Handle<v8::Object>::Ca
st(value)) : 0); | |
| 1815 imp->setPerWorldAttribute(WTF::getPtr(v)); | |
| 1816 return; | |
| 1817 } | |
| 1818 | |
| 1819 static void perWorldAttributeAttrSetterCallback(v8::Local<v8::String> name, v8::
Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 1820 { | |
| 1821 TestObjV8Internal::perWorldAttributeAttrSetter(name, value, info); | |
| 1822 } | |
| 1823 | |
| 1824 static void perWorldAttributeAttrSetterForMainWorld(v8::Local<v8::String> name,
v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 1825 { | |
| 1826 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1827 V8TRYCATCH_VOID(TestObj*, v, V8TestObj::HasInstance(value, info.GetIsolate()
, worldType(info.GetIsolate())) ? V8TestObj::toNative(v8::Handle<v8::Object>::Ca
st(value)) : 0); | |
| 1828 imp->setPerWorldAttribute(WTF::getPtr(v)); | |
| 1829 return; | |
| 1830 } | |
| 1831 | |
| 1832 static void perWorldAttributeAttrSetterCallbackForMainWorld(v8::Local<v8::String
> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 1833 { | |
| 1834 TestObjV8Internal::perWorldAttributeAttrSetterForMainWorld(name, value, info
); | |
| 1835 } | |
| 1836 | |
| 1837 static v8::Handle<v8::Value> TestObjConstructorGetter(v8::Local<v8::String> name
, const v8::AccessorInfo& info) | |
| 1838 { | |
| 1839 v8::Handle<v8::Value> data = info.Data(); | |
| 1840 ASSERT(data->IsExternal()); | |
| 1841 V8PerContextData* perContextData = V8PerContextData::from(info.Holder()->Cre
ationContext()); | |
| 1842 if (!perContextData) | |
| 1843 return v8Undefined(); | |
| 1844 return perContextData->constructorForType(WrapperTypeInfo::unwrap(data)); | |
| 1845 } | |
| 1846 static void TestObjReplaceableAttrSetter(v8::Local<v8::String> name, v8::Local<v
8::Value> value, const v8::AccessorInfo& info) | |
| 1847 { | |
| 1848 info.This()->ForceSet(name, value); | |
| 1849 } | |
| 1850 | |
| 1851 static void TestObjReplaceableAttrSetterCallback(v8::Local<v8::String> name, v8:
:Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 1852 { | |
| 1853 return TestObjV8Internal::TestObjReplaceableAttrSetter(name, value, info); | |
| 1854 } | |
| 1855 | |
| 1856 static v8::Handle<v8::Value> voidMethodMethod(const v8::Arguments& args) | |
| 1857 { | |
| 1858 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 1859 imp->voidMethod(); | |
| 1860 return v8Undefined(); | |
| 1861 } | |
| 1862 | |
| 1863 static v8::Handle<v8::Value> voidMethodMethodCallback(const v8::Arguments& args) | |
| 1864 { | |
| 1865 return TestObjV8Internal::voidMethodMethod(args); | |
| 1866 } | |
| 1867 | |
| 1868 static v8::Handle<v8::Value> voidMethodWithArgsMethod(const v8::Arguments& args) | |
| 1869 { | |
| 1870 if (args.Length() < 3) | |
| 1871 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 1872 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 1873 V8TRYCATCH(int, longArg, toInt32(args[0])); | |
| 1874 V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, strArg, args[1]); | |
| 1875 V8TRYCATCH(TestObj*, objArg, V8TestObj::HasInstance(args[2], args.GetIsolate
(), worldType(args.GetIsolate())) ? V8TestObj::toNative(v8::Handle<v8::Object>::
Cast(args[2])) : 0); | |
| 1876 imp->voidMethodWithArgs(longArg, strArg, objArg); | |
| 1877 return v8Undefined(); | |
| 1878 } | |
| 1879 | |
| 1880 static v8::Handle<v8::Value> voidMethodWithArgsMethodCallback(const v8::Argument
s& args) | |
| 1881 { | |
| 1882 return TestObjV8Internal::voidMethodWithArgsMethod(args); | |
| 1883 } | |
| 1884 | |
| 1885 static v8::Handle<v8::Value> longMethodMethod(const v8::Arguments& args) | |
| 1886 { | |
| 1887 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 1888 return v8Integer(imp->longMethod(), args.GetIsolate()); | |
| 1889 } | |
| 1890 | |
| 1891 static v8::Handle<v8::Value> longMethodMethodCallback(const v8::Arguments& args) | |
| 1892 { | |
| 1893 return TestObjV8Internal::longMethodMethod(args); | |
| 1894 } | |
| 1895 | |
| 1896 static v8::Handle<v8::Value> longMethodWithArgsMethod(const v8::Arguments& args) | |
| 1897 { | |
| 1898 if (args.Length() < 3) | |
| 1899 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 1900 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 1901 V8TRYCATCH(int, longArg, toInt32(args[0])); | |
| 1902 V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, strArg, args[1]); | |
| 1903 V8TRYCATCH(TestObj*, objArg, V8TestObj::HasInstance(args[2], args.GetIsolate
(), worldType(args.GetIsolate())) ? V8TestObj::toNative(v8::Handle<v8::Object>::
Cast(args[2])) : 0); | |
| 1904 return v8Integer(imp->longMethodWithArgs(longArg, strArg, objArg), args.GetI
solate()); | |
| 1905 } | |
| 1906 | |
| 1907 static v8::Handle<v8::Value> longMethodWithArgsMethodCallback(const v8::Argument
s& args) | |
| 1908 { | |
| 1909 return TestObjV8Internal::longMethodWithArgsMethod(args); | |
| 1910 } | |
| 1911 | |
| 1912 static v8::Handle<v8::Value> objMethodMethod(const v8::Arguments& args) | |
| 1913 { | |
| 1914 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 1915 return toV8(imp->objMethod(), args.Holder(), args.GetIsolate()); | |
| 1916 } | |
| 1917 | |
| 1918 static v8::Handle<v8::Value> objMethodMethodCallback(const v8::Arguments& args) | |
| 1919 { | |
| 1920 FeatureObserver::observe(activeDOMWindow(BindingState::instance()), FeatureO
bserver::TestFeature); | |
| 1921 return TestObjV8Internal::objMethodMethod(args); | |
| 1922 } | |
| 1923 | |
| 1924 static v8::Handle<v8::Value> objMethodWithArgsMethod(const v8::Arguments& args) | |
| 1925 { | |
| 1926 if (args.Length() < 3) | |
| 1927 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 1928 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 1929 V8TRYCATCH(int, longArg, toInt32(args[0])); | |
| 1930 V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, strArg, args[1]); | |
| 1931 V8TRYCATCH(TestObj*, objArg, V8TestObj::HasInstance(args[2], args.GetIsolate
(), worldType(args.GetIsolate())) ? V8TestObj::toNative(v8::Handle<v8::Object>::
Cast(args[2])) : 0); | |
| 1932 return toV8(imp->objMethodWithArgs(longArg, strArg, objArg), args.Holder(),
args.GetIsolate()); | |
| 1933 } | |
| 1934 | |
| 1935 static v8::Handle<v8::Value> objMethodWithArgsMethodCallback(const v8::Arguments
& args) | |
| 1936 { | |
| 1937 return TestObjV8Internal::objMethodWithArgsMethod(args); | |
| 1938 } | |
| 1939 | |
| 1940 static v8::Handle<v8::Value> methodWithSequenceArgMethod(const v8::Arguments& ar
gs) | |
| 1941 { | |
| 1942 if (args.Length() < 1) | |
| 1943 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 1944 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 1945 V8TRYCATCH(Vector<RefPtr<ScriptProfile> >, sequenceArg, (toRefPtrNativeArray
<ScriptProfile, V8ScriptProfile>(args[0], args.GetIsolate()))); | |
| 1946 imp->methodWithSequenceArg(sequenceArg); | |
| 1947 return v8Undefined(); | |
| 1948 } | |
| 1949 | |
| 1950 static v8::Handle<v8::Value> methodWithSequenceArgMethodCallback(const v8::Argum
ents& args) | |
| 1951 { | |
| 1952 return TestObjV8Internal::methodWithSequenceArgMethod(args); | |
| 1953 } | |
| 1954 | |
| 1955 static v8::Handle<v8::Value> methodReturningSequenceMethod(const v8::Arguments&
args) | |
| 1956 { | |
| 1957 if (args.Length() < 1) | |
| 1958 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 1959 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 1960 V8TRYCATCH(int, longArg, toInt32(args[0])); | |
| 1961 return v8Array(imp->methodReturningSequence(longArg), args.GetIsolate()); | |
| 1962 } | |
| 1963 | |
| 1964 static v8::Handle<v8::Value> methodReturningSequenceMethodCallback(const v8::Arg
uments& args) | |
| 1965 { | |
| 1966 return TestObjV8Internal::methodReturningSequenceMethod(args); | |
| 1967 } | |
| 1968 | |
| 1969 static v8::Handle<v8::Value> methodWithEnumArgMethod(const v8::Arguments& args) | |
| 1970 { | |
| 1971 if (args.Length() < 1) | |
| 1972 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 1973 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 1974 V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, enumArg, args[0]); | |
| 1975 String string = enumArg; | |
| 1976 if (!(string == "" || string == "EnumValue1" || string == "EnumValue2" || st
ring == "EnumValue3")) | |
| 1977 return throwTypeError(0, args.GetIsolate()); | |
| 1978 imp->methodWithEnumArg(enumArg); | |
| 1979 return v8Undefined(); | |
| 1980 } | |
| 1981 | |
| 1982 static v8::Handle<v8::Value> methodWithEnumArgMethodCallback(const v8::Arguments
& args) | |
| 1983 { | |
| 1984 return TestObjV8Internal::methodWithEnumArgMethod(args); | |
| 1985 } | |
| 1986 | |
| 1987 static v8::Handle<v8::Value> methodThatRequiresAllArgsAndThrowsMethod(const v8::
Arguments& args) | |
| 1988 { | |
| 1989 if (args.Length() < 2) | |
| 1990 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 1991 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 1992 ExceptionCode ec = 0; | |
| 1993 { | |
| 1994 V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, strArg, args[0]); | |
| 1995 V8TRYCATCH(TestObj*, objArg, V8TestObj::HasInstance(args[1], args.GetIsolate
(), worldType(args.GetIsolate())) ? V8TestObj::toNative(v8::Handle<v8::Object>::
Cast(args[1])) : 0); | |
| 1996 RefPtr<TestObj> result = imp->methodThatRequiresAllArgsAndThrows(strArg, obj
Arg, ec); | |
| 1997 if (UNLIKELY(ec)) | |
| 1998 goto fail; | |
| 1999 return toV8(result.release(), args.Holder(), args.GetIsolate()); | |
| 2000 } | |
| 2001 fail: | |
| 2002 return setDOMException(ec, args.GetIsolate()); | |
| 2003 } | |
| 2004 | |
| 2005 static v8::Handle<v8::Value> methodThatRequiresAllArgsAndThrowsMethodCallback(co
nst v8::Arguments& args) | |
| 2006 { | |
| 2007 return TestObjV8Internal::methodThatRequiresAllArgsAndThrowsMethod(args); | |
| 2008 } | |
| 2009 | |
| 2010 static v8::Handle<v8::Value> serializedValueMethod(const v8::Arguments& args) | |
| 2011 { | |
| 2012 if (args.Length() < 1) | |
| 2013 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 2014 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2015 bool serializedArgDidThrow = false; | |
| 2016 RefPtr<SerializedScriptValue> serializedArg = SerializedScriptValue::create(
args[0], 0, 0, serializedArgDidThrow, args.GetIsolate()); | |
| 2017 if (serializedArgDidThrow) | |
| 2018 return v8Undefined(); | |
| 2019 imp->serializedValue(serializedArg); | |
| 2020 return v8Undefined(); | |
| 2021 } | |
| 2022 | |
| 2023 static v8::Handle<v8::Value> serializedValueMethodCallback(const v8::Arguments&
args) | |
| 2024 { | |
| 2025 return TestObjV8Internal::serializedValueMethod(args); | |
| 2026 } | |
| 2027 | |
| 2028 static v8::Handle<v8::Value> optionsObjectMethod(const v8::Arguments& args) | |
| 2029 { | |
| 2030 if (args.Length() < 1) | |
| 2031 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 2032 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2033 V8TRYCATCH(Dictionary, oo, Dictionary(args[0], args.GetIsolate())); | |
| 2034 if (!oo.isUndefinedOrNull() && !oo.isObject()) | |
| 2035 return throwTypeError("Not an object.", args.GetIsolate()); | |
| 2036 V8TRYCATCH(Dictionary, ooo, Dictionary(args[1], args.GetIsolate())); | |
| 2037 if (!ooo.isUndefinedOrNull() && !ooo.isObject()) | |
| 2038 return throwTypeError("Not an object.", args.GetIsolate()); | |
| 2039 imp->optionsObject(oo, ooo); | |
| 2040 return v8Undefined(); | |
| 2041 } | |
| 2042 | |
| 2043 static v8::Handle<v8::Value> optionsObjectMethodCallback(const v8::Arguments& ar
gs) | |
| 2044 { | |
| 2045 return TestObjV8Internal::optionsObjectMethod(args); | |
| 2046 } | |
| 2047 | |
| 2048 static v8::Handle<v8::Value> methodWithExceptionMethod(const v8::Arguments& args
) | |
| 2049 { | |
| 2050 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2051 ExceptionCode ec = 0; | |
| 2052 { | |
| 2053 imp->methodWithException(ec); | |
| 2054 if (UNLIKELY(ec)) | |
| 2055 goto fail; | |
| 2056 return v8Undefined(); | |
| 2057 } | |
| 2058 fail: | |
| 2059 return setDOMException(ec, args.GetIsolate()); | |
| 2060 } | |
| 2061 | |
| 2062 static v8::Handle<v8::Value> methodWithExceptionMethodCallback(const v8::Argumen
ts& args) | |
| 2063 { | |
| 2064 return TestObjV8Internal::methodWithExceptionMethod(args); | |
| 2065 } | |
| 2066 | |
| 2067 static v8::Handle<v8::Value> customMethodMethodCallback(const v8::Arguments& arg
s) | |
| 2068 { | |
| 2069 FeatureObserver::observe(activeDOMWindow(BindingState::instance()), FeatureO
bserver::CustomTestFeature); | |
| 2070 return V8TestObj::customMethodMethodCustom(args); | |
| 2071 } | |
| 2072 | |
| 2073 static v8::Handle<v8::Value> customMethodWithArgsMethodCallback(const v8::Argume
nts& args) | |
| 2074 { | |
| 2075 return V8TestObj::customMethodWithArgsMethodCustom(args); | |
| 2076 } | |
| 2077 | |
| 2078 static v8::Handle<v8::Value> addEventListenerMethod(const v8::Arguments& args) | |
| 2079 { | |
| 2080 RefPtr<EventListener> listener = V8EventListenerList::getEventListener(args[
1], false, ListenerFindOrCreate); | |
| 2081 if (listener) { | |
| 2082 V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<WithNullCheck>, stringR
esource, args[0]); | |
| 2083 V8TestObj::toNative(args.Holder())->addEventListener(stringResource, lis
tener, args[2]->BooleanValue()); | |
| 2084 createHiddenDependency(args.Holder(), args[1], V8TestObj::eventListenerC
acheIndex, args.GetIsolate()); | |
| 2085 } | |
| 2086 return v8Undefined(); | |
| 2087 } | |
| 2088 | |
| 2089 static v8::Handle<v8::Value> addEventListenerMethodCallback(const v8::Arguments&
args) | |
| 2090 { | |
| 2091 return TestObjV8Internal::addEventListenerMethod(args); | |
| 2092 } | |
| 2093 | |
| 2094 static v8::Handle<v8::Value> removeEventListenerMethod(const v8::Arguments& args
) | |
| 2095 { | |
| 2096 RefPtr<EventListener> listener = V8EventListenerList::getEventListener(args[
1], false, ListenerFindOnly); | |
| 2097 if (listener) { | |
| 2098 V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<WithNullCheck>, stringR
esource, args[0]); | |
| 2099 V8TestObj::toNative(args.Holder())->removeEventListener(stringResource,
listener.get(), args[2]->BooleanValue()); | |
| 2100 removeHiddenDependency(args.Holder(), args[1], V8TestObj::eventListenerC
acheIndex, args.GetIsolate()); | |
| 2101 } | |
| 2102 return v8Undefined(); | |
| 2103 } | |
| 2104 | |
| 2105 static v8::Handle<v8::Value> removeEventListenerMethodCallback(const v8::Argumen
ts& args) | |
| 2106 { | |
| 2107 return TestObjV8Internal::removeEventListenerMethod(args); | |
| 2108 } | |
| 2109 | |
| 2110 static v8::Handle<v8::Value> withScriptStateVoidMethod(const v8::Arguments& args
) | |
| 2111 { | |
| 2112 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2113 ScriptState* currentState = ScriptState::current(); | |
| 2114 if (!currentState) | |
| 2115 return v8Undefined(); | |
| 2116 ScriptState& state = *currentState; | |
| 2117 imp->withScriptStateVoid(&state); | |
| 2118 if (state.hadException()) { | |
| 2119 v8::Local<v8::Value> exception = state.exception(); | |
| 2120 state.clearException(); | |
| 2121 return throwError(exception, args.GetIsolate()); | |
| 2122 } | |
| 2123 return v8Undefined(); | |
| 2124 } | |
| 2125 | |
| 2126 static v8::Handle<v8::Value> withScriptStateVoidMethodCallback(const v8::Argumen
ts& args) | |
| 2127 { | |
| 2128 return TestObjV8Internal::withScriptStateVoidMethod(args); | |
| 2129 } | |
| 2130 | |
| 2131 static v8::Handle<v8::Value> withScriptStateObjMethod(const v8::Arguments& args) | |
| 2132 { | |
| 2133 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2134 ScriptState* currentState = ScriptState::current(); | |
| 2135 if (!currentState) | |
| 2136 return v8Undefined(); | |
| 2137 ScriptState& state = *currentState; | |
| 2138 RefPtr<TestObj> result = imp->withScriptStateObj(&state); | |
| 2139 if (state.hadException()) { | |
| 2140 v8::Local<v8::Value> exception = state.exception(); | |
| 2141 state.clearException(); | |
| 2142 return throwError(exception, args.GetIsolate()); | |
| 2143 } | |
| 2144 return toV8(result.release(), args.Holder(), args.GetIsolate()); | |
| 2145 } | |
| 2146 | |
| 2147 static v8::Handle<v8::Value> withScriptStateObjMethodCallback(const v8::Argument
s& args) | |
| 2148 { | |
| 2149 return TestObjV8Internal::withScriptStateObjMethod(args); | |
| 2150 } | |
| 2151 | |
| 2152 static v8::Handle<v8::Value> withScriptStateVoidExceptionMethod(const v8::Argume
nts& args) | |
| 2153 { | |
| 2154 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2155 ExceptionCode ec = 0; | |
| 2156 { | |
| 2157 ScriptState* currentState = ScriptState::current(); | |
| 2158 if (!currentState) | |
| 2159 return v8Undefined(); | |
| 2160 ScriptState& state = *currentState; | |
| 2161 imp->withScriptStateVoidException(&state, ec); | |
| 2162 if (UNLIKELY(ec)) | |
| 2163 goto fail; | |
| 2164 if (state.hadException()) { | |
| 2165 v8::Local<v8::Value> exception = state.exception(); | |
| 2166 state.clearException(); | |
| 2167 return throwError(exception, args.GetIsolate()); | |
| 2168 } | |
| 2169 return v8Undefined(); | |
| 2170 } | |
| 2171 fail: | |
| 2172 return setDOMException(ec, args.GetIsolate()); | |
| 2173 } | |
| 2174 | |
| 2175 static v8::Handle<v8::Value> withScriptStateVoidExceptionMethodCallback(const v8
::Arguments& args) | |
| 2176 { | |
| 2177 return TestObjV8Internal::withScriptStateVoidExceptionMethod(args); | |
| 2178 } | |
| 2179 | |
| 2180 static v8::Handle<v8::Value> withScriptStateObjExceptionMethod(const v8::Argumen
ts& args) | |
| 2181 { | |
| 2182 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2183 ExceptionCode ec = 0; | |
| 2184 { | |
| 2185 ScriptState* currentState = ScriptState::current(); | |
| 2186 if (!currentState) | |
| 2187 return v8Undefined(); | |
| 2188 ScriptState& state = *currentState; | |
| 2189 RefPtr<TestObj> result = imp->withScriptStateObjException(&state, ec); | |
| 2190 if (UNLIKELY(ec)) | |
| 2191 goto fail; | |
| 2192 if (state.hadException()) { | |
| 2193 v8::Local<v8::Value> exception = state.exception(); | |
| 2194 state.clearException(); | |
| 2195 return throwError(exception, args.GetIsolate()); | |
| 2196 } | |
| 2197 return toV8(result.release(), args.Holder(), args.GetIsolate()); | |
| 2198 } | |
| 2199 fail: | |
| 2200 return setDOMException(ec, args.GetIsolate()); | |
| 2201 } | |
| 2202 | |
| 2203 static v8::Handle<v8::Value> withScriptStateObjExceptionMethodCallback(const v8:
:Arguments& args) | |
| 2204 { | |
| 2205 return TestObjV8Internal::withScriptStateObjExceptionMethod(args); | |
| 2206 } | |
| 2207 | |
| 2208 static v8::Handle<v8::Value> withScriptExecutionContextMethod(const v8::Argument
s& args) | |
| 2209 { | |
| 2210 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2211 ScriptExecutionContext* scriptContext = getScriptExecutionContext(); | |
| 2212 imp->withScriptExecutionContext(scriptContext); | |
| 2213 return v8Undefined(); | |
| 2214 } | |
| 2215 | |
| 2216 static v8::Handle<v8::Value> withScriptExecutionContextMethodCallback(const v8::
Arguments& args) | |
| 2217 { | |
| 2218 return TestObjV8Internal::withScriptExecutionContextMethod(args); | |
| 2219 } | |
| 2220 | |
| 2221 static v8::Handle<v8::Value> withScriptExecutionContextAndScriptStateMethod(cons
t v8::Arguments& args) | |
| 2222 { | |
| 2223 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2224 ScriptState* currentState = ScriptState::current(); | |
| 2225 if (!currentState) | |
| 2226 return v8Undefined(); | |
| 2227 ScriptState& state = *currentState; | |
| 2228 ScriptExecutionContext* scriptContext = getScriptExecutionContext(); | |
| 2229 imp->withScriptExecutionContextAndScriptState(&state, scriptContext); | |
| 2230 if (state.hadException()) { | |
| 2231 v8::Local<v8::Value> exception = state.exception(); | |
| 2232 state.clearException(); | |
| 2233 return throwError(exception, args.GetIsolate()); | |
| 2234 } | |
| 2235 return v8Undefined(); | |
| 2236 } | |
| 2237 | |
| 2238 static v8::Handle<v8::Value> withScriptExecutionContextAndScriptStateMethodCallb
ack(const v8::Arguments& args) | |
| 2239 { | |
| 2240 return TestObjV8Internal::withScriptExecutionContextAndScriptStateMethod(arg
s); | |
| 2241 } | |
| 2242 | |
| 2243 static v8::Handle<v8::Value> withScriptExecutionContextAndScriptStateObjExceptio
nMethod(const v8::Arguments& args) | |
| 2244 { | |
| 2245 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2246 ExceptionCode ec = 0; | |
| 2247 { | |
| 2248 ScriptState* currentState = ScriptState::current(); | |
| 2249 if (!currentState) | |
| 2250 return v8Undefined(); | |
| 2251 ScriptState& state = *currentState; | |
| 2252 ScriptExecutionContext* scriptContext = getScriptExecutionContext(); | |
| 2253 RefPtr<TestObj> result = imp->withScriptExecutionContextAndScriptStateObjExc
eption(&state, scriptContext, ec); | |
| 2254 if (UNLIKELY(ec)) | |
| 2255 goto fail; | |
| 2256 if (state.hadException()) { | |
| 2257 v8::Local<v8::Value> exception = state.exception(); | |
| 2258 state.clearException(); | |
| 2259 return throwError(exception, args.GetIsolate()); | |
| 2260 } | |
| 2261 return toV8(result.release(), args.Holder(), args.GetIsolate()); | |
| 2262 } | |
| 2263 fail: | |
| 2264 return setDOMException(ec, args.GetIsolate()); | |
| 2265 } | |
| 2266 | |
| 2267 static v8::Handle<v8::Value> withScriptExecutionContextAndScriptStateObjExceptio
nMethodCallback(const v8::Arguments& args) | |
| 2268 { | |
| 2269 return TestObjV8Internal::withScriptExecutionContextAndScriptStateObjExcepti
onMethod(args); | |
| 2270 } | |
| 2271 | |
| 2272 static v8::Handle<v8::Value> withScriptExecutionContextAndScriptStateWithSpacesM
ethod(const v8::Arguments& args) | |
| 2273 { | |
| 2274 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2275 ScriptState* currentState = ScriptState::current(); | |
| 2276 if (!currentState) | |
| 2277 return v8Undefined(); | |
| 2278 ScriptState& state = *currentState; | |
| 2279 ScriptExecutionContext* scriptContext = getScriptExecutionContext(); | |
| 2280 RefPtr<TestObj> result = imp->withScriptExecutionContextAndScriptStateWithSp
aces(&state, scriptContext); | |
| 2281 if (state.hadException()) { | |
| 2282 v8::Local<v8::Value> exception = state.exception(); | |
| 2283 state.clearException(); | |
| 2284 return throwError(exception, args.GetIsolate()); | |
| 2285 } | |
| 2286 return toV8(result.release(), args.Holder(), args.GetIsolate()); | |
| 2287 } | |
| 2288 | |
| 2289 static v8::Handle<v8::Value> withScriptExecutionContextAndScriptStateWithSpacesM
ethodCallback(const v8::Arguments& args) | |
| 2290 { | |
| 2291 return TestObjV8Internal::withScriptExecutionContextAndScriptStateWithSpaces
Method(args); | |
| 2292 } | |
| 2293 | |
| 2294 static v8::Handle<v8::Value> withScriptArgumentsAndCallStackMethod(const v8::Arg
uments& args) | |
| 2295 { | |
| 2296 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2297 RefPtr<ScriptArguments> scriptArguments(createScriptArguments(args, 0)); | |
| 2298 imp->withScriptArgumentsAndCallStack(scriptArguments.release()); | |
| 2299 return v8Undefined(); | |
| 2300 } | |
| 2301 | |
| 2302 static v8::Handle<v8::Value> withScriptArgumentsAndCallStackMethodCallback(const
v8::Arguments& args) | |
| 2303 { | |
| 2304 return TestObjV8Internal::withScriptArgumentsAndCallStackMethod(args); | |
| 2305 } | |
| 2306 | |
| 2307 static v8::Handle<v8::Value> methodWithOptionalArgMethod(const v8::Arguments& ar
gs) | |
| 2308 { | |
| 2309 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2310 if (args.Length() <= 0) { | |
| 2311 imp->methodWithOptionalArg(); | |
| 2312 return v8Undefined(); | |
| 2313 } | |
| 2314 V8TRYCATCH(int, opt, toInt32(args[0])); | |
| 2315 imp->methodWithOptionalArg(opt); | |
| 2316 return v8Undefined(); | |
| 2317 } | |
| 2318 | |
| 2319 static v8::Handle<v8::Value> methodWithOptionalArgMethodCallback(const v8::Argum
ents& args) | |
| 2320 { | |
| 2321 return TestObjV8Internal::methodWithOptionalArgMethod(args); | |
| 2322 } | |
| 2323 | |
| 2324 static v8::Handle<v8::Value> methodWithNonOptionalArgAndOptionalArgMethod(const
v8::Arguments& args) | |
| 2325 { | |
| 2326 if (args.Length() < 1) | |
| 2327 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 2328 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2329 V8TRYCATCH(int, nonOpt, toInt32(args[0])); | |
| 2330 if (args.Length() <= 1) { | |
| 2331 imp->methodWithNonOptionalArgAndOptionalArg(nonOpt); | |
| 2332 return v8Undefined(); | |
| 2333 } | |
| 2334 V8TRYCATCH(int, opt, toInt32(args[1])); | |
| 2335 imp->methodWithNonOptionalArgAndOptionalArg(nonOpt, opt); | |
| 2336 return v8Undefined(); | |
| 2337 } | |
| 2338 | |
| 2339 static v8::Handle<v8::Value> methodWithNonOptionalArgAndOptionalArgMethodCallbac
k(const v8::Arguments& args) | |
| 2340 { | |
| 2341 return TestObjV8Internal::methodWithNonOptionalArgAndOptionalArgMethod(args)
; | |
| 2342 } | |
| 2343 | |
| 2344 static v8::Handle<v8::Value> methodWithNonOptionalArgAndTwoOptionalArgsMethod(co
nst v8::Arguments& args) | |
| 2345 { | |
| 2346 if (args.Length() < 1) | |
| 2347 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 2348 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2349 V8TRYCATCH(int, nonOpt, toInt32(args[0])); | |
| 2350 if (args.Length() <= 1) { | |
| 2351 imp->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt); | |
| 2352 return v8Undefined(); | |
| 2353 } | |
| 2354 V8TRYCATCH(int, opt1, toInt32(args[1])); | |
| 2355 if (args.Length() <= 2) { | |
| 2356 imp->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt, opt1); | |
| 2357 return v8Undefined(); | |
| 2358 } | |
| 2359 V8TRYCATCH(int, opt2, toInt32(args[2])); | |
| 2360 imp->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt, opt1, opt2); | |
| 2361 return v8Undefined(); | |
| 2362 } | |
| 2363 | |
| 2364 static v8::Handle<v8::Value> methodWithNonOptionalArgAndTwoOptionalArgsMethodCal
lback(const v8::Arguments& args) | |
| 2365 { | |
| 2366 return TestObjV8Internal::methodWithNonOptionalArgAndTwoOptionalArgsMethod(a
rgs); | |
| 2367 } | |
| 2368 | |
| 2369 static v8::Handle<v8::Value> methodWithOptionalStringMethod(const v8::Arguments&
args) | |
| 2370 { | |
| 2371 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2372 if (args.Length() <= 0) { | |
| 2373 imp->methodWithOptionalString(); | |
| 2374 return v8Undefined(); | |
| 2375 } | |
| 2376 V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, str, args[0]); | |
| 2377 imp->methodWithOptionalString(str); | |
| 2378 return v8Undefined(); | |
| 2379 } | |
| 2380 | |
| 2381 static v8::Handle<v8::Value> methodWithOptionalStringMethodCallback(const v8::Ar
guments& args) | |
| 2382 { | |
| 2383 return TestObjV8Internal::methodWithOptionalStringMethod(args); | |
| 2384 } | |
| 2385 | |
| 2386 static v8::Handle<v8::Value> methodWithOptionalStringIsUndefinedMethod(const v8:
:Arguments& args) | |
| 2387 { | |
| 2388 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2389 V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, str, args[0]); | |
| 2390 imp->methodWithOptionalStringIsUndefined(str); | |
| 2391 return v8Undefined(); | |
| 2392 } | |
| 2393 | |
| 2394 static v8::Handle<v8::Value> methodWithOptionalStringIsUndefinedMethodCallback(c
onst v8::Arguments& args) | |
| 2395 { | |
| 2396 return TestObjV8Internal::methodWithOptionalStringIsUndefinedMethod(args); | |
| 2397 } | |
| 2398 | |
| 2399 static v8::Handle<v8::Value> methodWithOptionalStringIsNullStringMethod(const v8
::Arguments& args) | |
| 2400 { | |
| 2401 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2402 V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, str, argumentOrNull(args
, 0)); | |
| 2403 imp->methodWithOptionalStringIsNullString(str); | |
| 2404 return v8Undefined(); | |
| 2405 } | |
| 2406 | |
| 2407 static v8::Handle<v8::Value> methodWithOptionalStringIsNullStringMethodCallback(
const v8::Arguments& args) | |
| 2408 { | |
| 2409 return TestObjV8Internal::methodWithOptionalStringIsNullStringMethod(args); | |
| 2410 } | |
| 2411 | |
| 2412 static v8::Handle<v8::Value> methodWithCallbackArgMethod(const v8::Arguments& ar
gs) | |
| 2413 { | |
| 2414 if (args.Length() < 1) | |
| 2415 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 2416 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2417 if (args.Length() <= 0 || !args[0]->IsFunction()) | |
| 2418 return throwTypeError(0, args.GetIsolate()); | |
| 2419 RefPtr<TestCallback> callback = V8TestCallback::create(args[0], getScriptExe
cutionContext()); | |
| 2420 imp->methodWithCallbackArg(callback); | |
| 2421 return v8Undefined(); | |
| 2422 } | |
| 2423 | |
| 2424 static v8::Handle<v8::Value> methodWithCallbackArgMethodCallback(const v8::Argum
ents& args) | |
| 2425 { | |
| 2426 return TestObjV8Internal::methodWithCallbackArgMethod(args); | |
| 2427 } | |
| 2428 | |
| 2429 static v8::Handle<v8::Value> methodWithNonCallbackArgAndCallbackArgMethod(const
v8::Arguments& args) | |
| 2430 { | |
| 2431 if (args.Length() < 2) | |
| 2432 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 2433 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2434 V8TRYCATCH(int, nonCallback, toInt32(args[0])); | |
| 2435 if (args.Length() <= 1 || !args[1]->IsFunction()) | |
| 2436 return throwTypeError(0, args.GetIsolate()); | |
| 2437 RefPtr<TestCallback> callback = V8TestCallback::create(args[1], getScriptExe
cutionContext()); | |
| 2438 imp->methodWithNonCallbackArgAndCallbackArg(nonCallback, callback); | |
| 2439 return v8Undefined(); | |
| 2440 } | |
| 2441 | |
| 2442 static v8::Handle<v8::Value> methodWithNonCallbackArgAndCallbackArgMethodCallbac
k(const v8::Arguments& args) | |
| 2443 { | |
| 2444 return TestObjV8Internal::methodWithNonCallbackArgAndCallbackArgMethod(args)
; | |
| 2445 } | |
| 2446 | |
| 2447 static v8::Handle<v8::Value> methodWithCallbackAndOptionalArgMethod(const v8::Ar
guments& args) | |
| 2448 { | |
| 2449 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2450 RefPtr<TestCallback> callback; | |
| 2451 if (args.Length() > 0 && !args[0]->IsNull() && !args[0]->IsUndefined()) { | |
| 2452 if (!args[0]->IsFunction()) | |
| 2453 return throwTypeError(0, args.GetIsolate()); | |
| 2454 callback = V8TestCallback::create(args[0], getScriptExecutionContext()); | |
| 2455 } | |
| 2456 imp->methodWithCallbackAndOptionalArg(callback); | |
| 2457 return v8Undefined(); | |
| 2458 } | |
| 2459 | |
| 2460 static v8::Handle<v8::Value> methodWithCallbackAndOptionalArgMethodCallback(cons
t v8::Arguments& args) | |
| 2461 { | |
| 2462 return TestObjV8Internal::methodWithCallbackAndOptionalArgMethod(args); | |
| 2463 } | |
| 2464 | |
| 2465 static v8::Handle<v8::Value> staticMethodWithCallbackAndOptionalArgMethod(const
v8::Arguments& args) | |
| 2466 { | |
| 2467 RefPtr<TestCallback> callback; | |
| 2468 if (args.Length() > 0 && !args[0]->IsNull() && !args[0]->IsUndefined()) { | |
| 2469 if (!args[0]->IsFunction()) | |
| 2470 return throwTypeError(0, args.GetIsolate()); | |
| 2471 callback = V8TestCallback::create(args[0], getScriptExecutionContext()); | |
| 2472 } | |
| 2473 TestObj::staticMethodWithCallbackAndOptionalArg(callback); | |
| 2474 return v8Undefined(); | |
| 2475 } | |
| 2476 | |
| 2477 static v8::Handle<v8::Value> staticMethodWithCallbackAndOptionalArgMethodCallbac
k(const v8::Arguments& args) | |
| 2478 { | |
| 2479 return TestObjV8Internal::staticMethodWithCallbackAndOptionalArgMethod(args)
; | |
| 2480 } | |
| 2481 | |
| 2482 static v8::Handle<v8::Value> staticMethodWithCallbackArgMethod(const v8::Argumen
ts& args) | |
| 2483 { | |
| 2484 if (args.Length() < 1) | |
| 2485 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 2486 if (args.Length() <= 0 || !args[0]->IsFunction()) | |
| 2487 return throwTypeError(0, args.GetIsolate()); | |
| 2488 RefPtr<TestCallback> callback = V8TestCallback::create(args[0], getScriptExe
cutionContext()); | |
| 2489 TestObj::staticMethodWithCallbackArg(callback); | |
| 2490 return v8Undefined(); | |
| 2491 } | |
| 2492 | |
| 2493 static v8::Handle<v8::Value> staticMethodWithCallbackArgMethodCallback(const v8:
:Arguments& args) | |
| 2494 { | |
| 2495 return TestObjV8Internal::staticMethodWithCallbackArgMethod(args); | |
| 2496 } | |
| 2497 | |
| 2498 static v8::Handle<v8::Value> methodWithEnforceRangeInt32Method(const v8::Argumen
ts& args) | |
| 2499 { | |
| 2500 if (args.Length() < 1) | |
| 2501 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 2502 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2503 V8TRYCATCH_WITH_TYPECHECK(int, value, toInt32(args[0], EnforceRange, ok), ar
gs.GetIsolate()); | |
| 2504 imp->methodWithEnforceRangeInt32(value); | |
| 2505 return v8Undefined(); | |
| 2506 } | |
| 2507 | |
| 2508 static v8::Handle<v8::Value> methodWithEnforceRangeInt32MethodCallback(const v8:
:Arguments& args) | |
| 2509 { | |
| 2510 return TestObjV8Internal::methodWithEnforceRangeInt32Method(args); | |
| 2511 } | |
| 2512 | |
| 2513 static v8::Handle<v8::Value> methodWithEnforceRangeUInt32Method(const v8::Argume
nts& args) | |
| 2514 { | |
| 2515 if (args.Length() < 1) | |
| 2516 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 2517 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2518 V8TRYCATCH_WITH_TYPECHECK(unsigned, value, toUInt32(args[0], EnforceRange, o
k), args.GetIsolate()); | |
| 2519 imp->methodWithEnforceRangeUInt32(value); | |
| 2520 return v8Undefined(); | |
| 2521 } | |
| 2522 | |
| 2523 static v8::Handle<v8::Value> methodWithEnforceRangeUInt32MethodCallback(const v8
::Arguments& args) | |
| 2524 { | |
| 2525 return TestObjV8Internal::methodWithEnforceRangeUInt32Method(args); | |
| 2526 } | |
| 2527 | |
| 2528 static v8::Handle<v8::Value> methodWithEnforceRangeInt64Method(const v8::Argumen
ts& args) | |
| 2529 { | |
| 2530 if (args.Length() < 1) | |
| 2531 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 2532 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2533 V8TRYCATCH_WITH_TYPECHECK(long long, value, toInt64(args[0], EnforceRange, o
k), args.GetIsolate()); | |
| 2534 imp->methodWithEnforceRangeInt64(value); | |
| 2535 return v8Undefined(); | |
| 2536 } | |
| 2537 | |
| 2538 static v8::Handle<v8::Value> methodWithEnforceRangeInt64MethodCallback(const v8:
:Arguments& args) | |
| 2539 { | |
| 2540 return TestObjV8Internal::methodWithEnforceRangeInt64Method(args); | |
| 2541 } | |
| 2542 | |
| 2543 static v8::Handle<v8::Value> methodWithEnforceRangeUInt64Method(const v8::Argume
nts& args) | |
| 2544 { | |
| 2545 if (args.Length() < 1) | |
| 2546 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 2547 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2548 V8TRYCATCH_WITH_TYPECHECK(unsigned long long, value, toUInt64(args[0], Enfor
ceRange, ok), args.GetIsolate()); | |
| 2549 imp->methodWithEnforceRangeUInt64(value); | |
| 2550 return v8Undefined(); | |
| 2551 } | |
| 2552 | |
| 2553 static v8::Handle<v8::Value> methodWithEnforceRangeUInt64MethodCallback(const v8
::Arguments& args) | |
| 2554 { | |
| 2555 return TestObjV8Internal::methodWithEnforceRangeUInt64Method(args); | |
| 2556 } | |
| 2557 | |
| 2558 #if ENABLE(Condition1) | |
| 2559 | |
| 2560 static v8::Handle<v8::Value> conditionalMethod1Method(const v8::Arguments& args) | |
| 2561 { | |
| 2562 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2563 return v8String(imp->conditionalMethod1(), args.GetIsolate(), ReturnUnsafeHa
ndle); | |
| 2564 } | |
| 2565 | |
| 2566 #endif // ENABLE(Condition1) | |
| 2567 | |
| 2568 #if ENABLE(Condition1) | |
| 2569 | |
| 2570 static v8::Handle<v8::Value> conditionalMethod1MethodCallback(const v8::Argument
s& args) | |
| 2571 { | |
| 2572 return TestObjV8Internal::conditionalMethod1Method(args); | |
| 2573 } | |
| 2574 | |
| 2575 #endif // ENABLE(Condition1) | |
| 2576 | |
| 2577 #if ENABLE(Condition1) && ENABLE(Condition2) | |
| 2578 | |
| 2579 static v8::Handle<v8::Value> conditionalMethod2Method(const v8::Arguments& args) | |
| 2580 { | |
| 2581 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2582 imp->conditionalMethod2(); | |
| 2583 return v8Undefined(); | |
| 2584 } | |
| 2585 | |
| 2586 #endif // ENABLE(Condition1) && ENABLE(Condition2) | |
| 2587 | |
| 2588 #if ENABLE(Condition1) && ENABLE(Condition2) | |
| 2589 | |
| 2590 static v8::Handle<v8::Value> conditionalMethod2MethodCallback(const v8::Argument
s& args) | |
| 2591 { | |
| 2592 return TestObjV8Internal::conditionalMethod2Method(args); | |
| 2593 } | |
| 2594 | |
| 2595 #endif // ENABLE(Condition1) && ENABLE(Condition2) | |
| 2596 | |
| 2597 #if ENABLE(Condition1) || ENABLE(Condition2) | |
| 2598 | |
| 2599 static v8::Handle<v8::Value> conditionalMethod3Method(const v8::Arguments& args) | |
| 2600 { | |
| 2601 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2602 imp->conditionalMethod3(); | |
| 2603 return v8Undefined(); | |
| 2604 } | |
| 2605 | |
| 2606 #endif // ENABLE(Condition1) || ENABLE(Condition2) | |
| 2607 | |
| 2608 #if ENABLE(Condition1) || ENABLE(Condition2) | |
| 2609 | |
| 2610 static v8::Handle<v8::Value> conditionalMethod3MethodCallback(const v8::Argument
s& args) | |
| 2611 { | |
| 2612 return TestObjV8Internal::conditionalMethod3Method(args); | |
| 2613 } | |
| 2614 | |
| 2615 #endif // ENABLE(Condition1) || ENABLE(Condition2) | |
| 2616 | |
| 2617 static v8::Handle<v8::Value> overloadedMethod1Method(const v8::Arguments& args) | |
| 2618 { | |
| 2619 if (args.Length() < 2) | |
| 2620 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 2621 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2622 V8TRYCATCH(TestObj*, objArg, V8TestObj::HasInstance(args[0], args.GetIsolate
(), worldType(args.GetIsolate())) ? V8TestObj::toNative(v8::Handle<v8::Object>::
Cast(args[0])) : 0); | |
| 2623 V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, strArg, args[1]); | |
| 2624 imp->overloadedMethod(objArg, strArg); | |
| 2625 return v8Undefined(); | |
| 2626 } | |
| 2627 | |
| 2628 static v8::Handle<v8::Value> overloadedMethod2Method(const v8::Arguments& args) | |
| 2629 { | |
| 2630 if (args.Length() < 1) | |
| 2631 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 2632 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2633 V8TRYCATCH(TestObj*, objArg, V8TestObj::HasInstance(args[0], args.GetIsolate
(), worldType(args.GetIsolate())) ? V8TestObj::toNative(v8::Handle<v8::Object>::
Cast(args[0])) : 0); | |
| 2634 if (args.Length() <= 1) { | |
| 2635 imp->overloadedMethod(objArg); | |
| 2636 return v8Undefined(); | |
| 2637 } | |
| 2638 V8TRYCATCH(int, longArg, toInt32(args[1])); | |
| 2639 imp->overloadedMethod(objArg, longArg); | |
| 2640 return v8Undefined(); | |
| 2641 } | |
| 2642 | |
| 2643 static v8::Handle<v8::Value> overloadedMethod3Method(const v8::Arguments& args) | |
| 2644 { | |
| 2645 if (args.Length() < 1) | |
| 2646 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 2647 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2648 V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, strArg, args[0]); | |
| 2649 imp->overloadedMethod(strArg); | |
| 2650 return v8Undefined(); | |
| 2651 } | |
| 2652 | |
| 2653 static v8::Handle<v8::Value> overloadedMethod4Method(const v8::Arguments& args) | |
| 2654 { | |
| 2655 if (args.Length() < 1) | |
| 2656 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 2657 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2658 V8TRYCATCH(int, longArg, toInt32(args[0])); | |
| 2659 imp->overloadedMethod(longArg); | |
| 2660 return v8Undefined(); | |
| 2661 } | |
| 2662 | |
| 2663 static v8::Handle<v8::Value> overloadedMethod5Method(const v8::Arguments& args) | |
| 2664 { | |
| 2665 if (args.Length() < 1) | |
| 2666 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 2667 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2668 if (args.Length() <= 0 || !args[0]->IsFunction()) | |
| 2669 return throwTypeError(0, args.GetIsolate()); | |
| 2670 RefPtr<TestCallback> callback = V8TestCallback::create(args[0], getScriptExe
cutionContext()); | |
| 2671 imp->overloadedMethod(callback); | |
| 2672 return v8Undefined(); | |
| 2673 } | |
| 2674 | |
| 2675 static v8::Handle<v8::Value> overloadedMethod6Method(const v8::Arguments& args) | |
| 2676 { | |
| 2677 if (args.Length() < 1) | |
| 2678 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 2679 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2680 V8TRYCATCH(RefPtr<DOMStringList>, listArg, toDOMStringList(args[0], args.Get
Isolate())); | |
| 2681 imp->overloadedMethod(listArg); | |
| 2682 return v8Undefined(); | |
| 2683 } | |
| 2684 | |
| 2685 static v8::Handle<v8::Value> overloadedMethod7Method(const v8::Arguments& args) | |
| 2686 { | |
| 2687 if (args.Length() < 1) | |
| 2688 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 2689 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2690 V8TRYCATCH(Vector<String>, arrayArg, toNativeArray<String>(args[0])); | |
| 2691 imp->overloadedMethod(arrayArg); | |
| 2692 return v8Undefined(); | |
| 2693 } | |
| 2694 | |
| 2695 static v8::Handle<v8::Value> overloadedMethod8Method(const v8::Arguments& args) | |
| 2696 { | |
| 2697 if (args.Length() < 1) | |
| 2698 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 2699 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2700 V8TRYCATCH(TestObj*, objArg, V8TestObj::HasInstance(args[0], args.GetIsolate
(), worldType(args.GetIsolate())) ? V8TestObj::toNative(v8::Handle<v8::Object>::
Cast(args[0])) : 0); | |
| 2701 imp->overloadedMethod(objArg); | |
| 2702 return v8Undefined(); | |
| 2703 } | |
| 2704 | |
| 2705 static v8::Handle<v8::Value> overloadedMethod9Method(const v8::Arguments& args) | |
| 2706 { | |
| 2707 if (args.Length() < 1) | |
| 2708 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 2709 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2710 V8TRYCATCH(Vector<String>, arrayArg, toNativeArray<String>(args[0])); | |
| 2711 imp->overloadedMethod(arrayArg); | |
| 2712 return v8Undefined(); | |
| 2713 } | |
| 2714 | |
| 2715 static v8::Handle<v8::Value> overloadedMethod10Method(const v8::Arguments& args) | |
| 2716 { | |
| 2717 if (args.Length() < 1) | |
| 2718 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 2719 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2720 V8TRYCATCH(Vector<unsigned>, arrayArg, toNativeArray<unsigned>(args[0])); | |
| 2721 imp->overloadedMethod(arrayArg); | |
| 2722 return v8Undefined(); | |
| 2723 } | |
| 2724 | |
| 2725 static v8::Handle<v8::Value> overloadedMethod11Method(const v8::Arguments& args) | |
| 2726 { | |
| 2727 if (args.Length() < 1) | |
| 2728 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 2729 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2730 V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, strArg, args[0]); | |
| 2731 imp->overloadedMethod(strArg); | |
| 2732 return v8Undefined(); | |
| 2733 } | |
| 2734 | |
| 2735 static v8::Handle<v8::Value> overloadedMethodMethod(const v8::Arguments& args) | |
| 2736 { | |
| 2737 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()))) | |
| 2738 return overloadedMethod1Method(args); | |
| 2739 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()))))) | |
| 2740 return overloadedMethod2Method(args); | |
| 2741 if ((args.Length() == 1 && (args[0]->IsNull() || args[0]->IsUndefined() || a
rgs[0]->IsString() || args[0]->IsObject()))) | |
| 2742 return overloadedMethod3Method(args); | |
| 2743 if (args.Length() == 1) | |
| 2744 return overloadedMethod4Method(args); | |
| 2745 if ((args.Length() == 1 && (args[0]->IsNull() || args[0]->IsFunction()))) | |
| 2746 return overloadedMethod5Method(args); | |
| 2747 if ((args.Length() == 1 && (args[0]->IsNull() || V8DOMStringList::HasInstanc
e(args[0], args.GetIsolate(), worldType(args.GetIsolate()))))) | |
| 2748 return overloadedMethod6Method(args); | |
| 2749 if ((args.Length() == 1 && (args[0]->IsNull() || args[0]->IsArray()))) | |
| 2750 return overloadedMethod7Method(args); | |
| 2751 if ((args.Length() == 1 && (V8TestObj::HasInstance(args[0], args.GetIsolate(
), worldType(args.GetIsolate()))))) | |
| 2752 return overloadedMethod8Method(args); | |
| 2753 if ((args.Length() == 1 && (args[0]->IsArray()))) | |
| 2754 return overloadedMethod9Method(args); | |
| 2755 if ((args.Length() == 1 && (args[0]->IsArray()))) | |
| 2756 return overloadedMethod10Method(args); | |
| 2757 if (args.Length() == 1) | |
| 2758 return overloadedMethod11Method(args); | |
| 2759 if (args.Length() < 1) | |
| 2760 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 2761 return throwTypeError(0, args.GetIsolate()); | |
| 2762 } | |
| 2763 | |
| 2764 static v8::Handle<v8::Value> overloadedMethodMethodCallback(const v8::Arguments&
args) | |
| 2765 { | |
| 2766 return TestObjV8Internal::overloadedMethodMethod(args); | |
| 2767 } | |
| 2768 | |
| 2769 static v8::Handle<v8::Value> classMethodMethod(const v8::Arguments& args) | |
| 2770 { | |
| 2771 TestObj::classMethod(); | |
| 2772 return v8Undefined(); | |
| 2773 } | |
| 2774 | |
| 2775 static v8::Handle<v8::Value> classMethodMethodCallback(const v8::Arguments& args
) | |
| 2776 { | |
| 2777 return TestObjV8Internal::classMethodMethod(args); | |
| 2778 } | |
| 2779 | |
| 2780 static v8::Handle<v8::Value> classMethodWithOptionalMethod(const v8::Arguments&
args) | |
| 2781 { | |
| 2782 if (args.Length() <= 0) { | |
| 2783 return v8Integer(TestObj::classMethodWithOptional(), args.GetIsolate()); | |
| 2784 } | |
| 2785 V8TRYCATCH(int, arg, toInt32(args[0])); | |
| 2786 return v8Integer(TestObj::classMethodWithOptional(arg), args.GetIsolate()); | |
| 2787 } | |
| 2788 | |
| 2789 static v8::Handle<v8::Value> classMethodWithOptionalMethodCallback(const v8::Arg
uments& args) | |
| 2790 { | |
| 2791 return TestObjV8Internal::classMethodWithOptionalMethod(args); | |
| 2792 } | |
| 2793 | |
| 2794 static v8::Handle<v8::Value> classMethod2MethodCallback(const v8::Arguments& arg
s) | |
| 2795 { | |
| 2796 return V8TestObj::classMethod2MethodCustom(args); | |
| 2797 } | |
| 2798 | |
| 2799 #if ENABLE(Condition1) | |
| 2800 | |
| 2801 static v8::Handle<v8::Value> overloadedMethod11Method(const v8::Arguments& args) | |
| 2802 { | |
| 2803 if (args.Length() < 1) | |
| 2804 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 2805 V8TRYCATCH(int, arg, toInt32(args[0])); | |
| 2806 TestObj::overloadedMethod1(arg); | |
| 2807 return v8Undefined(); | |
| 2808 } | |
| 2809 | |
| 2810 #endif // ENABLE(Condition1) | |
| 2811 | |
| 2812 #if ENABLE(Condition1) | |
| 2813 | |
| 2814 static v8::Handle<v8::Value> overloadedMethod12Method(const v8::Arguments& args) | |
| 2815 { | |
| 2816 if (args.Length() < 1) | |
| 2817 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 2818 V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, type, args[0]); | |
| 2819 TestObj::overloadedMethod1(type); | |
| 2820 return v8Undefined(); | |
| 2821 } | |
| 2822 | |
| 2823 #endif // ENABLE(Condition1) | |
| 2824 | |
| 2825 #if ENABLE(Condition1) | |
| 2826 | |
| 2827 static v8::Handle<v8::Value> overloadedMethod1Method(const v8::Arguments& args) | |
| 2828 { | |
| 2829 if (args.Length() == 1) | |
| 2830 return overloadedMethod11Method(args); | |
| 2831 if ((args.Length() == 1 && (args[0]->IsNull() || args[0]->IsUndefined() || a
rgs[0]->IsString() || args[0]->IsObject()))) | |
| 2832 return overloadedMethod12Method(args); | |
| 2833 if (args.Length() < 1) | |
| 2834 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 2835 return throwTypeError(0, args.GetIsolate()); | |
| 2836 } | |
| 2837 | |
| 2838 #endif // ENABLE(Condition1) | |
| 2839 | |
| 2840 #if ENABLE(Condition1) | |
| 2841 | |
| 2842 static v8::Handle<v8::Value> overloadedMethod1MethodCallback(const v8::Arguments
& args) | |
| 2843 { | |
| 2844 return TestObjV8Internal::overloadedMethod1Method(args); | |
| 2845 } | |
| 2846 | |
| 2847 #endif // ENABLE(Condition1) | |
| 2848 | |
| 2849 static v8::Handle<v8::Value> classMethodWithClampMethod(const v8::Arguments& arg
s) | |
| 2850 { | |
| 2851 if (args.Length() < 2) | |
| 2852 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 2853 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2854 unsigned short objArgsShort = 0; | |
| 2855 V8TRYCATCH(double, objArgsShortNativeValue, args[0]->NumberValue()); | |
| 2856 if (!std::isnan(objArgsShortNativeValue)) | |
| 2857 objArgsShort = clampTo<unsigned short>(objArgsShortNativeValue); | |
| 2858 unsigned long objArgsLong = 0; | |
| 2859 V8TRYCATCH(double, objArgsLongNativeValue, args[1]->NumberValue()); | |
| 2860 if (!std::isnan(objArgsLongNativeValue)) | |
| 2861 objArgsLong = clampTo<unsigned long>(objArgsLongNativeValue); | |
| 2862 imp->classMethodWithClamp(objArgsShort, objArgsLong); | |
| 2863 return v8Undefined(); | |
| 2864 } | |
| 2865 | |
| 2866 static v8::Handle<v8::Value> classMethodWithClampMethodCallback(const v8::Argume
nts& args) | |
| 2867 { | |
| 2868 return TestObjV8Internal::classMethodWithClampMethod(args); | |
| 2869 } | |
| 2870 | |
| 2871 static v8::Handle<v8::Value> enabledAtRuntimeMethod1Method(const v8::Arguments&
args) | |
| 2872 { | |
| 2873 if (args.Length() < 1) | |
| 2874 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 2875 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2876 V8TRYCATCH(int, longArg, toInt32(args[0])); | |
| 2877 imp->enabledAtRuntimeMethod1(longArg); | |
| 2878 return v8Undefined(); | |
| 2879 } | |
| 2880 | |
| 2881 static v8::Handle<v8::Value> enabledAtRuntimeMethod1MethodCallback(const v8::Arg
uments& args) | |
| 2882 { | |
| 2883 return TestObjV8Internal::enabledAtRuntimeMethod1Method(args); | |
| 2884 } | |
| 2885 | |
| 2886 static v8::Handle<v8::Value> enabledAtRuntimeMethod2Method(const v8::Arguments&
args) | |
| 2887 { | |
| 2888 if (args.Length() < 1) | |
| 2889 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 2890 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2891 V8TRYCATCH(int, longArg, toInt32(args[0])); | |
| 2892 imp->enabledAtRuntimeMethod2(longArg); | |
| 2893 return v8Undefined(); | |
| 2894 } | |
| 2895 | |
| 2896 static v8::Handle<v8::Value> enabledAtRuntimeMethod2MethodCallback(const v8::Arg
uments& args) | |
| 2897 { | |
| 2898 return TestObjV8Internal::enabledAtRuntimeMethod2Method(args); | |
| 2899 } | |
| 2900 | |
| 2901 static v8::Handle<v8::Value> enabledPerContextMethod1Method(const v8::Arguments&
args) | |
| 2902 { | |
| 2903 if (args.Length() < 1) | |
| 2904 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 2905 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2906 V8TRYCATCH(int, longArg, toInt32(args[0])); | |
| 2907 imp->enabledPerContextMethod1(longArg); | |
| 2908 return v8Undefined(); | |
| 2909 } | |
| 2910 | |
| 2911 static v8::Handle<v8::Value> enabledPerContextMethod1MethodCallback(const v8::Ar
guments& args) | |
| 2912 { | |
| 2913 return TestObjV8Internal::enabledPerContextMethod1Method(args); | |
| 2914 } | |
| 2915 | |
| 2916 static v8::Handle<v8::Value> enabledPerContextMethod2Method(const v8::Arguments&
args) | |
| 2917 { | |
| 2918 if (args.Length() < 1) | |
| 2919 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 2920 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2921 V8TRYCATCH(int, longArg, toInt32(args[0])); | |
| 2922 imp->enabledPerContextMethod2(longArg); | |
| 2923 return v8Undefined(); | |
| 2924 } | |
| 2925 | |
| 2926 static v8::Handle<v8::Value> enabledPerContextMethod2MethodCallback(const v8::Ar
guments& args) | |
| 2927 { | |
| 2928 return TestObjV8Internal::enabledPerContextMethod2Method(args); | |
| 2929 } | |
| 2930 | |
| 2931 static v8::Handle<v8::Value> stringArrayFunctionMethod(const v8::Arguments& args
) | |
| 2932 { | |
| 2933 if (args.Length() < 1) | |
| 2934 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 2935 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2936 ExceptionCode ec = 0; | |
| 2937 { | |
| 2938 V8TRYCATCH(Vector<String>, values, toNativeArray<String>(args[0])); | |
| 2939 Vector<String> result = imp->stringArrayFunction(values, ec); | |
| 2940 if (UNLIKELY(ec)) | |
| 2941 goto fail; | |
| 2942 return v8Array(result, args.GetIsolate()); | |
| 2943 } | |
| 2944 fail: | |
| 2945 return setDOMException(ec, args.GetIsolate()); | |
| 2946 } | |
| 2947 | |
| 2948 static v8::Handle<v8::Value> stringArrayFunctionMethodCallback(const v8::Argumen
ts& args) | |
| 2949 { | |
| 2950 return TestObjV8Internal::stringArrayFunctionMethod(args); | |
| 2951 } | |
| 2952 | |
| 2953 static v8::Handle<v8::Value> domStringListFunctionMethod(const v8::Arguments& ar
gs) | |
| 2954 { | |
| 2955 if (args.Length() < 1) | |
| 2956 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 2957 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2958 ExceptionCode ec = 0; | |
| 2959 { | |
| 2960 V8TRYCATCH(RefPtr<DOMStringList>, values, toDOMStringList(args[0], args.GetI
solate())); | |
| 2961 RefPtr<DOMStringList> result = imp->domStringListFunction(values, ec); | |
| 2962 if (UNLIKELY(ec)) | |
| 2963 goto fail; | |
| 2964 return toV8(result.release(), args.Holder(), args.GetIsolate()); | |
| 2965 } | |
| 2966 fail: | |
| 2967 return setDOMException(ec, args.GetIsolate()); | |
| 2968 } | |
| 2969 | |
| 2970 static v8::Handle<v8::Value> domStringListFunctionMethodCallback(const v8::Argum
ents& args) | |
| 2971 { | |
| 2972 return TestObjV8Internal::domStringListFunctionMethod(args); | |
| 2973 } | |
| 2974 | |
| 2975 static v8::Handle<v8::Value> getSVGDocumentMethod(const v8::Arguments& args) | |
| 2976 { | |
| 2977 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2978 ExceptionCode ec = 0; | |
| 2979 { | |
| 2980 if (!BindingSecurity::shouldAllowAccessToNode(BindingState::instance(), imp-
>getSVGDocument(ec))) | |
| 2981 return v8::Handle<v8::Value>(v8Null(args.GetIsolate())); | |
| 2982 RefPtr<SVGDocument> result = imp->getSVGDocument(ec); | |
| 2983 if (UNLIKELY(ec)) | |
| 2984 goto fail; | |
| 2985 return toV8(result.release(), args.Holder(), args.GetIsolate()); | |
| 2986 } | |
| 2987 fail: | |
| 2988 return setDOMException(ec, args.GetIsolate()); | |
| 2989 } | |
| 2990 | |
| 2991 static v8::Handle<v8::Value> getSVGDocumentMethodCallback(const v8::Arguments& a
rgs) | |
| 2992 { | |
| 2993 return TestObjV8Internal::getSVGDocumentMethod(args); | |
| 2994 } | |
| 2995 | |
| 2996 static v8::Handle<v8::Value> convert1Method(const v8::Arguments& args) | |
| 2997 { | |
| 2998 if (args.Length() < 1) | |
| 2999 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 3000 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 3001 V8TRYCATCH(a*, value, V8a::HasInstance(args[0], args.GetIsolate(), worldType
(args.GetIsolate())) ? V8a::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0)
; | |
| 3002 imp->convert1(value); | |
| 3003 return v8Undefined(); | |
| 3004 } | |
| 3005 | |
| 3006 static v8::Handle<v8::Value> convert1MethodCallback(const v8::Arguments& args) | |
| 3007 { | |
| 3008 return TestObjV8Internal::convert1Method(args); | |
| 3009 } | |
| 3010 | |
| 3011 static v8::Handle<v8::Value> convert2Method(const v8::Arguments& args) | |
| 3012 { | |
| 3013 if (args.Length() < 1) | |
| 3014 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 3015 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 3016 V8TRYCATCH(b*, value, V8b::HasInstance(args[0], args.GetIsolate(), worldType
(args.GetIsolate())) ? V8b::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0)
; | |
| 3017 imp->convert2(value); | |
| 3018 return v8Undefined(); | |
| 3019 } | |
| 3020 | |
| 3021 static v8::Handle<v8::Value> convert2MethodCallback(const v8::Arguments& args) | |
| 3022 { | |
| 3023 return TestObjV8Internal::convert2Method(args); | |
| 3024 } | |
| 3025 | |
| 3026 static v8::Handle<v8::Value> convert4Method(const v8::Arguments& args) | |
| 3027 { | |
| 3028 if (args.Length() < 1) | |
| 3029 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 3030 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 3031 V8TRYCATCH(d*, value, V8d::HasInstance(args[0], args.GetIsolate(), worldType
(args.GetIsolate())) ? V8d::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0)
; | |
| 3032 imp->convert4(value); | |
| 3033 return v8Undefined(); | |
| 3034 } | |
| 3035 | |
| 3036 static v8::Handle<v8::Value> convert4MethodCallback(const v8::Arguments& args) | |
| 3037 { | |
| 3038 return TestObjV8Internal::convert4Method(args); | |
| 3039 } | |
| 3040 | |
| 3041 static v8::Handle<v8::Value> convert5Method(const v8::Arguments& args) | |
| 3042 { | |
| 3043 if (args.Length() < 1) | |
| 3044 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 3045 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 3046 V8TRYCATCH(e*, value, V8e::HasInstance(args[0], args.GetIsolate(), worldType
(args.GetIsolate())) ? V8e::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0)
; | |
| 3047 imp->convert5(value); | |
| 3048 return v8Undefined(); | |
| 3049 } | |
| 3050 | |
| 3051 static v8::Handle<v8::Value> convert5MethodCallback(const v8::Arguments& args) | |
| 3052 { | |
| 3053 return TestObjV8Internal::convert5Method(args); | |
| 3054 } | |
| 3055 | |
| 3056 static v8::Handle<v8::Value> mutablePointFunctionMethod(const v8::Arguments& arg
s) | |
| 3057 { | |
| 3058 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 3059 return toV8(WTF::getPtr(SVGPropertyTearOff<FloatPoint>::create(imp->mutableP
ointFunction())), args.Holder(), args.GetIsolate()); | |
| 3060 } | |
| 3061 | |
| 3062 static v8::Handle<v8::Value> mutablePointFunctionMethodCallback(const v8::Argume
nts& args) | |
| 3063 { | |
| 3064 return TestObjV8Internal::mutablePointFunctionMethod(args); | |
| 3065 } | |
| 3066 | |
| 3067 static v8::Handle<v8::Value> immutablePointFunctionMethod(const v8::Arguments& a
rgs) | |
| 3068 { | |
| 3069 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 3070 return toV8(WTF::getPtr(SVGPropertyTearOff<FloatPoint>::create(imp->immutabl
ePointFunction())), args.Holder(), args.GetIsolate()); | |
| 3071 } | |
| 3072 | |
| 3073 static v8::Handle<v8::Value> immutablePointFunctionMethodCallback(const v8::Argu
ments& args) | |
| 3074 { | |
| 3075 return TestObjV8Internal::immutablePointFunctionMethod(args); | |
| 3076 } | |
| 3077 | |
| 3078 static v8::Handle<v8::Value> orangeMethod(const v8::Arguments& args) | |
| 3079 { | |
| 3080 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 3081 imp->banana(); | |
| 3082 return v8Undefined(); | |
| 3083 } | |
| 3084 | |
| 3085 static v8::Handle<v8::Value> orangeMethodCallback(const v8::Arguments& args) | |
| 3086 { | |
| 3087 return TestObjV8Internal::orangeMethod(args); | |
| 3088 } | |
| 3089 | |
| 3090 static v8::Handle<v8::Value> strictFunctionMethod(const v8::Arguments& args) | |
| 3091 { | |
| 3092 if (args.Length() < 3) | |
| 3093 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 3094 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 3095 ExceptionCode ec = 0; | |
| 3096 { | |
| 3097 V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, str, args[0]); | |
| 3098 V8TRYCATCH(float, a, static_cast<float>(args[1]->NumberValue())); | |
| 3099 V8TRYCATCH(int, b, toInt32(args[2])); | |
| 3100 RefPtr<bool> result = imp->strictFunction(str, a, b, ec); | |
| 3101 if (UNLIKELY(ec)) | |
| 3102 goto fail; | |
| 3103 return toV8(result.release(), args.Holder(), args.GetIsolate()); | |
| 3104 } | |
| 3105 fail: | |
| 3106 return setDOMException(ec, args.GetIsolate()); | |
| 3107 } | |
| 3108 | |
| 3109 static v8::Handle<v8::Value> strictFunctionMethodCallback(const v8::Arguments& a
rgs) | |
| 3110 { | |
| 3111 return TestObjV8Internal::strictFunctionMethod(args); | |
| 3112 } | |
| 3113 | |
| 3114 static v8::Handle<v8::Value> variadicStringMethodMethod(const v8::Arguments& arg
s) | |
| 3115 { | |
| 3116 if (args.Length() < 1) | |
| 3117 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 3118 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 3119 V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, head, args[0]); | |
| 3120 V8TRYCATCH(Vector<String>, tail, toNativeArguments<String>(args, 1)); | |
| 3121 imp->variadicStringMethod(head, tail); | |
| 3122 return v8Undefined(); | |
| 3123 } | |
| 3124 | |
| 3125 static v8::Handle<v8::Value> variadicStringMethodMethodCallback(const v8::Argume
nts& args) | |
| 3126 { | |
| 3127 return TestObjV8Internal::variadicStringMethodMethod(args); | |
| 3128 } | |
| 3129 | |
| 3130 static v8::Handle<v8::Value> variadicDoubleMethodMethod(const v8::Arguments& arg
s) | |
| 3131 { | |
| 3132 if (args.Length() < 1) | |
| 3133 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 3134 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 3135 V8TRYCATCH(double, head, static_cast<double>(args[0]->NumberValue())); | |
| 3136 V8TRYCATCH(Vector<double>, tail, toNativeArguments<double>(args, 1)); | |
| 3137 imp->variadicDoubleMethod(head, tail); | |
| 3138 return v8Undefined(); | |
| 3139 } | |
| 3140 | |
| 3141 static v8::Handle<v8::Value> variadicDoubleMethodMethodCallback(const v8::Argume
nts& args) | |
| 3142 { | |
| 3143 return TestObjV8Internal::variadicDoubleMethodMethod(args); | |
| 3144 } | |
| 3145 | |
| 3146 static v8::Handle<v8::Value> variadicNodeMethodMethod(const v8::Arguments& args) | |
| 3147 { | |
| 3148 if (args.Length() < 1) | |
| 3149 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 3150 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 3151 V8TRYCATCH(Node*, head, V8Node::HasInstance(args[0], args.GetIsolate(), worl
dType(args.GetIsolate())) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(args[0
])) : 0); | |
| 3152 Vector<RefPtr<Node> > tail; | |
| 3153 for (int i = 1; i < args.Length(); ++i) { | |
| 3154 if (!V8Node::HasInstance(args[i], args.GetIsolate(), worldType(args.GetI
solate()))) | |
| 3155 return throwTypeError(0, args.GetIsolate()); | |
| 3156 tail.append(V8Node::toNative(v8::Handle<v8::Object>::Cast(args[i]))); | |
| 3157 } | |
| 3158 imp->variadicNodeMethod(head, tail); | |
| 3159 return v8Undefined(); | |
| 3160 } | |
| 3161 | |
| 3162 static v8::Handle<v8::Value> variadicNodeMethodMethodCallback(const v8::Argument
s& args) | |
| 3163 { | |
| 3164 return TestObjV8Internal::variadicNodeMethodMethod(args); | |
| 3165 } | |
| 3166 | |
| 3167 static v8::Handle<v8::Value> perWorldMethodMethod(const v8::Arguments& args) | |
| 3168 { | |
| 3169 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 3170 imp->perWorldMethod(); | |
| 3171 return v8Undefined(); | |
| 3172 } | |
| 3173 | |
| 3174 static v8::Handle<v8::Value> perWorldMethodMethodForMainWorld(const v8::Argument
s& args) | |
| 3175 { | |
| 3176 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 3177 imp->perWorldMethod(); | |
| 3178 return v8Undefined(); | |
| 3179 } | |
| 3180 | |
| 3181 static v8::Handle<v8::Value> perWorldMethodMethodCallback(const v8::Arguments& a
rgs) | |
| 3182 { | |
| 3183 return TestObjV8Internal::perWorldMethodMethod(args); | |
| 3184 } | |
| 3185 | |
| 3186 static v8::Handle<v8::Value> perWorldMethodMethodCallbackForMainWorld(const v8::
Arguments& args) | |
| 3187 { | |
| 3188 return TestObjV8Internal::perWorldMethodMethodForMainWorld(args); | |
| 3189 } | |
| 3190 | |
| 3191 static v8::Handle<v8::Value> overloadedPerWorldMethod1Method(const v8::Arguments
& args) | |
| 3192 { | |
| 3193 if (args.Length() < 1) | |
| 3194 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 3195 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 3196 V8TRYCATCH(int, longArg, toInt32(args[0])); | |
| 3197 imp->overloadedPerWorldMethod(longArg); | |
| 3198 return v8Undefined(); | |
| 3199 } | |
| 3200 | |
| 3201 static v8::Handle<v8::Value> overloadedPerWorldMethod1MethodForMainWorld(const v
8::Arguments& args) | |
| 3202 { | |
| 3203 if (args.Length() < 1) | |
| 3204 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 3205 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 3206 V8TRYCATCH(int, longArg, toInt32(args[0])); | |
| 3207 imp->overloadedPerWorldMethod(longArg); | |
| 3208 return v8Undefined(); | |
| 3209 } | |
| 3210 | |
| 3211 static v8::Handle<v8::Value> overloadedPerWorldMethod2Method(const v8::Arguments
& args) | |
| 3212 { | |
| 3213 if (args.Length() < 2) | |
| 3214 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 3215 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 3216 V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, strArg, args[0]); | |
| 3217 V8TRYCATCH(int, longArg, toInt32(args[1])); | |
| 3218 imp->overloadedPerWorldMethod(strArg, longArg); | |
| 3219 return v8Undefined(); | |
| 3220 } | |
| 3221 | |
| 3222 static v8::Handle<v8::Value> overloadedPerWorldMethod2MethodForMainWorld(const v
8::Arguments& args) | |
| 3223 { | |
| 3224 if (args.Length() < 2) | |
| 3225 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 3226 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 3227 V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, strArg, args[0]); | |
| 3228 V8TRYCATCH(int, longArg, toInt32(args[1])); | |
| 3229 imp->overloadedPerWorldMethod(strArg, longArg); | |
| 3230 return v8Undefined(); | |
| 3231 } | |
| 3232 | |
| 3233 static v8::Handle<v8::Value> overloadedPerWorldMethodMethod(const v8::Arguments&
args) | |
| 3234 { | |
| 3235 if (args.Length() == 1) | |
| 3236 return overloadedPerWorldMethod1Method(args); | |
| 3237 if (args.Length() == 2) | |
| 3238 return overloadedPerWorldMethod2Method(args); | |
| 3239 if (args.Length() < 1) | |
| 3240 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 3241 return throwTypeError(0, args.GetIsolate()); | |
| 3242 } | |
| 3243 | |
| 3244 static v8::Handle<v8::Value> overloadedPerWorldMethodMethodForMainWorld(const v8
::Arguments& args) | |
| 3245 { | |
| 3246 if (args.Length() == 1) | |
| 3247 return overloadedPerWorldMethod1MethodForMainWorld(args); | |
| 3248 if (args.Length() == 2) | |
| 3249 return overloadedPerWorldMethod2MethodForMainWorld(args); | |
| 3250 if (args.Length() < 1) | |
| 3251 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 3252 return throwTypeError(0, args.GetIsolate()); | |
| 3253 } | |
| 3254 | |
| 3255 static v8::Handle<v8::Value> overloadedPerWorldMethodMethodCallback(const v8::Ar
guments& args) | |
| 3256 { | |
| 3257 return TestObjV8Internal::overloadedPerWorldMethodMethod(args); | |
| 3258 } | |
| 3259 | |
| 3260 static v8::Handle<v8::Value> overloadedPerWorldMethodMethodCallbackForMainWorld(
const v8::Arguments& args) | |
| 3261 { | |
| 3262 return TestObjV8Internal::overloadedPerWorldMethodMethodForMainWorld(args); | |
| 3263 } | |
| 3264 | |
| 3265 static v8::Handle<v8::Value> constructor(const v8::Arguments& args) | |
| 3266 { | |
| 3267 if (args.Length() < 1) | |
| 3268 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 3269 if (args.Length() <= 0 || !args[0]->IsFunction()) | |
| 3270 return throwTypeError(0, args.GetIsolate()); | |
| 3271 RefPtr<TestCallback> testCallback = V8TestCallback::create(args[0], getScrip
tExecutionContext()); | |
| 3272 | |
| 3273 RefPtr<TestObj> impl = TestObj::create(testCallback); | |
| 3274 v8::Handle<v8::Object> wrapper = args.Holder(); | |
| 3275 | |
| 3276 V8DOMWrapper::associateObjectWithWrapper(impl.release(), &V8TestObj::info, w
rapper, args.GetIsolate(), WrapperConfiguration::Dependent); | |
| 3277 return wrapper; | |
| 3278 } | |
| 3279 | |
| 3280 } // namespace TestObjV8Internal | |
| 3281 | |
| 3282 static const V8DOMConfiguration::BatchedAttribute V8TestObjAttrs[] = { | |
| 3283 // Attribute 'readOnlyLongAttr' (Type: 'readonly attribute' ExtAttr: '') | |
| 3284 {"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 */}, | |
| 3285 // Attribute 'readOnlyStringAttr' (Type: 'readonly attribute' ExtAttr: '') | |
| 3286 {"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 */}, | |
| 3287 // Attribute 'readOnlyTestObjAttr' (Type: 'readonly attribute' ExtAttr: '') | |
| 3288 {"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 */}, | |
| 3289 // Attribute 'staticReadOnlyLongAttr' (Type: 'readonly attribute' ExtAttr: '
') | |
| 3290 {"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 */}, | |
| 3291 // Attribute 'staticStringAttr' (Type: 'attribute' ExtAttr: '') | |
| 3292 {"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 */}, | |
| 3293 // Attribute 'TestSubObj' (Type: 'readonly attribute' ExtAttr: '') | |
| 3294 {"TestSubObj", TestObjV8Internal::TestObjConstructorGetter, 0, 0, 0, &V8Test
SubObj::info, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Prope
rtyAttribute>(v8::None), 0 /* on instance */}, | |
| 3295 // Attribute 'enumAttr' (Type: 'attribute' ExtAttr: '') | |
| 3296 {"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 */}, | |
| 3297 // Attribute 'shortAttr' (Type: 'attribute' ExtAttr: '') | |
| 3298 {"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 */}, | |
| 3299 // Attribute 'unsignedShortAttr' (Type: 'attribute' ExtAttr: '') | |
| 3300 {"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 */}, | |
| 3301 // Attribute 'longAttr' (Type: 'attribute' ExtAttr: '') | |
| 3302 {"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 */}, | |
| 3303 // Attribute 'longLongAttr' (Type: 'attribute' ExtAttr: '') | |
| 3304 {"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 */}, | |
| 3305 // Attribute 'unsignedLongLongAttr' (Type: 'attribute' ExtAttr: '') | |
| 3306 {"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 */}, | |
| 3307 // Attribute 'stringAttr' (Type: 'attribute' ExtAttr: '') | |
| 3308 {"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 */}, | |
| 3309 // Attribute 'testObjAttr' (Type: 'attribute' ExtAttr: 'V8MeasureAs') | |
| 3310 {"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 */}, | |
| 3311 // Attribute 'XMLObjAttr' (Type: 'attribute' ExtAttr: '') | |
| 3312 {"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 */}, | |
| 3313 // Attribute 'create' (Type: 'attribute' ExtAttr: '') | |
| 3314 {"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 */}, | |
| 3315 // Attribute 'reflectedStringAttr' (Type: 'attribute' ExtAttr: 'Reflect') | |
| 3316 {"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 */}, | |
| 3317 // Attribute 'reflectedIntegralAttr' (Type: 'attribute' ExtAttr: 'Reflect') | |
| 3318 {"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 */}, | |
| 3319 // Attribute 'reflectedUnsignedIntegralAttr' (Type: 'attribute' ExtAttr: 'Re
flect') | |
| 3320 {"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 */}, | |
| 3321 // Attribute 'reflectedBooleanAttr' (Type: 'attribute' ExtAttr: 'Reflect') | |
| 3322 {"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 */}, | |
| 3323 // Attribute 'reflectedURLAttr' (Type: 'attribute' ExtAttr: 'URL Reflect') | |
| 3324 {"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 */}, | |
| 3325 // Attribute 'reflectedStringAttr' (Type: 'attribute' ExtAttr: 'Reflect') | |
| 3326 {"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 */}, | |
| 3327 // Attribute 'reflectedCustomIntegralAttr' (Type: 'attribute' ExtAttr: 'Refl
ect') | |
| 3328 {"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 */}, | |
| 3329 // Attribute 'reflectedCustomBooleanAttr' (Type: 'attribute' ExtAttr: 'Refle
ct') | |
| 3330 {"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 */}, | |
| 3331 // Attribute 'reflectedCustomURLAttr' (Type: 'attribute' ExtAttr: 'URL Refle
ct') | |
| 3332 {"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 */}, | |
| 3333 // Attribute 'typedArrayAttr' (Type: 'attribute' ExtAttr: '') | |
| 3334 {"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 */}, | |
| 3335 // Attribute 'attrWithGetterException' (Type: 'attribute' ExtAttr: '') | |
| 3336 {"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 */}, | |
| 3337 // Attribute 'attrWithSetterException' (Type: 'attribute' ExtAttr: '') | |
| 3338 {"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 */}, | |
| 3339 // Attribute 'stringAttrWithGetterException' (Type: 'attribute' ExtAttr: '') | |
| 3340 {"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 */}, | |
| 3341 // Attribute 'stringAttrWithSetterException' (Type: 'attribute' ExtAttr: '') | |
| 3342 {"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 */}, | |
| 3343 // Attribute 'customAttr' (Type: 'attribute' ExtAttr: 'Custom') | |
| 3344 {"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 */}, | |
| 3345 // Attribute 'withScriptStateAttribute' (Type: 'attribute' ExtAttr: 'CallWit
h') | |
| 3346 {"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 */}, | |
| 3347 // Attribute 'withScriptExecutionContextAttribute' (Type: 'attribute' ExtAtt
r: 'CallWith') | |
| 3348 {"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 */}, | |
| 3349 // Attribute 'withScriptStateAttributeRaises' (Type: 'attribute' ExtAttr: 'C
allWith') | |
| 3350 {"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 */}, | |
| 3351 // Attribute 'withScriptExecutionContextAttributeRaises' (Type: 'attribute'
ExtAttr: 'CallWith') | |
| 3352 {"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 */}, | |
| 3353 // Attribute 'withScriptExecutionContextAndScriptStateAttribute' (Type: 'att
ribute' ExtAttr: 'CallWith') | |
| 3354 {"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 */}, | |
| 3355 // Attribute 'withScriptExecutionContextAndScriptStateAttributeRaises' (Type
: 'attribute' ExtAttr: 'CallWith') | |
| 3356 {"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 */}, | |
| 3357 // Attribute 'withScriptExecutionContextAndScriptStateWithSpacesAttribute' (
Type: 'attribute' ExtAttr: 'CallWith') | |
| 3358 {"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 */}, | |
| 3359 // Attribute 'withScriptArgumentsAndCallStackAttribute' (Type: 'attribute' E
xtAttr: 'CallWith') | |
| 3360 {"withScriptArgumentsAndCallStackAttribute", TestObjV8Internal::withScriptAr
gumentsAndCallStackAttributeAttrGetterCallback, TestObjV8Internal::withScriptArg
umentsAndCallStackAttributeAttrSetterCallback, 0, 0, 0 /* no data */, static_cas
t<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None),
0 /* on instance */}, | |
| 3361 // Attribute 'enforcedRangeLongAttr' (Type: 'attribute' ExtAttr: 'EnforceRan
ge') | |
| 3362 {"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 */}, | |
| 3363 // Attribute 'enforcedRangeUnsignedLongAttr' (Type: 'attribute' ExtAttr: 'En
forceRange') | |
| 3364 {"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 */}, | |
| 3365 // Attribute 'enforcedRangeLongLongAttr' (Type: 'attribute' ExtAttr: 'Enforc
eRange') | |
| 3366 {"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 */}, | |
| 3367 // Attribute 'enforcedRangeUnsignedLongLongAttr' (Type: 'attribute' ExtAttr:
'EnforceRange') | |
| 3368 {"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 */}
, | |
| 3369 #if ENABLE(Condition1) | |
| 3370 // Attribute 'conditionalAttr1' (Type: 'attribute' ExtAttr: 'Conditional') | |
| 3371 {"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 */}, | |
| 3372 #endif // ENABLE(Condition1) | |
| 3373 #if ENABLE(Condition1) && ENABLE(Condition2) | |
| 3374 // Attribute 'conditionalAttr2' (Type: 'attribute' ExtAttr: 'Conditional') | |
| 3375 {"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 */}, | |
| 3376 #endif // ENABLE(Condition1) && ENABLE(Condition2) | |
| 3377 #if ENABLE(Condition1) || ENABLE(Condition2) | |
| 3378 // Attribute 'conditionalAttr3' (Type: 'attribute' ExtAttr: 'Conditional') | |
| 3379 {"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 */}, | |
| 3380 #endif // ENABLE(Condition1) || ENABLE(Condition2) | |
| 3381 #if ENABLE(Condition1) | |
| 3382 // Attribute 'conditionalAttr4' (Type: 'attribute' ExtAttr: 'Conditional') | |
| 3383 {"conditionalAttr4", TestObjV8Internal::TestObjConstructorGetter, TestObjV8I
nternal::TestObjReplaceableAttrSetterCallback, 0, 0, &V8TestObjectA::info, stati
c_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::N
one), 0 /* on instance */}, | |
| 3384 #endif // ENABLE(Condition1) | |
| 3385 #if ENABLE(Condition1) && ENABLE(Condition2) | |
| 3386 // Attribute 'conditionalAttr5' (Type: 'attribute' ExtAttr: 'Conditional') | |
| 3387 {"conditionalAttr5", TestObjV8Internal::TestObjConstructorGetter, TestObjV8I
nternal::TestObjReplaceableAttrSetterCallback, 0, 0, &V8TestObjectB::info, stati
c_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::N
one), 0 /* on instance */}, | |
| 3388 #endif // ENABLE(Condition1) && ENABLE(Condition2) | |
| 3389 #if ENABLE(Condition1) || ENABLE(Condition2) | |
| 3390 // Attribute 'conditionalAttr6' (Type: 'attribute' ExtAttr: 'Conditional') | |
| 3391 {"conditionalAttr6", TestObjV8Internal::TestObjConstructorGetter, TestObjV8I
nternal::TestObjReplaceableAttrSetterCallback, 0, 0, &V8TestObjectC::info, stati
c_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::N
one), 0 /* on instance */}, | |
| 3392 #endif // ENABLE(Condition1) || ENABLE(Condition2) | |
| 3393 // Attribute 'cachedAttribute1' (Type: 'readonly attribute' ExtAttr: 'Cached
Attribute') | |
| 3394 {"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 */}, | |
| 3395 // Attribute 'cachedAttribute2' (Type: 'readonly attribute' ExtAttr: 'Cached
Attribute') | |
| 3396 {"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 */}, | |
| 3397 // Attribute 'anyAttribute' (Type: 'attribute' ExtAttr: '') | |
| 3398 {"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 */}, | |
| 3399 // Attribute 'floatArray' (Type: 'attribute' ExtAttr: '') | |
| 3400 {"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 */}, | |
| 3401 // Attribute 'doubleArray' (Type: 'attribute' ExtAttr: '') | |
| 3402 {"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 */}, | |
| 3403 // Attribute 'contentDocument' (Type: 'readonly attribute' ExtAttr: 'CheckSe
curityForNode') | |
| 3404 {"contentDocument", TestObjV8Internal::contentDocumentAttrGetterCallback, 0,
0, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast
<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | |
| 3405 // Attribute 'mutablePoint' (Type: 'attribute' ExtAttr: '') | |
| 3406 {"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 */}, | |
| 3407 // Attribute 'immutablePoint' (Type: 'attribute' ExtAttr: 'Immutable') | |
| 3408 {"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 */}, | |
| 3409 // Attribute 'strawberry' (Type: 'attribute' ExtAttr: 'ImplementedAs') | |
| 3410 {"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 */}, | |
| 3411 // Attribute 'strictFloat' (Type: 'attribute' ExtAttr: 'StrictTypeChecking') | |
| 3412 {"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 */}, | |
| 3413 // Attribute 'description' (Type: 'readonly attribute' ExtAttr: '') | |
| 3414 {"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 */}, | |
| 3415 // Attribute 'id' (Type: 'attribute' ExtAttr: '') | |
| 3416 {"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 */}, | |
| 3417 // Attribute 'hash' (Type: 'readonly attribute' ExtAttr: '') | |
| 3418 {"hash", TestObjV8Internal::hashAttrGetterCallback, 0, 0, 0, 0 /* no data */
, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute
>(v8::None), 0 /* on instance */}, | |
| 3419 // Attribute 'replaceableAttribute' (Type: 'readonly attribute' ExtAttr: 'Re
placeable') | |
| 3420 {"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 */}, | |
| 3421 // Attribute 'nullableDoubleAttribute' (Type: 'readonly attribute' ExtAttr:
'') | |
| 3422 {"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 */}, | |
| 3423 // Attribute 'nullableLongAttribute' (Type: 'readonly attribute' ExtAttr: ''
) | |
| 3424 {"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 */}, | |
| 3425 // Attribute 'nullableBooleanAttribute' (Type: 'readonly attribute' ExtAttr:
'') | |
| 3426 {"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 */}, | |
| 3427 // Attribute 'nullableStringAttribute' (Type: 'readonly attribute' ExtAttr:
'') | |
| 3428 {"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 */}, | |
| 3429 // Attribute 'nullableLongSettableAttribute' (Type: 'attribute' ExtAttr: '') | |
| 3430 {"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 */}, | |
| 3431 // Attribute 'nullableStringValue' (Type: 'attribute' ExtAttr: '') | |
| 3432 {"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 */}, | |
| 3433 // Attribute 'perWorldReadOnlyAttribute' (Type: 'readonly attribute' ExtAttr
: 'V8PerWorldBindings') | |
| 3434 {"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 */}, | |
| 3435 // Attribute 'perWorldAttribute' (Type: 'attribute' ExtAttr: 'V8PerWorldBind
ings') | |
| 3436 {"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 *
/}, | |
| 3437 }; | |
| 3438 | |
| 3439 static const V8DOMConfiguration::BatchedMethod V8TestObjMethods[] = { | |
| 3440 {"voidMethod", TestObjV8Internal::voidMethodMethodCallback, 0}, | |
| 3441 {"longMethod", TestObjV8Internal::longMethodMethodCallback, 0}, | |
| 3442 {"objMethod", TestObjV8Internal::objMethodMethodCallback, 0}, | |
| 3443 {"methodReturningSequence", TestObjV8Internal::methodReturningSequenceMethod
Callback, 0}, | |
| 3444 {"serializedValue", TestObjV8Internal::serializedValueMethodCallback, 0}, | |
| 3445 {"optionsObject", TestObjV8Internal::optionsObjectMethodCallback, 0}, | |
| 3446 {"methodWithException", TestObjV8Internal::methodWithExceptionMethodCallback
, 0}, | |
| 3447 {"customMethod", TestObjV8Internal::customMethodMethodCallback, 0}, | |
| 3448 {"customMethodWithArgs", TestObjV8Internal::customMethodWithArgsMethodCallba
ck, 0}, | |
| 3449 {"addEventListener", TestObjV8Internal::addEventListenerMethodCallback, 0}, | |
| 3450 {"removeEventListener", TestObjV8Internal::removeEventListenerMethodCallback
, 0}, | |
| 3451 {"withScriptStateVoid", TestObjV8Internal::withScriptStateVoidMethodCallback
, 0}, | |
| 3452 {"withScriptStateObj", TestObjV8Internal::withScriptStateObjMethodCallback,
0}, | |
| 3453 {"withScriptStateVoidException", TestObjV8Internal::withScriptStateVoidExcep
tionMethodCallback, 0}, | |
| 3454 {"withScriptStateObjException", TestObjV8Internal::withScriptStateObjExcepti
onMethodCallback, 0}, | |
| 3455 {"withScriptExecutionContext", TestObjV8Internal::withScriptExecutionContext
MethodCallback, 0}, | |
| 3456 {"withScriptExecutionContextAndScriptState", TestObjV8Internal::withScriptEx
ecutionContextAndScriptStateMethodCallback, 0}, | |
| 3457 {"withScriptExecutionContextAndScriptStateObjException", TestObjV8Internal::
withScriptExecutionContextAndScriptStateObjExceptionMethodCallback, 0}, | |
| 3458 {"withScriptExecutionContextAndScriptStateWithSpaces", TestObjV8Internal::wi
thScriptExecutionContextAndScriptStateWithSpacesMethodCallback, 0}, | |
| 3459 {"withScriptArgumentsAndCallStack", TestObjV8Internal::withScriptArgumentsAn
dCallStackMethodCallback, 0}, | |
| 3460 {"methodWithOptionalArg", TestObjV8Internal::methodWithOptionalArgMethodCall
back, 0}, | |
| 3461 {"methodWithNonOptionalArgAndOptionalArg", TestObjV8Internal::methodWithNonO
ptionalArgAndOptionalArgMethodCallback, 0}, | |
| 3462 {"methodWithNonOptionalArgAndTwoOptionalArgs", TestObjV8Internal::methodWith
NonOptionalArgAndTwoOptionalArgsMethodCallback, 0}, | |
| 3463 {"methodWithOptionalString", TestObjV8Internal::methodWithOptionalStringMeth
odCallback, 0}, | |
| 3464 {"methodWithOptionalStringIsUndefined", TestObjV8Internal::methodWithOptiona
lStringIsUndefinedMethodCallback, 0}, | |
| 3465 {"methodWithOptionalStringIsNullString", TestObjV8Internal::methodWithOption
alStringIsNullStringMethodCallback, 0}, | |
| 3466 {"methodWithCallbackArg", TestObjV8Internal::methodWithCallbackArgMethodCall
back, 0}, | |
| 3467 {"methodWithNonCallbackArgAndCallbackArg", TestObjV8Internal::methodWithNonC
allbackArgAndCallbackArgMethodCallback, 0}, | |
| 3468 {"methodWithCallbackAndOptionalArg", TestObjV8Internal::methodWithCallbackAn
dOptionalArgMethodCallback, 0}, | |
| 3469 {"methodWithEnforceRangeInt32", TestObjV8Internal::methodWithEnforceRangeInt
32MethodCallback, 0}, | |
| 3470 {"methodWithEnforceRangeUInt32", TestObjV8Internal::methodWithEnforceRangeUI
nt32MethodCallback, 0}, | |
| 3471 {"methodWithEnforceRangeInt64", TestObjV8Internal::methodWithEnforceRangeInt
64MethodCallback, 0}, | |
| 3472 {"methodWithEnforceRangeUInt64", TestObjV8Internal::methodWithEnforceRangeUI
nt64MethodCallback, 0}, | |
| 3473 #if ENABLE(Condition1) | |
| 3474 {"conditionalMethod1", TestObjV8Internal::conditionalMethod1MethodCallback,
0}, | |
| 3475 #endif | |
| 3476 #if ENABLE(Condition1) && ENABLE(Condition2) | |
| 3477 {"conditionalMethod2", TestObjV8Internal::conditionalMethod2MethodCallback,
0}, | |
| 3478 #endif | |
| 3479 #if ENABLE(Condition1) || ENABLE(Condition2) | |
| 3480 {"conditionalMethod3", TestObjV8Internal::conditionalMethod3MethodCallback,
0}, | |
| 3481 #endif | |
| 3482 {"overloadedMethod", TestObjV8Internal::overloadedMethodMethodCallback, 0}, | |
| 3483 {"classMethodWithClamp", TestObjV8Internal::classMethodWithClampMethodCallba
ck, 0}, | |
| 3484 {"getSVGDocument", TestObjV8Internal::getSVGDocumentMethodCallback, 0}, | |
| 3485 {"mutablePointFunction", TestObjV8Internal::mutablePointFunctionMethodCallba
ck, 0}, | |
| 3486 {"immutablePointFunction", TestObjV8Internal::immutablePointFunctionMethodCa
llback, 0}, | |
| 3487 {"orange", TestObjV8Internal::orangeMethodCallback, 0}, | |
| 3488 {"strictFunction", TestObjV8Internal::strictFunctionMethodCallback, 0}, | |
| 3489 {"variadicStringMethod", TestObjV8Internal::variadicStringMethodMethodCallba
ck, 0}, | |
| 3490 {"variadicDoubleMethod", TestObjV8Internal::variadicDoubleMethodMethodCallba
ck, 0}, | |
| 3491 {"perWorldMethod", TestObjV8Internal::perWorldMethodMethodCallback, TestObjV
8Internal::perWorldMethodMethodCallbackForMainWorld}, | |
| 3492 {"overloadedPerWorldMethod", TestObjV8Internal::overloadedPerWorldMethodMeth
odCallback, TestObjV8Internal::overloadedPerWorldMethodMethodCallbackForMainWorl
d}, | |
| 3493 }; | |
| 3494 | |
| 3495 static const V8DOMConfiguration::BatchedConstant V8TestObjConsts[] = { | |
| 3496 #if ENABLE(Condition1) | |
| 3497 {"CONDITIONAL_CONST", 0}, | |
| 3498 #endif | |
| 3499 {"CONST_VALUE_0", 0}, | |
| 3500 {"CONST_VALUE_1", 1}, | |
| 3501 {"CONST_VALUE_2", 2}, | |
| 3502 {"CONST_VALUE_4", 4}, | |
| 3503 {"CONST_VALUE_8", 8}, | |
| 3504 {"CONST_VALUE_9", -1}, | |
| 3505 {"CONST_VALUE_10", "my constant string"}, | |
| 3506 {"CONST_VALUE_11", -1}, | |
| 3507 {"CONST_VALUE_12", 1}, | |
| 3508 {"CONST_VALUE_13", 0X20}, | |
| 3509 {"CONST_VALUE_14", 6844}, | |
| 3510 {"CONST_JAVASCRIPT", 15}, | |
| 3511 }; | |
| 3512 | |
| 3513 | |
| 3514 #if ENABLE(Condition1) | |
| 3515 COMPILE_ASSERT(0 == TestObj::CONDITIONAL_CONST, TestObjEnumCONDITIONAL_CONSTIsWr
ongUseDoNotCheckConstants); | |
| 3516 #endif | |
| 3517 COMPILE_ASSERT(0 == TestObj::CONST_VALUE_0, TestObjEnumCONST_VALUE_0IsWrongUseDo
NotCheckConstants); | |
| 3518 COMPILE_ASSERT(1 == TestObj::CONST_VALUE_1, TestObjEnumCONST_VALUE_1IsWrongUseDo
NotCheckConstants); | |
| 3519 COMPILE_ASSERT(2 == TestObj::CONST_VALUE_2, TestObjEnumCONST_VALUE_2IsWrongUseDo
NotCheckConstants); | |
| 3520 COMPILE_ASSERT(4 == TestObj::CONST_VALUE_4, TestObjEnumCONST_VALUE_4IsWrongUseDo
NotCheckConstants); | |
| 3521 COMPILE_ASSERT(8 == TestObj::CONST_VALUE_8, TestObjEnumCONST_VALUE_8IsWrongUseDo
NotCheckConstants); | |
| 3522 COMPILE_ASSERT(-1 == TestObj::CONST_VALUE_9, TestObjEnumCONST_VALUE_9IsWrongUseD
oNotCheckConstants); | |
| 3523 COMPILE_ASSERT("my constant string" == TestObj::CONST_VALUE_10, TestObjEnumCONST
_VALUE_10IsWrongUseDoNotCheckConstants); | |
| 3524 COMPILE_ASSERT(0xffffffff == TestObj::CONST_VALUE_11, TestObjEnumCONST_VALUE_11I
sWrongUseDoNotCheckConstants); | |
| 3525 COMPILE_ASSERT(0x01 == TestObj::CONST_VALUE_12, TestObjEnumCONST_VALUE_12IsWrong
UseDoNotCheckConstants); | |
| 3526 COMPILE_ASSERT(0X20 == TestObj::CONST_VALUE_13, TestObjEnumCONST_VALUE_13IsWrong
UseDoNotCheckConstants); | |
| 3527 COMPILE_ASSERT(0x1abc == TestObj::CONST_VALUE_14, TestObjEnumCONST_VALUE_14IsWro
ngUseDoNotCheckConstants); | |
| 3528 COMPILE_ASSERT(15 == TestObj::CONST_IMPL, TestObjEnumCONST_IMPLIsWrongUseDoNotCh
eckConstants); | |
| 3529 | |
| 3530 v8::Handle<v8::Value> V8TestObj::constructorCallback(const v8::Arguments& args) | |
| 3531 { | |
| 3532 if (!args.IsConstructCall()) | |
| 3533 return throwTypeError("DOM object constructor cannot be called as a func
tion.", args.GetIsolate()); | |
| 3534 | |
| 3535 if (ConstructorMode::current() == ConstructorMode::WrapExistingObject) | |
| 3536 return args.Holder(); | |
| 3537 | |
| 3538 return TestObjV8Internal::constructor(args); | |
| 3539 } | |
| 3540 | |
| 3541 static v8::Persistent<v8::FunctionTemplate> ConfigureV8TestObjTemplate(v8::Persi
stent<v8::FunctionTemplate> desc, v8::Isolate* isolate, WrapperWorldType current
WorldType) | |
| 3542 { | |
| 3543 desc->ReadOnlyPrototype(); | |
| 3544 | |
| 3545 v8::Local<v8::Signature> defaultSignature; | |
| 3546 defaultSignature = V8DOMConfiguration::configureTemplate(desc, "TestObject",
v8::Persistent<v8::FunctionTemplate>(), V8TestObj::internalFieldCount, | |
| 3547 V8TestObjAttrs, WTF_ARRAY_LENGTH(V8TestObjAttrs), | |
| 3548 V8TestObjMethods, WTF_ARRAY_LENGTH(V8TestObjMethods), isolate, currentWo
rldType); | |
| 3549 UNUSED_PARAM(defaultSignature); // In some cases, it will not be used. | |
| 3550 desc->SetCallHandler(V8TestObj::constructorCallback); | |
| 3551 v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate(); | |
| 3552 v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate(); | |
| 3553 UNUSED_PARAM(instance); // In some cases, it will not be used. | |
| 3554 UNUSED_PARAM(proto); // In some cases, it will not be used. | |
| 3555 | |
| 3556 if (RuntimeEnabledFeatures::enabledAtRuntimeAttr1Enabled()) { | |
| 3557 static const V8DOMConfiguration::BatchedAttribute attrData =\ | |
| 3558 // Attribute 'enabledAtRuntimeAttr1' (Type: 'attribute' ExtAttr: 'V8Enab
ledAtRuntime') | |
| 3559 {"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 */}; | |
| 3560 V8DOMConfiguration::configureAttribute(instance, proto, attrData, isolat
e, currentWorldType); | |
| 3561 } | |
| 3562 if (RuntimeEnabledFeatures::featureNameEnabled()) { | |
| 3563 static const V8DOMConfiguration::BatchedAttribute attrData =\ | |
| 3564 // Attribute 'enabledAtRuntimeAttr2' (Type: 'attribute' ExtAttr: 'V8Enab
ledAtRuntime') | |
| 3565 {"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 */}; | |
| 3566 V8DOMConfiguration::configureAttribute(instance, proto, attrData, isolat
e, currentWorldType); | |
| 3567 } | |
| 3568 | |
| 3569 // Custom Signature 'voidMethodWithArgs' | |
| 3570 const int voidMethodWithArgsArgc = 3; | |
| 3571 v8::Handle<v8::FunctionTemplate> voidMethodWithArgsArgv[voidMethodWithArgsAr
gc] = { v8::Handle<v8::FunctionTemplate>(), v8::Handle<v8::FunctionTemplate>(),
V8PerIsolateData::from(isolate)->rawTemplate(&V8TestObj::info, currentWorldType)
}; | |
| 3572 v8::Handle<v8::Signature> voidMethodWithArgsSignature = v8::Signature::New(d
esc, voidMethodWithArgsArgc, voidMethodWithArgsArgv); | |
| 3573 proto->Set(v8::String::NewSymbol("voidMethodWithArgs"), v8::FunctionTemplate
::New(TestObjV8Internal::voidMethodWithArgsMethodCallback, v8Undefined(), voidMe
thodWithArgsSignature)); | |
| 3574 | |
| 3575 // Custom Signature 'longMethodWithArgs' | |
| 3576 const int longMethodWithArgsArgc = 3; | |
| 3577 v8::Handle<v8::FunctionTemplate> longMethodWithArgsArgv[longMethodWithArgsAr
gc] = { v8::Handle<v8::FunctionTemplate>(), v8::Handle<v8::FunctionTemplate>(),
V8PerIsolateData::from(isolate)->rawTemplate(&V8TestObj::info, currentWorldType)
}; | |
| 3578 v8::Handle<v8::Signature> longMethodWithArgsSignature = v8::Signature::New(d
esc, longMethodWithArgsArgc, longMethodWithArgsArgv); | |
| 3579 proto->Set(v8::String::NewSymbol("longMethodWithArgs"), v8::FunctionTemplate
::New(TestObjV8Internal::longMethodWithArgsMethodCallback, v8Undefined(), longMe
thodWithArgsSignature)); | |
| 3580 | |
| 3581 // Custom Signature 'objMethodWithArgs' | |
| 3582 const int objMethodWithArgsArgc = 3; | |
| 3583 v8::Handle<v8::FunctionTemplate> objMethodWithArgsArgv[objMethodWithArgsArgc
] = { v8::Handle<v8::FunctionTemplate>(), v8::Handle<v8::FunctionTemplate>(), V8
PerIsolateData::from(isolate)->rawTemplate(&V8TestObj::info, currentWorldType) }
; | |
| 3584 v8::Handle<v8::Signature> objMethodWithArgsSignature = v8::Signature::New(de
sc, objMethodWithArgsArgc, objMethodWithArgsArgv); | |
| 3585 proto->Set(v8::String::NewSymbol("objMethodWithArgs"), v8::FunctionTemplate:
:New(TestObjV8Internal::objMethodWithArgsMethodCallback, v8Undefined(), objMetho
dWithArgsSignature)); | |
| 3586 | |
| 3587 // Custom Signature 'methodWithSequenceArg' | |
| 3588 const int methodWithSequenceArgArgc = 1; | |
| 3589 v8::Handle<v8::FunctionTemplate> methodWithSequenceArgArgv[methodWithSequenc
eArgArgc] = { V8PerIsolateData::from(isolate)->rawTemplate(&V8sequence<ScriptPro
file>::info, currentWorldType) }; | |
| 3590 v8::Handle<v8::Signature> methodWithSequenceArgSignature = v8::Signature::Ne
w(desc, methodWithSequenceArgArgc, methodWithSequenceArgArgv); | |
| 3591 proto->Set(v8::String::NewSymbol("methodWithSequenceArg"), v8::FunctionTempl
ate::New(TestObjV8Internal::methodWithSequenceArgMethodCallback, v8Undefined(),
methodWithSequenceArgSignature)); | |
| 3592 | |
| 3593 // Custom Signature 'methodWithEnumArg' | |
| 3594 const int methodWithEnumArgArgc = 1; | |
| 3595 v8::Handle<v8::FunctionTemplate> methodWithEnumArgArgv[methodWithEnumArgArgc
] = { V8PerIsolateData::from(isolate)->rawTemplate(&V8TestEnumType::info, curren
tWorldType) }; | |
| 3596 v8::Handle<v8::Signature> methodWithEnumArgSignature = v8::Signature::New(de
sc, methodWithEnumArgArgc, methodWithEnumArgArgv); | |
| 3597 proto->Set(v8::String::NewSymbol("methodWithEnumArg"), v8::FunctionTemplate:
:New(TestObjV8Internal::methodWithEnumArgMethodCallback, v8Undefined(), methodWi
thEnumArgSignature)); | |
| 3598 | |
| 3599 // Custom Signature 'methodThatRequiresAllArgsAndThrows' | |
| 3600 const int methodThatRequiresAllArgsAndThrowsArgc = 2; | |
| 3601 v8::Handle<v8::FunctionTemplate> methodThatRequiresAllArgsAndThrowsArgv[meth
odThatRequiresAllArgsAndThrowsArgc] = { v8::Handle<v8::FunctionTemplate>(), V8Pe
rIsolateData::from(isolate)->rawTemplate(&V8TestObj::info, currentWorldType) }; | |
| 3602 v8::Handle<v8::Signature> methodThatRequiresAllArgsAndThrowsSignature = v8::
Signature::New(desc, methodThatRequiresAllArgsAndThrowsArgc, methodThatRequiresA
llArgsAndThrowsArgv); | |
| 3603 proto->Set(v8::String::NewSymbol("methodThatRequiresAllArgsAndThrows"), v8::
FunctionTemplate::New(TestObjV8Internal::methodThatRequiresAllArgsAndThrowsMetho
dCallback, v8Undefined(), methodThatRequiresAllArgsAndThrowsSignature)); | |
| 3604 desc->Set(v8::String::NewSymbol("staticMethodWithCallbackAndOptionalArg"), v
8::FunctionTemplate::New(TestObjV8Internal::staticMethodWithCallbackAndOptionalA
rgMethodCallback, v8Undefined(), v8::Local<v8::Signature>())); | |
| 3605 desc->Set(v8::String::NewSymbol("staticMethodWithCallbackArg"), v8::Function
Template::New(TestObjV8Internal::staticMethodWithCallbackArgMethodCallback, v8Un
defined(), v8::Local<v8::Signature>())); | |
| 3606 desc->Set(v8::String::NewSymbol("classMethod"), v8::FunctionTemplate::New(Te
stObjV8Internal::classMethodMethodCallback, v8Undefined(), v8::Local<v8::Signatu
re>())); | |
| 3607 desc->Set(v8::String::NewSymbol("classMethodWithOptional"), v8::FunctionTemp
late::New(TestObjV8Internal::classMethodWithOptionalMethodCallback, v8Undefined(
), v8::Local<v8::Signature>())); | |
| 3608 desc->Set(v8::String::NewSymbol("classMethod2"), v8::FunctionTemplate::New(T
estObjV8Internal::classMethod2MethodCallback, v8Undefined(), v8::Local<v8::Signa
ture>())); | |
| 3609 #if ENABLE(Condition1) | |
| 3610 desc->Set(v8::String::NewSymbol("overloadedMethod1"), v8::FunctionTemplate::
New(TestObjV8Internal::overloadedMethod1MethodCallback, v8Undefined(), v8::Local
<v8::Signature>())); | |
| 3611 #endif // ENABLE(Condition1) | |
| 3612 if (RuntimeEnabledFeatures::enabledAtRuntimeMethod1Enabled()) | |
| 3613 proto->Set(v8::String::NewSymbol("enabledAtRuntimeMethod1"), v8::Functio
nTemplate::New(TestObjV8Internal::enabledAtRuntimeMethod1MethodCallback, v8Undef
ined(), defaultSignature)); | |
| 3614 if (RuntimeEnabledFeatures::featureNameEnabled()) | |
| 3615 proto->Set(v8::String::NewSymbol("enabledAtRuntimeMethod2"), v8::Functio
nTemplate::New(TestObjV8Internal::enabledAtRuntimeMethod2MethodCallback, v8Undef
ined(), defaultSignature)); | |
| 3616 | |
| 3617 // Custom Signature 'stringArrayFunction' | |
| 3618 const int stringArrayFunctionArgc = 1; | |
| 3619 v8::Handle<v8::FunctionTemplate> stringArrayFunctionArgv[stringArrayFunction
Argc] = { V8PerIsolateData::from(isolate)->rawTemplate(&V8DOMString[]::info, cur
rentWorldType) }; | |
| 3620 v8::Handle<v8::Signature> stringArrayFunctionSignature = v8::Signature::New(
desc, stringArrayFunctionArgc, stringArrayFunctionArgv); | |
| 3621 proto->Set(v8::String::NewSymbol("stringArrayFunction"), v8::FunctionTemplat
e::New(TestObjV8Internal::stringArrayFunctionMethodCallback, v8Undefined(), stri
ngArrayFunctionSignature)); | |
| 3622 | |
| 3623 // Custom Signature 'domStringListFunction' | |
| 3624 const int domStringListFunctionArgc = 1; | |
| 3625 v8::Handle<v8::FunctionTemplate> domStringListFunctionArgv[domStringListFunc
tionArgc] = { V8PerIsolateData::from(isolate)->rawTemplate(&V8DOMStringList::inf
o, currentWorldType) }; | |
| 3626 v8::Handle<v8::Signature> domStringListFunctionSignature = v8::Signature::Ne
w(desc, domStringListFunctionArgc, domStringListFunctionArgv); | |
| 3627 proto->Set(v8::String::NewSymbol("domStringListFunction"), v8::FunctionTempl
ate::New(TestObjV8Internal::domStringListFunctionMethodCallback, v8Undefined(),
domStringListFunctionSignature)); | |
| 3628 | |
| 3629 // Custom Signature 'convert1' | |
| 3630 const int convert1Argc = 1; | |
| 3631 v8::Handle<v8::FunctionTemplate> convert1Argv[convert1Argc] = { V8PerIsolate
Data::from(isolate)->rawTemplate(&V8a::info, currentWorldType) }; | |
| 3632 v8::Handle<v8::Signature> convert1Signature = v8::Signature::New(desc, conve
rt1Argc, convert1Argv); | |
| 3633 proto->Set(v8::String::NewSymbol("convert1"), v8::FunctionTemplate::New(Test
ObjV8Internal::convert1MethodCallback, v8Undefined(), convert1Signature)); | |
| 3634 | |
| 3635 // Custom Signature 'convert2' | |
| 3636 const int convert2Argc = 1; | |
| 3637 v8::Handle<v8::FunctionTemplate> convert2Argv[convert2Argc] = { V8PerIsolate
Data::from(isolate)->rawTemplate(&V8b::info, currentWorldType) }; | |
| 3638 v8::Handle<v8::Signature> convert2Signature = v8::Signature::New(desc, conve
rt2Argc, convert2Argv); | |
| 3639 proto->Set(v8::String::NewSymbol("convert2"), v8::FunctionTemplate::New(Test
ObjV8Internal::convert2MethodCallback, v8Undefined(), convert2Signature)); | |
| 3640 | |
| 3641 // Custom Signature 'convert4' | |
| 3642 const int convert4Argc = 1; | |
| 3643 v8::Handle<v8::FunctionTemplate> convert4Argv[convert4Argc] = { V8PerIsolate
Data::from(isolate)->rawTemplate(&V8d::info, currentWorldType) }; | |
| 3644 v8::Handle<v8::Signature> convert4Signature = v8::Signature::New(desc, conve
rt4Argc, convert4Argv); | |
| 3645 proto->Set(v8::String::NewSymbol("convert4"), v8::FunctionTemplate::New(Test
ObjV8Internal::convert4MethodCallback, v8Undefined(), convert4Signature)); | |
| 3646 | |
| 3647 // Custom Signature 'convert5' | |
| 3648 const int convert5Argc = 1; | |
| 3649 v8::Handle<v8::FunctionTemplate> convert5Argv[convert5Argc] = { V8PerIsolate
Data::from(isolate)->rawTemplate(&V8e::info, currentWorldType) }; | |
| 3650 v8::Handle<v8::Signature> convert5Signature = v8::Signature::New(desc, conve
rt5Argc, convert5Argv); | |
| 3651 proto->Set(v8::String::NewSymbol("convert5"), v8::FunctionTemplate::New(Test
ObjV8Internal::convert5MethodCallback, v8Undefined(), convert5Signature)); | |
| 3652 | |
| 3653 // Custom Signature 'variadicNodeMethod' | |
| 3654 const int variadicNodeMethodArgc = 2; | |
| 3655 v8::Handle<v8::FunctionTemplate> variadicNodeMethodArgv[variadicNodeMethodAr
gc] = { V8PerIsolateData::from(isolate)->rawTemplate(&V8Node::info, currentWorld
Type), V8PerIsolateData::from(isolate)->rawTemplate(&V8Node::info, currentWorldT
ype) }; | |
| 3656 v8::Handle<v8::Signature> variadicNodeMethodSignature = v8::Signature::New(d
esc, variadicNodeMethodArgc, variadicNodeMethodArgv); | |
| 3657 proto->Set(v8::String::NewSymbol("variadicNodeMethod"), v8::FunctionTemplate
::New(TestObjV8Internal::variadicNodeMethodMethodCallback, v8Undefined(), variad
icNodeMethodSignature)); | |
| 3658 V8DOMConfiguration::batchConfigureConstants(desc, proto, V8TestObjConsts, WT
F_ARRAY_LENGTH(V8TestObjConsts), isolate); | |
| 3659 | |
| 3660 // Custom toString template | |
| 3661 desc->Set(v8::String::NewSymbol("toString"), V8PerIsolateData::current()->to
StringTemplate()); | |
| 3662 return desc; | |
| 3663 } | |
| 3664 | |
| 3665 v8::Persistent<v8::FunctionTemplate> V8TestObj::GetTemplate(v8::Isolate* isolate
, WrapperWorldType currentWorldType) | |
| 3666 { | |
| 3667 V8PerIsolateData* data = V8PerIsolateData::from(isolate); | |
| 3668 V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWo
rldType).find(&info); | |
| 3669 if (result != data->templateMap(currentWorldType).end()) | |
| 3670 return result->value; | |
| 3671 | |
| 3672 v8::HandleScope handleScope; | |
| 3673 v8::Persistent<v8::FunctionTemplate> templ = | |
| 3674 ConfigureV8TestObjTemplate(data->rawTemplate(&info, currentWorldType), i
solate, currentWorldType); | |
| 3675 data->templateMap(currentWorldType).add(&info, templ); | |
| 3676 return templ; | |
| 3677 } | |
| 3678 | |
| 3679 bool V8TestObj::HasInstance(v8::Handle<v8::Value> value, v8::Isolate* isolate, W
rapperWorldType currentWorldType) | |
| 3680 { | |
| 3681 return V8PerIsolateData::from(isolate)->hasInstance(&info, value, currentWor
ldType); | |
| 3682 } | |
| 3683 | |
| 3684 bool V8TestObj::HasInstanceInAnyWorld(v8::Handle<v8::Value> value, v8::Isolate*
isolate) | |
| 3685 { | |
| 3686 return V8PerIsolateData::from(isolate)->hasInstance(&info, value, MainWorld) | |
| 3687 || V8PerIsolateData::from(isolate)->hasInstance(&info, value, IsolatedWo
rld) | |
| 3688 || V8PerIsolateData::from(isolate)->hasInstance(&info, value, WorkerWorl
d); | |
| 3689 } | |
| 3690 | |
| 3691 void V8TestObj::installPerContextProperties(v8::Handle<v8::Object> instance, Tes
tObj* impl, v8::Isolate* isolate) | |
| 3692 { | |
| 3693 v8::Local<v8::Object> proto = v8::Local<v8::Object>::Cast(instance->GetProto
type()); | |
| 3694 // When building QtWebkit with V8 this variable is unused when none of the f
eatures are enabled. | |
| 3695 UNUSED_PARAM(proto); | |
| 3696 if (ContextFeatures::enabledPerContextAttr1Enabled(impl->document())) { | |
| 3697 static const V8DOMConfiguration::BatchedAttribute attrData =\ | |
| 3698 // Attribute 'enabledPerContextAttr1' (Type: 'attribute' ExtAttr: 'V8Ena
bledPerContext') | |
| 3699 {"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 */}; | |
| 3700 V8DOMConfiguration::configureAttribute(instance, proto, attrData, isolat
e); | |
| 3701 } | |
| 3702 if (ContextFeatures::featureNameEnabled(impl->document())) { | |
| 3703 static const V8DOMConfiguration::BatchedAttribute attrData =\ | |
| 3704 // Attribute 'enabledPerContextAttr2' (Type: 'attribute' ExtAttr: 'V8Ena
bledPerContext') | |
| 3705 {"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 */}; | |
| 3706 V8DOMConfiguration::configureAttribute(instance, proto, attrData, isolat
e); | |
| 3707 } | |
| 3708 } | |
| 3709 | |
| 3710 void V8TestObj::installPerContextPrototypeProperties(v8::Handle<v8::Object> prot
o, v8::Isolate* isolate) | |
| 3711 { | |
| 3712 UNUSED_PARAM(proto); | |
| 3713 v8::Local<v8::Signature> defaultSignature = v8::Signature::New(GetTemplate(i
solate, worldType(isolate))); | |
| 3714 UNUSED_PARAM(defaultSignature); // In some cases, it will not be used. | |
| 3715 | |
| 3716 ScriptExecutionContext* context = toScriptExecutionContext(proto->CreationCo
ntext()); | |
| 3717 if (context && context->isDocument() && ContextFeatures::enabledPerContextMe
thod1Enabled(toDocument(context))) { | |
| 3718 proto->Set(v8::String::NewSymbol("enabledPerContextMethod1"), v8::Functi
onTemplate::New(TestObjV8Internal::enabledPerContextMethod1MethodCallback, v8Und
efined(), defaultSignature)->GetFunction()); | |
| 3719 } | |
| 3720 if (context && context->isDocument() && ContextFeatures::featureNameEnabled(
toDocument(context))) { | |
| 3721 proto->Set(v8::String::NewSymbol("enabledPerContextMethod2"), v8::Functi
onTemplate::New(TestObjV8Internal::enabledPerContextMethod2MethodCallback, v8Und
efined(), defaultSignature)->GetFunction()); | |
| 3722 } | |
| 3723 } | |
| 3724 | |
| 3725 | |
| 3726 v8::Handle<v8::Object> V8TestObj::createWrapper(PassRefPtr<TestObj> impl, v8::Ha
ndle<v8::Object> creationContext, v8::Isolate* isolate) | |
| 3727 { | |
| 3728 ASSERT(impl.get()); | |
| 3729 ASSERT(DOMDataStore::getWrapper(impl.get(), isolate).IsEmpty()); | |
| 3730 | |
| 3731 #if ENABLE(BINDING_INTEGRITY) | |
| 3732 checkTypeOrDieTrying(impl.get()); | |
| 3733 #endif | |
| 3734 | |
| 3735 v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext
, &info, impl.get(), isolate); | |
| 3736 if (UNLIKELY(wrapper.IsEmpty())) | |
| 3737 return wrapper; | |
| 3738 | |
| 3739 installPerContextProperties(wrapper, impl.get(), isolate); | |
| 3740 V8DOMWrapper::associateObjectWithWrapper(impl, &info, wrapper, isolate, hasD
ependentLifetime ? WrapperConfiguration::Dependent : WrapperConfiguration::Indep
endent); | |
| 3741 return wrapper; | |
| 3742 } | |
| 3743 void V8TestObj::derefObject(void* object) | |
| 3744 { | |
| 3745 static_cast<TestObj*>(object)->deref(); | |
| 3746 } | |
| 3747 | |
| 3748 } // namespace WebCore | |
| OLD | NEW |