Update binding test expectation for http://trac.webkit.org/changeset/128400
[WebKit.git] / Source / WebCore / bindings / scripts / test / JS / JSTestSerializedScriptValueInterface.cpp
1 /*
2     This file is part of the WebKit open source project.
3     This file has been generated by generate-bindings.pl. DO NOT MODIFY!
4
5     This library is free software; you can redistribute it and/or
6     modify it under the terms of the GNU Library General Public
7     License as published by the Free Software Foundation; either
8     version 2 of the License, or (at your option) any later version.
9
10     This library is distributed in the hope that it will be useful,
11     but WITHOUT ANY WARRANTY; without even the implied warranty of
12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13     Library General Public License for more details.
14
15     You should have received a copy of the GNU Library General Public License
16     along with this library; see the file COPYING.LIB.  If not, write to
17     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18     Boston, MA 02110-1301, USA.
19 */
20
21 #include "config.h"
22
23 #if ENABLE(Condition1) || ENABLE(Condition2)
24
25 #include "JSTestSerializedScriptValueInterface.h"
26
27 #include "ExceptionCode.h"
28 #include "JSArray.h"
29 #include "JSDOMBinding.h"
30 #include "JSMessagePort.h"
31 #include "MessagePort.h"
32 #include "SerializedScriptValue.h"
33 #include "TestSerializedScriptValueInterface.h"
34 #include <runtime/Error.h>
35 #include <runtime/JSArray.h>
36 #include <wtf/GetPtr.h>
37
38 using namespace JSC;
39
40 namespace WebCore {
41
42 ASSERT_CLASS_FITS_IN_CELL(JSTestSerializedScriptValueInterface);
43 /* Hash table */
44
45 static const HashTableValue JSTestSerializedScriptValueInterfaceTableValues[] =
46 {
47     { "value", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestSerializedScriptValueInterfaceValue), (intptr_t)setJSTestSerializedScriptValueInterfaceValue, NoIntrinsic },
48     { "readonlyValue", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestSerializedScriptValueInterfaceReadonlyValue), (intptr_t)0, NoIntrinsic },
49     { "cachedValue", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestSerializedScriptValueInterfaceCachedValue), (intptr_t)setJSTestSerializedScriptValueInterfaceCachedValue, NoIntrinsic },
50     { "ports", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestSerializedScriptValueInterfacePorts), (intptr_t)0, NoIntrinsic },
51     { "cachedReadonlyValue", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestSerializedScriptValueInterfaceCachedReadonlyValue), (intptr_t)0, NoIntrinsic },
52     { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestSerializedScriptValueInterfaceConstructor), (intptr_t)0, NoIntrinsic },
53     { 0, 0, 0, 0, NoIntrinsic }
54 };
55
56 static const HashTable JSTestSerializedScriptValueInterfaceTable = { 17, 15, JSTestSerializedScriptValueInterfaceTableValues, 0 };
57 /* Hash table for constructor */
58
59 static const HashTableValue JSTestSerializedScriptValueInterfaceConstructorTableValues[] =
60 {
61     { 0, 0, 0, 0, NoIntrinsic }
62 };
63
64 static const HashTable JSTestSerializedScriptValueInterfaceConstructorTable = { 1, 0, JSTestSerializedScriptValueInterfaceConstructorTableValues, 0 };
65 const ClassInfo JSTestSerializedScriptValueInterfaceConstructor::s_info = { "TestSerializedScriptValueInterfaceConstructor", &Base::s_info, &JSTestSerializedScriptValueInterfaceConstructorTable, 0, CREATE_METHOD_TABLE(JSTestSerializedScriptValueInterfaceConstructor) };
66
67 JSTestSerializedScriptValueInterfaceConstructor::JSTestSerializedScriptValueInterfaceConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
68     : DOMConstructorObject(structure, globalObject)
69 {
70 }
71
72 void JSTestSerializedScriptValueInterfaceConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
73 {
74     Base::finishCreation(exec->globalData());
75     ASSERT(inherits(&s_info));
76     putDirect(exec->globalData(), exec->propertyNames().prototype, JSTestSerializedScriptValueInterfacePrototype::self(exec, globalObject), DontDelete | ReadOnly);
77     putDirect(exec->globalData(), exec->propertyNames().length, jsNumber(3), ReadOnly | DontDelete | DontEnum);
78 }
79
80 bool JSTestSerializedScriptValueInterfaceConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
81 {
82     return getStaticValueSlot<JSTestSerializedScriptValueInterfaceConstructor, JSDOMWrapper>(exec, &JSTestSerializedScriptValueInterfaceConstructorTable, jsCast<JSTestSerializedScriptValueInterfaceConstructor*>(cell), propertyName, slot);
83 }
84
85 bool JSTestSerializedScriptValueInterfaceConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, PropertyName propertyName, PropertyDescriptor& descriptor)
86 {
87     return getStaticValueDescriptor<JSTestSerializedScriptValueInterfaceConstructor, JSDOMWrapper>(exec, &JSTestSerializedScriptValueInterfaceConstructorTable, jsCast<JSTestSerializedScriptValueInterfaceConstructor*>(object), propertyName, descriptor);
88 }
89
90 EncodedJSValue JSC_HOST_CALL JSTestSerializedScriptValueInterfaceConstructor::constructJSTestSerializedScriptValueInterface(ExecState* exec)
91 {
92     JSTestSerializedScriptValueInterfaceConstructor* castedThis = jsCast<JSTestSerializedScriptValueInterfaceConstructor*>(exec->callee());
93     if (exec->argumentCount() < 2)
94         return throwVMError(exec, createNotEnoughArgumentsError(exec));
95     const String& hello(MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).isEmpty() ? String() : MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).toString(exec)->value(exec));
96     if (exec->hadException())
97         return JSValue::encode(jsUndefined());
98     RefPtr<SerializedScriptValue> data(SerializedScriptValue::create(exec, MAYBE_MISSING_PARAMETER(exec, 1, DefaultIsUndefined), 0, 0));
99     if (exec->hadException())
100         return JSValue::encode(jsUndefined());
101     Array* transferList(toArray(MAYBE_MISSING_PARAMETER(exec, 2, DefaultIsUndefined)));
102     if (exec->hadException())
103         return JSValue::encode(jsUndefined());
104     RefPtr<TestSerializedScriptValueInterface> object = TestSerializedScriptValueInterface::create(hello, data, transferList);
105     return JSValue::encode(asObject(toJS(exec, castedThis->globalObject(), object.get())));
106 }
107
108 ConstructType JSTestSerializedScriptValueInterfaceConstructor::getConstructData(JSCell*, ConstructData& constructData)
109 {
110     constructData.native.function = constructJSTestSerializedScriptValueInterface;
111     return ConstructTypeHost;
112 }
113
114 /* Hash table for prototype */
115
116 static const HashTableValue JSTestSerializedScriptValueInterfacePrototypeTableValues[] =
117 {
118     { "acceptTransferList", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestSerializedScriptValueInterfacePrototypeFunctionAcceptTransferList), (intptr_t)2, NoIntrinsic },
119     { "multiTransferList", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestSerializedScriptValueInterfacePrototypeFunctionMultiTransferList), (intptr_t)4, NoIntrinsic },
120     { 0, 0, 0, 0, NoIntrinsic }
121 };
122
123 static const HashTable JSTestSerializedScriptValueInterfacePrototypeTable = { 5, 3, JSTestSerializedScriptValueInterfacePrototypeTableValues, 0 };
124 const ClassInfo JSTestSerializedScriptValueInterfacePrototype::s_info = { "TestSerializedScriptValueInterfacePrototype", &Base::s_info, &JSTestSerializedScriptValueInterfacePrototypeTable, 0, CREATE_METHOD_TABLE(JSTestSerializedScriptValueInterfacePrototype) };
125
126 JSObject* JSTestSerializedScriptValueInterfacePrototype::self(ExecState* exec, JSGlobalObject* globalObject)
127 {
128     return getDOMPrototype<JSTestSerializedScriptValueInterface>(exec, globalObject);
129 }
130
131 bool JSTestSerializedScriptValueInterfacePrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
132 {
133     JSTestSerializedScriptValueInterfacePrototype* thisObject = jsCast<JSTestSerializedScriptValueInterfacePrototype*>(cell);
134     return getStaticFunctionSlot<JSObject>(exec, &JSTestSerializedScriptValueInterfacePrototypeTable, thisObject, propertyName, slot);
135 }
136
137 bool JSTestSerializedScriptValueInterfacePrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, PropertyName propertyName, PropertyDescriptor& descriptor)
138 {
139     JSTestSerializedScriptValueInterfacePrototype* thisObject = jsCast<JSTestSerializedScriptValueInterfacePrototype*>(object);
140     return getStaticFunctionDescriptor<JSObject>(exec, &JSTestSerializedScriptValueInterfacePrototypeTable, thisObject, propertyName, descriptor);
141 }
142
143 const ClassInfo JSTestSerializedScriptValueInterface::s_info = { "TestSerializedScriptValueInterface", &Base::s_info, &JSTestSerializedScriptValueInterfaceTable, 0 , CREATE_METHOD_TABLE(JSTestSerializedScriptValueInterface) };
144
145 JSTestSerializedScriptValueInterface::JSTestSerializedScriptValueInterface(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<TestSerializedScriptValueInterface> impl)
146     : JSDOMWrapper(structure, globalObject)
147     , m_impl(impl.leakRef())
148 {
149 }
150
151 void JSTestSerializedScriptValueInterface::finishCreation(JSGlobalData& globalData)
152 {
153     Base::finishCreation(globalData);
154     ASSERT(inherits(&s_info));
155 }
156
157 JSObject* JSTestSerializedScriptValueInterface::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
158 {
159     return JSTestSerializedScriptValueInterfacePrototype::create(exec->globalData(), globalObject, JSTestSerializedScriptValueInterfacePrototype::createStructure(globalObject->globalData(), globalObject, globalObject->objectPrototype()));
160 }
161
162 void JSTestSerializedScriptValueInterface::destroy(JSC::JSCell* cell)
163 {
164     JSTestSerializedScriptValueInterface* thisObject = static_cast<JSTestSerializedScriptValueInterface*>(cell);
165     thisObject->JSTestSerializedScriptValueInterface::~JSTestSerializedScriptValueInterface();
166 }
167
168 JSTestSerializedScriptValueInterface::~JSTestSerializedScriptValueInterface()
169 {
170     releaseImplIfNotNull();
171 }
172
173 bool JSTestSerializedScriptValueInterface::getOwnPropertySlot(JSCell* cell, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
174 {
175     JSTestSerializedScriptValueInterface* thisObject = jsCast<JSTestSerializedScriptValueInterface*>(cell);
176     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
177     return getStaticValueSlot<JSTestSerializedScriptValueInterface, Base>(exec, &JSTestSerializedScriptValueInterfaceTable, thisObject, propertyName, slot);
178 }
179
180 bool JSTestSerializedScriptValueInterface::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, PropertyName propertyName, PropertyDescriptor& descriptor)
181 {
182     JSTestSerializedScriptValueInterface* thisObject = jsCast<JSTestSerializedScriptValueInterface*>(object);
183     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
184     return getStaticValueDescriptor<JSTestSerializedScriptValueInterface, Base>(exec, &JSTestSerializedScriptValueInterfaceTable, thisObject, propertyName, descriptor);
185 }
186
187 JSValue jsTestSerializedScriptValueInterfaceValue(ExecState* exec, JSValue slotBase, PropertyName)
188 {
189     JSTestSerializedScriptValueInterface* castedThis = jsCast<JSTestSerializedScriptValueInterface*>(asObject(slotBase));
190     UNUSED_PARAM(exec);
191     TestSerializedScriptValueInterface* impl = static_cast<TestSerializedScriptValueInterface*>(castedThis->impl());
192     JSValue result = impl->value() ? impl->value()->deserialize(exec, castedThis->globalObject(), 0) : jsNull();
193     return result;
194 }
195
196
197 JSValue jsTestSerializedScriptValueInterfaceReadonlyValue(ExecState* exec, JSValue slotBase, PropertyName)
198 {
199     JSTestSerializedScriptValueInterface* castedThis = jsCast<JSTestSerializedScriptValueInterface*>(asObject(slotBase));
200     UNUSED_PARAM(exec);
201     TestSerializedScriptValueInterface* impl = static_cast<TestSerializedScriptValueInterface*>(castedThis->impl());
202     JSValue result = impl->readonlyValue() ? impl->readonlyValue()->deserialize(exec, castedThis->globalObject(), 0) : jsNull();
203     return result;
204 }
205
206
207 JSValue jsTestSerializedScriptValueInterfaceCachedValue(ExecState* exec, JSValue slotBase, PropertyName)
208 {
209     JSTestSerializedScriptValueInterface* castedThis = jsCast<JSTestSerializedScriptValueInterface*>(asObject(slotBase));
210     UNUSED_PARAM(exec);
211     if (JSValue cachedValue = castedThis->m_cachedValue.get())
212         return cachedValue;
213     TestSerializedScriptValueInterface* impl = static_cast<TestSerializedScriptValueInterface*>(castedThis->impl());
214     JSValue result = impl->cachedValue() ? impl->cachedValue()->deserialize(exec, castedThis->globalObject(), 0) : jsNull();
215     castedThis->m_cachedValue.set(exec->globalData(), castedThis, result);
216     return result;
217 }
218
219
220 JSValue jsTestSerializedScriptValueInterfacePorts(ExecState* exec, JSValue slotBase, PropertyName)
221 {
222     JSTestSerializedScriptValueInterface* castedThis = jsCast<JSTestSerializedScriptValueInterface*>(asObject(slotBase));
223     UNUSED_PARAM(exec);
224     TestSerializedScriptValueInterface* impl = static_cast<TestSerializedScriptValueInterface*>(castedThis->impl());
225     JSValue result = jsArray(exec, castedThis->globalObject(), *impl->ports());
226     return result;
227 }
228
229
230 JSValue jsTestSerializedScriptValueInterfaceCachedReadonlyValue(ExecState* exec, JSValue slotBase, PropertyName)
231 {
232     JSTestSerializedScriptValueInterface* castedThis = jsCast<JSTestSerializedScriptValueInterface*>(asObject(slotBase));
233     UNUSED_PARAM(exec);
234     if (JSValue cachedValue = castedThis->m_cachedReadonlyValue.get())
235         return cachedValue;
236     TestSerializedScriptValueInterface* impl = static_cast<TestSerializedScriptValueInterface*>(castedThis->impl());
237     JSValue result = impl->cachedReadonlyValue() ? impl->cachedReadonlyValue()->deserialize(exec, castedThis->globalObject(), 0) : jsNull();
238     castedThis->m_cachedReadonlyValue.set(exec->globalData(), castedThis, result);
239     return result;
240 }
241
242
243 JSValue jsTestSerializedScriptValueInterfaceConstructor(ExecState* exec, JSValue slotBase, PropertyName)
244 {
245     JSTestSerializedScriptValueInterface* domObject = jsCast<JSTestSerializedScriptValueInterface*>(asObject(slotBase));
246     return JSTestSerializedScriptValueInterface::getConstructor(exec, domObject->globalObject());
247 }
248
249 void JSTestSerializedScriptValueInterface::put(JSCell* cell, ExecState* exec, PropertyName propertyName, JSValue value, PutPropertySlot& slot)
250 {
251     JSTestSerializedScriptValueInterface* thisObject = jsCast<JSTestSerializedScriptValueInterface*>(cell);
252     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
253     lookupPut<JSTestSerializedScriptValueInterface, Base>(exec, propertyName, value, &JSTestSerializedScriptValueInterfaceTable, thisObject, slot);
254 }
255
256 void setJSTestSerializedScriptValueInterfaceValue(ExecState* exec, JSObject* thisObject, JSValue value)
257 {
258     UNUSED_PARAM(exec);
259     JSTestSerializedScriptValueInterface* castedThis = jsCast<JSTestSerializedScriptValueInterface*>(thisObject);
260     TestSerializedScriptValueInterface* impl = static_cast<TestSerializedScriptValueInterface*>(castedThis->impl());
261     impl->setValue(SerializedScriptValue::create(exec, value, 0, 0));
262 }
263
264
265 void setJSTestSerializedScriptValueInterfaceCachedValue(ExecState* exec, JSObject* thisObject, JSValue value)
266 {
267     UNUSED_PARAM(exec);
268     JSTestSerializedScriptValueInterface* castedThis = jsCast<JSTestSerializedScriptValueInterface*>(thisObject);
269     TestSerializedScriptValueInterface* impl = static_cast<TestSerializedScriptValueInterface*>(castedThis->impl());
270     impl->setCachedValue(SerializedScriptValue::create(exec, value, 0, 0));
271 }
272
273
274 JSValue JSTestSerializedScriptValueInterface::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
275 {
276     return getDOMConstructor<JSTestSerializedScriptValueInterfaceConstructor>(exec, jsCast<JSDOMGlobalObject*>(globalObject));
277 }
278
279 EncodedJSValue JSC_HOST_CALL jsTestSerializedScriptValueInterfacePrototypeFunctionAcceptTransferList(ExecState* exec)
280 {
281     JSValue thisValue = exec->hostThisValue();
282     if (!thisValue.inherits(&JSTestSerializedScriptValueInterface::s_info))
283         return throwVMTypeError(exec);
284     JSTestSerializedScriptValueInterface* castedThis = jsCast<JSTestSerializedScriptValueInterface*>(asObject(thisValue));
285     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestSerializedScriptValueInterface::s_info);
286     TestSerializedScriptValueInterface* impl = static_cast<TestSerializedScriptValueInterface*>(castedThis->impl());
287     if (exec->argumentCount() < 1)
288         return throwVMError(exec, createNotEnoughArgumentsError(exec));
289     RefPtr<SerializedScriptValue> data(SerializedScriptValue::create(exec, MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined), 0, 0));
290     if (exec->hadException())
291         return JSValue::encode(jsUndefined());
292
293     size_t argsCount = exec->argumentCount();
294     if (argsCount <= 1) {
295         impl->acceptTransferList(data);
296         return JSValue::encode(jsUndefined());
297     }
298
299     Array* transferList(toArray(MAYBE_MISSING_PARAMETER(exec, 1, DefaultIsUndefined)));
300     if (exec->hadException())
301         return JSValue::encode(jsUndefined());
302     impl->acceptTransferList(data, transferList);
303     return JSValue::encode(jsUndefined());
304 }
305
306 EncodedJSValue JSC_HOST_CALL jsTestSerializedScriptValueInterfacePrototypeFunctionMultiTransferList(ExecState* exec)
307 {
308     JSValue thisValue = exec->hostThisValue();
309     if (!thisValue.inherits(&JSTestSerializedScriptValueInterface::s_info))
310         return throwVMTypeError(exec);
311     JSTestSerializedScriptValueInterface* castedThis = jsCast<JSTestSerializedScriptValueInterface*>(asObject(thisValue));
312     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestSerializedScriptValueInterface::s_info);
313     TestSerializedScriptValueInterface* impl = static_cast<TestSerializedScriptValueInterface*>(castedThis->impl());
314
315     size_t argsCount = exec->argumentCount();
316     if (argsCount <= 0) {
317         impl->multiTransferList();
318         return JSValue::encode(jsUndefined());
319     }
320
321     RefPtr<SerializedScriptValue> first(SerializedScriptValue::create(exec, MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined), 0, 0));
322     if (exec->hadException())
323         return JSValue::encode(jsUndefined());
324     if (argsCount <= 1) {
325         impl->multiTransferList(first);
326         return JSValue::encode(jsUndefined());
327     }
328
329     Array* tx(toArray(MAYBE_MISSING_PARAMETER(exec, 1, DefaultIsUndefined)));
330     if (exec->hadException())
331         return JSValue::encode(jsUndefined());
332     if (argsCount <= 2) {
333         impl->multiTransferList(first, tx);
334         return JSValue::encode(jsUndefined());
335     }
336
337     RefPtr<SerializedScriptValue> second(SerializedScriptValue::create(exec, MAYBE_MISSING_PARAMETER(exec, 2, DefaultIsUndefined), 0, 0));
338     if (exec->hadException())
339         return JSValue::encode(jsUndefined());
340     if (argsCount <= 3) {
341         impl->multiTransferList(first, tx, second);
342         return JSValue::encode(jsUndefined());
343     }
344
345     Array* txx(toArray(MAYBE_MISSING_PARAMETER(exec, 3, DefaultIsUndefined)));
346     if (exec->hadException())
347         return JSValue::encode(jsUndefined());
348     impl->multiTransferList(first, tx, second, txx);
349     return JSValue::encode(jsUndefined());
350 }
351
352 void JSTestSerializedScriptValueInterface::visitChildren(JSCell* cell, SlotVisitor& visitor)
353 {
354     JSTestSerializedScriptValueInterface* thisObject = jsCast<JSTestSerializedScriptValueInterface*>(cell);
355     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
356     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
357     ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
358     Base::visitChildren(thisObject, visitor);
359     visitor.append(&thisObject->m_cachedValue);
360     visitor.append(&thisObject->m_cachedReadonlyValue);
361 }
362
363 static inline bool isObservable(JSTestSerializedScriptValueInterface* jsTestSerializedScriptValueInterface)
364 {
365     if (jsTestSerializedScriptValueInterface->hasCustomProperties())
366         return true;
367     return false;
368 }
369
370 bool JSTestSerializedScriptValueInterfaceOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
371 {
372     JSTestSerializedScriptValueInterface* jsTestSerializedScriptValueInterface = jsCast<JSTestSerializedScriptValueInterface*>(handle.get().asCell());
373     if (!isObservable(jsTestSerializedScriptValueInterface))
374         return false;
375     UNUSED_PARAM(visitor);
376     return false;
377 }
378
379 void JSTestSerializedScriptValueInterfaceOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
380 {
381     JSTestSerializedScriptValueInterface* jsTestSerializedScriptValueInterface = jsCast<JSTestSerializedScriptValueInterface*>(handle.get().asCell());
382     DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context);
383     uncacheWrapper(world, jsTestSerializedScriptValueInterface->impl(), jsTestSerializedScriptValueInterface);
384     jsTestSerializedScriptValueInterface->releaseImpl();
385 }
386
387 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, TestSerializedScriptValueInterface* impl)
388 {
389     return wrap<JSTestSerializedScriptValueInterface>(exec, globalObject, impl);
390 }
391
392 TestSerializedScriptValueInterface* toTestSerializedScriptValueInterface(JSC::JSValue value)
393 {
394     return value.inherits(&JSTestSerializedScriptValueInterface::s_info) ? jsCast<JSTestSerializedScriptValueInterface*>(asObject(value))->impl() : 0;
395 }
396
397 }
398
399 #endif // ENABLE(Condition1) || ENABLE(Condition2)