Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / bindings / tests / results / V8TestSpecialOperationsIdentifierRaisesException.cpp
1 /*
2  * Copyright (C) 2013 Google Inc. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions are
6  * met:
7  *
8  *     * Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  *     * Redistributions in binary form must reproduce the above
11  * copyright notice, this list of conditions and the following disclaimer
12  * in the documentation and/or other materials provided with the
13  * distribution.
14  *     * Neither the name of Google Inc. nor the names of its
15  * contributors may be used to endorse or promote products derived from
16  * this software without specific prior written permission.
17  *
18  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29  */
30
31 // This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY!
32
33 #include "config.h"
34 #include "V8TestSpecialOperationsIdentifierRaisesException.h"
35
36 #include "RuntimeEnabledFeatures.h"
37 #include "V8TestInterfaceEmpty.h"
38 #include "bindings/v8/ExceptionState.h"
39 #include "bindings/v8/V8DOMConfiguration.h"
40 #include "bindings/v8/V8ObjectConstructor.h"
41 #include "core/dom/ContextFeatures.h"
42 #include "core/dom/Document.h"
43 #include "platform/TraceEvent.h"
44 #include "wtf/GetPtr.h"
45 #include "wtf/RefPtr.h"
46
47 namespace WebCore {
48
49 static void initializeScriptWrappableForInterface(TestSpecialOperationsIdentifierRaisesException* object)
50 {
51     if (ScriptWrappable::wrapperCanBeStoredInObject(object))
52         ScriptWrappable::setTypeInfoInObject(object, &V8TestSpecialOperationsIdentifierRaisesException::wrapperTypeInfo);
53     else
54         ASSERT_NOT_REACHED();
55 }
56
57 } // namespace WebCore
58
59 // In ScriptWrappable::init, the use of a local function declaration has an issue on Windows:
60 // the local declaration does not pick up the surrounding namespace. Therefore, we provide this function
61 // in the global namespace.
62 // (More info on the MSVC bug here: http://connect.microsoft.com/VisualStudio/feedback/details/664619/the-namespace-of-local-function-declarations-in-c)
63 void webCoreInitializeScriptWrappableForInterface(WebCore::TestSpecialOperationsIdentifierRaisesException* object)
64 {
65     WebCore::initializeScriptWrappableForInterface(object);
66 }
67
68 namespace WebCore {
69 const WrapperTypeInfo V8TestSpecialOperationsIdentifierRaisesException::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestSpecialOperationsIdentifierRaisesException::domTemplate, V8TestSpecialOperationsIdentifierRaisesException::derefObject, 0, 0, 0, V8TestSpecialOperationsIdentifierRaisesException::installPerContextEnabledMethods, 0, WrapperTypeObjectPrototype, false };
70
71 namespace TestSpecialOperationsIdentifierRaisesExceptionV8Internal {
72
73 template <typename T> void V8_USE(T) { }
74
75 static void itemMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
76 {
77     ExceptionState exceptionState(ExceptionState::ExecutionContext, "item", "TestSpecialOperationsIdentifierRaisesException", info.Holder(), info.GetIsolate());
78     if (UNLIKELY(info.Length() < 1)) {
79         exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
80         exceptionState.throwIfNeeded();
81         return;
82     }
83     TestSpecialOperationsIdentifierRaisesException* imp = V8TestSpecialOperationsIdentifierRaisesException::toNative(info.Holder());
84     V8TRYCATCH_EXCEPTION_VOID(unsigned, index, toUInt32(info[0], exceptionState), exceptionState);
85     RefPtr<TestInterfaceEmpty> result = imp->item(index, exceptionState);
86     if (exceptionState.throwIfNeeded())
87         return;
88     v8SetReturnValue(info, result.release());
89 }
90
91 static void itemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
92 {
93     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
94     TestSpecialOperationsIdentifierRaisesExceptionV8Internal::itemMethod(info);
95     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
96 }
97
98 static void setItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
99 {
100     ExceptionState exceptionState(ExceptionState::ExecutionContext, "setItem", "TestSpecialOperationsIdentifierRaisesException", info.Holder(), info.GetIsolate());
101     if (UNLIKELY(info.Length() < 2)) {
102         exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, info.Length()));
103         exceptionState.throwIfNeeded();
104         return;
105     }
106     TestSpecialOperationsIdentifierRaisesException* imp = V8TestSpecialOperationsIdentifierRaisesException::toNative(info.Holder());
107     V8TRYCATCH_EXCEPTION_VOID(unsigned, index, toUInt32(info[0], exceptionState), exceptionState);
108     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, value, info[1]);
109     String result = imp->setItem(index, value, exceptionState);
110     if (exceptionState.throwIfNeeded())
111         return;
112     v8SetReturnValueString(info, result, info.GetIsolate());
113 }
114
115 static void setItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
116 {
117     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
118     TestSpecialOperationsIdentifierRaisesExceptionV8Internal::setItemMethod(info);
119     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
120 }
121
122 static void deleteItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
123 {
124     ExceptionState exceptionState(ExceptionState::ExecutionContext, "deleteItem", "TestSpecialOperationsIdentifierRaisesException", info.Holder(), info.GetIsolate());
125     if (UNLIKELY(info.Length() < 1)) {
126         exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
127         exceptionState.throwIfNeeded();
128         return;
129     }
130     TestSpecialOperationsIdentifierRaisesException* imp = V8TestSpecialOperationsIdentifierRaisesException::toNative(info.Holder());
131     V8TRYCATCH_EXCEPTION_VOID(unsigned, index, toUInt32(info[0], exceptionState), exceptionState);
132     bool result = imp->deleteItem(index, exceptionState);
133     if (exceptionState.throwIfNeeded())
134         return;
135     v8SetReturnValueBool(info, result);
136 }
137
138 static void deleteItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
139 {
140     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
141     TestSpecialOperationsIdentifierRaisesExceptionV8Internal::deleteItemMethod(info);
142     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
143 }
144
145 static void namedItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
146 {
147     ExceptionState exceptionState(ExceptionState::ExecutionContext, "namedItem", "TestSpecialOperationsIdentifierRaisesException", info.Holder(), info.GetIsolate());
148     if (UNLIKELY(info.Length() < 1)) {
149         exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
150         exceptionState.throwIfNeeded();
151         return;
152     }
153     TestSpecialOperationsIdentifierRaisesException* imp = V8TestSpecialOperationsIdentifierRaisesException::toNative(info.Holder());
154     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, name, info[0]);
155     RefPtr<TestInterfaceEmpty> result = imp->namedItem(name, exceptionState);
156     if (exceptionState.throwIfNeeded())
157         return;
158     v8SetReturnValue(info, result.release());
159 }
160
161 static void namedItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
162 {
163     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
164     TestSpecialOperationsIdentifierRaisesExceptionV8Internal::namedItemMethod(info);
165     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
166 }
167
168 static void setNamedItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
169 {
170     ExceptionState exceptionState(ExceptionState::ExecutionContext, "setNamedItem", "TestSpecialOperationsIdentifierRaisesException", info.Holder(), info.GetIsolate());
171     if (UNLIKELY(info.Length() < 2)) {
172         exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, info.Length()));
173         exceptionState.throwIfNeeded();
174         return;
175     }
176     TestSpecialOperationsIdentifierRaisesException* imp = V8TestSpecialOperationsIdentifierRaisesException::toNative(info.Holder());
177     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, name, info[0]);
178     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, value, info[1]);
179     String result = imp->setNamedItem(name, value, exceptionState);
180     if (exceptionState.throwIfNeeded())
181         return;
182     v8SetReturnValueString(info, result, info.GetIsolate());
183 }
184
185 static void setNamedItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
186 {
187     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
188     TestSpecialOperationsIdentifierRaisesExceptionV8Internal::setNamedItemMethod(info);
189     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
190 }
191
192 static void deleteNamedItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
193 {
194     ExceptionState exceptionState(ExceptionState::ExecutionContext, "deleteNamedItem", "TestSpecialOperationsIdentifierRaisesException", info.Holder(), info.GetIsolate());
195     if (UNLIKELY(info.Length() < 1)) {
196         exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
197         exceptionState.throwIfNeeded();
198         return;
199     }
200     TestSpecialOperationsIdentifierRaisesException* imp = V8TestSpecialOperationsIdentifierRaisesException::toNative(info.Holder());
201     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, name, info[0]);
202     bool result = imp->deleteNamedItem(name, exceptionState);
203     if (exceptionState.throwIfNeeded())
204         return;
205     v8SetReturnValueBool(info, result);
206 }
207
208 static void deleteNamedItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
209 {
210     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
211     TestSpecialOperationsIdentifierRaisesExceptionV8Internal::deleteNamedItemMethod(info);
212     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
213 }
214
215 static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo<v8::Value>& info)
216 {
217     TestSpecialOperationsIdentifierRaisesException* imp = V8TestSpecialOperationsIdentifierRaisesException::toNative(info.Holder());
218     ExceptionState exceptionState(info.Holder(), info.GetIsolate());
219     RefPtr<TestInterfaceEmpty> result = imp->item(index, exceptionState);
220     if (exceptionState.throwIfNeeded())
221         return;
222     if (!result)
223         return;
224     v8SetReturnValueFast(info, result.release(), imp);
225 }
226
227 static void indexedPropertyGetterCallback(uint32_t index, const v8::PropertyCallbackInfo<v8::Value>& info)
228 {
229     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMIndexedProperty");
230     TestSpecialOperationsIdentifierRaisesExceptionV8Internal::indexedPropertyGetter(index, info);
231     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
232 }
233
234 static void indexedPropertySetter(uint32_t index, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<v8::Value>& info)
235 {
236     TestSpecialOperationsIdentifierRaisesException* imp = V8TestSpecialOperationsIdentifierRaisesException::toNative(info.Holder());
237     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, propertyValue, jsValue);
238     ExceptionState exceptionState(info.Holder(), info.GetIsolate());
239     bool result = imp->setItem(index, propertyValue, exceptionState);
240     if (exceptionState.throwIfNeeded())
241         return;
242     if (!result)
243         return;
244     v8SetReturnValue(info, jsValue);
245 }
246
247 static void indexedPropertySetterCallback(uint32_t index, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<v8::Value>& info)
248 {
249     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMIndexedProperty");
250     TestSpecialOperationsIdentifierRaisesExceptionV8Internal::indexedPropertySetter(index, jsValue, info);
251     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
252 }
253
254 static void indexedPropertyDeleter(uint32_t index, const v8::PropertyCallbackInfo<v8::Boolean>& info)
255 {
256     TestSpecialOperationsIdentifierRaisesException* imp = V8TestSpecialOperationsIdentifierRaisesException::toNative(info.Holder());
257     ExceptionState exceptionState(info.Holder(), info.GetIsolate());
258     DeleteResult result = imp->deleteItem(index, exceptionState);
259     if (exceptionState.throwIfNeeded())
260         return;
261     if (result != DeleteUnknownProperty)
262         return v8SetReturnValueBool(info, result == DeleteSuccess);
263 }
264
265 static void indexedPropertyDeleterCallback(uint32_t index, const v8::PropertyCallbackInfo<v8::Boolean>& info)
266 {
267     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMIndexedProperty");
268     TestSpecialOperationsIdentifierRaisesExceptionV8Internal::indexedPropertyDeleter(index, info);
269     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
270 }
271
272 static void namedPropertyGetter(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
273 {
274     if (info.Holder()->HasRealNamedProperty(name))
275         return;
276     if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(name).IsEmpty())
277         return;
278
279     TestSpecialOperationsIdentifierRaisesException* imp = V8TestSpecialOperationsIdentifierRaisesException::toNative(info.Holder());
280     AtomicString propertyName = toCoreAtomicString(name);
281     ExceptionState exceptionState(info.Holder(), info.GetIsolate());
282     RefPtr<TestInterfaceEmpty> result = imp->namedItem(propertyName, exceptionState);
283     if (exceptionState.throwIfNeeded())
284         return;
285     if (!result)
286         return;
287     v8SetReturnValueFast(info, result.release(), imp);
288 }
289
290 static void namedPropertyGetterCallback(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
291 {
292     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty");
293     TestSpecialOperationsIdentifierRaisesExceptionV8Internal::namedPropertyGetter(name, info);
294     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
295 }
296
297 static void namedPropertySetter(v8::Local<v8::String> name, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<v8::Value>& info)
298 {
299     if (info.Holder()->HasRealNamedProperty(name))
300         return;
301     if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(name).IsEmpty())
302         return;
303
304     TestSpecialOperationsIdentifierRaisesException* imp = V8TestSpecialOperationsIdentifierRaisesException::toNative(info.Holder());
305     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, propertyName, name);
306     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, propertyValue, jsValue);
307     ExceptionState exceptionState(info.Holder(), info.GetIsolate());
308     bool result = imp->setNamedItem(propertyName, propertyValue, exceptionState);
309     if (exceptionState.throwIfNeeded())
310         return;
311     if (!result)
312         return;
313     v8SetReturnValue(info, jsValue);
314 }
315
316 static void namedPropertySetterCallback(v8::Local<v8::String> name, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<v8::Value>& info)
317 {
318     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty");
319     TestSpecialOperationsIdentifierRaisesExceptionV8Internal::namedPropertySetter(name, jsValue, info);
320     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
321 }
322
323 static void namedPropertyQuery(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Integer>& info)
324 {
325     TestSpecialOperationsIdentifierRaisesException* imp = V8TestSpecialOperationsIdentifierRaisesException::toNative(info.Holder());
326     AtomicString propertyName = toCoreAtomicString(name);
327     ExceptionState exceptionState(info.Holder(), info.GetIsolate());
328     bool result = imp->namedPropertyQuery(propertyName, exceptionState);
329     if (exceptionState.throwIfNeeded())
330         return;
331     if (!result)
332         return;
333     v8SetReturnValueInt(info, v8::None);
334 }
335
336 static void namedPropertyQueryCallback(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Integer>& info)
337 {
338     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty");
339     TestSpecialOperationsIdentifierRaisesExceptionV8Internal::namedPropertyQuery(name, info);
340     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
341 }
342
343 static void namedPropertyDeleter(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Boolean>& info)
344 {
345     TestSpecialOperationsIdentifierRaisesException* imp = V8TestSpecialOperationsIdentifierRaisesException::toNative(info.Holder());
346     AtomicString propertyName = toCoreAtomicString(name);
347     ExceptionState exceptionState(info.Holder(), info.GetIsolate());
348     DeleteResult result = imp->deleteNamedItem(propertyName, exceptionState);
349     if (exceptionState.throwIfNeeded())
350         return;
351     if (result != DeleteUnknownProperty)
352         return v8SetReturnValueBool(info, result == DeleteSuccess);
353 }
354
355 static void namedPropertyDeleterCallback(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Boolean>& info)
356 {
357     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty");
358     TestSpecialOperationsIdentifierRaisesExceptionV8Internal::namedPropertyDeleter(name, info);
359     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
360 }
361
362 static void namedPropertyEnumerator(const v8::PropertyCallbackInfo<v8::Array>& info)
363 {
364     TestSpecialOperationsIdentifierRaisesException* imp = V8TestSpecialOperationsIdentifierRaisesException::toNative(info.Holder());
365     Vector<String> names;
366     ExceptionState exceptionState(info.Holder(), info.GetIsolate());
367     imp->namedPropertyEnumerator(names, exceptionState);
368     if (exceptionState.throwIfNeeded())
369         return;
370     v8::Handle<v8::Array> v8names = v8::Array::New(info.GetIsolate(), names.size());
371     for (size_t i = 0; i < names.size(); ++i)
372         v8names->Set(v8::Integer::New(info.GetIsolate(), i), v8String(info.GetIsolate(), names[i]));
373     v8SetReturnValue(info, v8names);
374 }
375
376 static void namedPropertyEnumeratorCallback(const v8::PropertyCallbackInfo<v8::Array>& info)
377 {
378     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty");
379     TestSpecialOperationsIdentifierRaisesExceptionV8Internal::namedPropertyEnumerator(info);
380     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
381 }
382
383 } // namespace TestSpecialOperationsIdentifierRaisesExceptionV8Internal
384
385 static const V8DOMConfiguration::MethodConfiguration V8TestSpecialOperationsIdentifierRaisesExceptionMethods[] = {
386     {"item", TestSpecialOperationsIdentifierRaisesExceptionV8Internal::itemMethodCallback, 0, 1},
387     {"setItem", TestSpecialOperationsIdentifierRaisesExceptionV8Internal::setItemMethodCallback, 0, 2},
388     {"deleteItem", TestSpecialOperationsIdentifierRaisesExceptionV8Internal::deleteItemMethodCallback, 0, 1},
389     {"namedItem", TestSpecialOperationsIdentifierRaisesExceptionV8Internal::namedItemMethodCallback, 0, 1},
390     {"setNamedItem", TestSpecialOperationsIdentifierRaisesExceptionV8Internal::setNamedItemMethodCallback, 0, 2},
391     {"deleteNamedItem", TestSpecialOperationsIdentifierRaisesExceptionV8Internal::deleteNamedItemMethodCallback, 0, 1},
392 };
393
394 static void configureV8TestSpecialOperationsIdentifierRaisesExceptionTemplate(v8::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate, WrapperWorldType currentWorldType)
395 {
396     functionTemplate->ReadOnlyPrototype();
397
398     v8::Local<v8::Signature> defaultSignature;
399     defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTemplate, "TestSpecialOperationsIdentifierRaisesException", v8::Local<v8::FunctionTemplate>(), V8TestSpecialOperationsIdentifierRaisesException::internalFieldCount,
400         0, 0,
401         0, 0,
402         V8TestSpecialOperationsIdentifierRaisesExceptionMethods, WTF_ARRAY_LENGTH(V8TestSpecialOperationsIdentifierRaisesExceptionMethods),
403         isolate, currentWorldType);
404     v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTemplate->InstanceTemplate();
405     v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTemplate->PrototypeTemplate();
406     functionTemplate->InstanceTemplate()->SetIndexedPropertyHandler(TestSpecialOperationsIdentifierRaisesExceptionV8Internal::indexedPropertyGetterCallback, TestSpecialOperationsIdentifierRaisesExceptionV8Internal::indexedPropertySetterCallback, 0, TestSpecialOperationsIdentifierRaisesExceptionV8Internal::indexedPropertyDeleterCallback, indexedPropertyEnumerator<TestSpecialOperationsIdentifierRaisesException>);
407     functionTemplate->InstanceTemplate()->SetNamedPropertyHandler(TestSpecialOperationsIdentifierRaisesExceptionV8Internal::namedPropertyGetterCallback, TestSpecialOperationsIdentifierRaisesExceptionV8Internal::namedPropertySetterCallback, TestSpecialOperationsIdentifierRaisesExceptionV8Internal::namedPropertyQueryCallback, TestSpecialOperationsIdentifierRaisesExceptionV8Internal::namedPropertyDeleterCallback, TestSpecialOperationsIdentifierRaisesExceptionV8Internal::namedPropertyEnumeratorCallback);
408
409     // Custom toString template
410     functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData::current()->toStringTemplate());
411 }
412
413 v8::Handle<v8::FunctionTemplate> V8TestSpecialOperationsIdentifierRaisesException::domTemplate(v8::Isolate* isolate, WrapperWorldType currentWorldType)
414 {
415     V8PerIsolateData* data = V8PerIsolateData::from(isolate);
416     V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWorldType).find(&wrapperTypeInfo);
417     if (result != data->templateMap(currentWorldType).end())
418         return result->value.newLocal(isolate);
419
420     TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate");
421     v8::EscapableHandleScope handleScope(isolate);
422     v8::Local<v8::FunctionTemplate> templ = v8::FunctionTemplate::New(isolate, V8ObjectConstructor::isValidConstructorMode);
423     configureV8TestSpecialOperationsIdentifierRaisesExceptionTemplate(templ, isolate, currentWorldType);
424     data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v8::FunctionTemplate>(isolate, templ));
425     return handleScope.Escape(templ);
426 }
427
428 bool V8TestSpecialOperationsIdentifierRaisesException::hasInstance(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate)
429 {
430     return V8PerIsolateData::from(isolate)->hasInstanceInMainWorld(&wrapperTypeInfo, jsValue)
431         || V8PerIsolateData::from(isolate)->hasInstanceInNonMainWorld(&wrapperTypeInfo, jsValue);
432 }
433
434 v8::Handle<v8::Object> V8TestSpecialOperationsIdentifierRaisesException::createWrapper(PassRefPtr<TestSpecialOperationsIdentifierRaisesException> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
435 {
436     ASSERT(impl);
437     ASSERT(!DOMDataStore::containsWrapper<V8TestSpecialOperationsIdentifierRaisesException>(impl.get(), isolate));
438     if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) {
439         const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObject(impl.get());
440         // Might be a XXXConstructor::wrapperTypeInfo instead of an XXX::wrapperTypeInfo. These will both have
441         // the same object de-ref functions, though, so use that as the basis of the check.
442         RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction == wrapperTypeInfo.derefObjectFunction);
443     }
444
445     v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext, &wrapperTypeInfo, toInternalPointer(impl.get()), isolate);
446     if (UNLIKELY(wrapper.IsEmpty()))
447         return wrapper;
448
449     installPerContextEnabledProperties(wrapper, impl.get(), isolate);
450     V8DOMWrapper::associateObjectWithWrapper<V8TestSpecialOperationsIdentifierRaisesException>(impl, &wrapperTypeInfo, wrapper, isolate, WrapperConfiguration::Independent);
451     return wrapper;
452 }
453
454 void V8TestSpecialOperationsIdentifierRaisesException::derefObject(void* object)
455 {
456     fromInternalPointer(object)->deref();
457 }
458
459 template<>
460 v8::Handle<v8::Value> toV8NoInline(TestSpecialOperationsIdentifierRaisesException* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
461 {
462     return toV8(impl, creationContext, isolate);
463 }
464
465 } // namespace WebCore