diff options
Diffstat (limited to 'Source/WebCore/bindings/scripts/test/JS')
10 files changed, 52 insertions, 32 deletions
diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestCallback.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestCallback.cpp index 1f48ee9..a5234d9 100644 --- a/Source/WebCore/bindings/scripts/test/JS/JSTestCallback.cpp +++ b/Source/WebCore/bindings/scripts/test/JS/JSTestCallback.cpp @@ -26,6 +26,7 @@ #include "JSClass1.h" #include "JSClass2.h" +#include "JSDOMStringList.h" #include "ScriptExecutionContext.h" #include <runtime/JSLock.h> #include <wtf/MainThread.h> @@ -110,6 +111,24 @@ bool JSTestCallback::callbackWithClass2Param(Class2* class2Param, const String& return !raisedException; } +bool JSTestCallback::callbackWithStringList(DOMStringList* listParam) +{ + if (!canInvokeCallback()) + return true; + + RefPtr<JSTestCallback> protect(this); + + JSLock lock(SilenceAssertionsOnly); + + ExecState* exec = m_data->globalObject()->globalExec(); + MarkedArgumentBuffer args; + args.append(toJS(exec, listParam)); + + bool raisedException = false; + m_data->invokeCallback(args, &raisedException); + return !raisedException; +} + } #endif // ENABLE(DATABASE) diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestCallback.h b/Source/WebCore/bindings/scripts/test/JS/JSTestCallback.h index ba3559c..226e874 100644 --- a/Source/WebCore/bindings/scripts/test/JS/JSTestCallback.h +++ b/Source/WebCore/bindings/scripts/test/JS/JSTestCallback.h @@ -45,6 +45,7 @@ public: virtual bool callbackWithClass2Param(Class2* class2Param, const String& strArg); COMPILE_ASSERT(false) virtual int callbackWithNonBoolReturnType(Class3* class3Param); virtual int customCallback(Class5* class5Param, Class6* class6Param); + virtual bool callbackWithStringList(DOMStringList* listParam); private: JSTestCallback(JSC::JSObject* callback, JSDOMGlobalObject*); diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp index 8d519f5..ce0fef6 100644 --- a/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp +++ b/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp @@ -69,9 +69,9 @@ public: virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); static const JSC::ClassInfo s_info; - static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype) + static PassRefPtr<JSC::Structure> createStructure(JSC::JSGlobalData& globalData, JSC::JSValue prototype) { - return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount, &s_info); + return JSC::Structure::create(globalData, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount, &s_info); } protected: static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags; @@ -82,7 +82,7 @@ protected: const ClassInfo JSTestInterfaceConstructor::s_info = { "TestInterfaceConstructor", &DOMConstructorObject::s_info, &JSTestInterfaceConstructorTable, 0 }; JSTestInterfaceConstructor::JSTestInterfaceConstructor(ExecState* exec, JSDOMGlobalObject* globalObject) - : DOMConstructorObject(JSTestInterfaceConstructor::createStructure(globalObject->objectPrototype()), globalObject) + : DOMConstructorObject(JSTestInterfaceConstructor::createStructure(globalObject->globalData(), globalObject->objectPrototype()), globalObject) { ASSERT(inherits(&s_info)); putDirect(exec->globalData(), exec->propertyNames().prototype, JSTestInterfacePrototype::self(exec, globalObject), DontDelete | ReadOnly); @@ -144,7 +144,7 @@ JSTestInterface::JSTestInterface(NonNullPassRefPtr<Structure> structure, JSDOMGl JSObject* JSTestInterface::createPrototype(ExecState* exec, JSGlobalObject* globalObject) { - return new (exec) JSTestInterfacePrototype(globalObject, JSTestInterfacePrototype::createStructure(globalObject->objectPrototype())); + return new (exec) JSTestInterfacePrototype(globalObject, JSTestInterfacePrototype::createStructure(globalObject->globalData(), globalObject->objectPrototype())); } bool JSTestInterface::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.h b/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.h index 2cabc23..5ee33a0 100644 --- a/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.h +++ b/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.h @@ -41,9 +41,9 @@ public: virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor&); static const JSC::ClassInfo s_info; - static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype) + static PassRefPtr<JSC::Structure> createStructure(JSC::JSGlobalData& globalData, JSC::JSValue prototype) { - return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount, &s_info); + return JSC::Structure::create(globalData, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount, &s_info); } static JSC::JSValue getConstructor(JSC::ExecState*, JSC::JSGlobalObject*); @@ -63,9 +63,9 @@ class JSTestInterfacePrototype : public JSC::JSObjectWithGlobalObject { public: static JSC::JSObject* self(JSC::ExecState*, JSC::JSGlobalObject*); static const JSC::ClassInfo s_info; - static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype) + static PassRefPtr<JSC::Structure> createStructure(JSC::JSGlobalData& globalData, JSC::JSValue prototype) { - return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount, &s_info); + return JSC::Structure::create(globalData, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount, &s_info); } JSTestInterfacePrototype(JSC::JSGlobalObject* globalObject, NonNullPassRefPtr<JSC::Structure> structure) : JSC::JSObjectWithGlobalObject(globalObject, structure) { } protected: diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp index 0e5edeb..efaee3b 100644 --- a/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp +++ b/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp @@ -70,9 +70,9 @@ public: virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); static const JSC::ClassInfo s_info; - static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype) + static PassRefPtr<JSC::Structure> createStructure(JSC::JSGlobalData& globalData, JSC::JSValue prototype) { - return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount, &s_info); + return JSC::Structure::create(globalData, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount, &s_info); } protected: static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags; @@ -81,7 +81,7 @@ protected: const ClassInfo JSTestMediaQueryListListenerConstructor::s_info = { "TestMediaQueryListListenerConstructor", &DOMConstructorObject::s_info, &JSTestMediaQueryListListenerConstructorTable, 0 }; JSTestMediaQueryListListenerConstructor::JSTestMediaQueryListListenerConstructor(ExecState* exec, JSDOMGlobalObject* globalObject) - : DOMConstructorObject(JSTestMediaQueryListListenerConstructor::createStructure(globalObject->objectPrototype()), globalObject) + : DOMConstructorObject(JSTestMediaQueryListListenerConstructor::createStructure(globalObject->globalData(), globalObject->objectPrototype()), globalObject) { ASSERT(inherits(&s_info)); putDirect(exec->globalData(), exec->propertyNames().prototype, JSTestMediaQueryListListenerPrototype::self(exec, globalObject), DontDelete | ReadOnly); @@ -140,7 +140,7 @@ JSTestMediaQueryListListener::JSTestMediaQueryListListener(NonNullPassRefPtr<Str JSObject* JSTestMediaQueryListListener::createPrototype(ExecState* exec, JSGlobalObject* globalObject) { - return new (exec) JSTestMediaQueryListListenerPrototype(globalObject, JSTestMediaQueryListListenerPrototype::createStructure(globalObject->objectPrototype())); + return new (exec) JSTestMediaQueryListListenerPrototype(globalObject, JSTestMediaQueryListListenerPrototype::createStructure(globalObject->globalData(), globalObject->objectPrototype())); } bool JSTestMediaQueryListListener::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.h b/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.h index a9f8606..fdb8a02 100644 --- a/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.h +++ b/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.h @@ -39,9 +39,9 @@ public: virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor&); static const JSC::ClassInfo s_info; - static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype) + static PassRefPtr<JSC::Structure> createStructure(JSC::JSGlobalData& globalData, JSC::JSValue prototype) { - return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount, &s_info); + return JSC::Structure::create(globalData, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount, &s_info); } static JSC::JSValue getConstructor(JSC::ExecState*, JSC::JSGlobalObject*); @@ -63,9 +63,9 @@ public: static const JSC::ClassInfo s_info; virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); - static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype) + static PassRefPtr<JSC::Structure> createStructure(JSC::JSGlobalData& globalData, JSC::JSValue prototype) { - return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount, &s_info); + return JSC::Structure::create(globalData, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount, &s_info); } JSTestMediaQueryListListenerPrototype(JSC::JSGlobalObject* globalObject, NonNullPassRefPtr<JSC::Structure> structure) : JSC::JSObjectWithGlobalObject(globalObject, structure) { } protected: diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp index fd2f4d9..a98cafa 100644 --- a/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp +++ b/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp @@ -149,9 +149,9 @@ public: virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); static const JSC::ClassInfo s_info; - static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype) + static PassRefPtr<JSC::Structure> createStructure(JSC::JSGlobalData& globalData, JSC::JSValue prototype) { - return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount, &s_info); + return JSC::Structure::create(globalData, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount, &s_info); } protected: static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags; @@ -160,7 +160,7 @@ protected: const ClassInfo JSTestObjConstructor::s_info = { "TestObjConstructor", &DOMConstructorObject::s_info, &JSTestObjConstructorTable, 0 }; JSTestObjConstructor::JSTestObjConstructor(ExecState* exec, JSDOMGlobalObject* globalObject) - : DOMConstructorObject(JSTestObjConstructor::createStructure(globalObject->objectPrototype()), globalObject) + : DOMConstructorObject(JSTestObjConstructor::createStructure(globalObject->globalData(), globalObject->objectPrototype()), globalObject) { ASSERT(inherits(&s_info)); putDirect(exec->globalData(), exec->propertyNames().prototype, JSTestObjPrototype::self(exec, globalObject), DontDelete | ReadOnly); @@ -265,7 +265,7 @@ JSTestObj::JSTestObj(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* JSObject* JSTestObj::createPrototype(ExecState* exec, JSGlobalObject* globalObject) { - return new (exec) JSTestObjPrototype(globalObject, JSTestObjPrototype::createStructure(globalObject->objectPrototype())); + return new (exec) JSTestObjPrototype(globalObject, JSTestObjPrototype::createStructure(globalObject->globalData(), globalObject->objectPrototype())); } bool JSTestObj::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h b/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h index 7e21168..751239b 100644 --- a/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h +++ b/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h @@ -40,9 +40,9 @@ public: virtual void put(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::JSValue, JSC::PutPropertySlot&); static const JSC::ClassInfo s_info; - static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype) + static PassRefPtr<JSC::Structure> createStructure(JSC::JSGlobalData& globalData, JSC::JSValue prototype) { - return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount, &s_info); + return JSC::Structure::create(globalData, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount, &s_info); } static JSC::JSValue getConstructor(JSC::ExecState*, JSC::JSGlobalObject*); @@ -72,9 +72,9 @@ public: static const JSC::ClassInfo s_info; virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); - static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype) + static PassRefPtr<JSC::Structure> createStructure(JSC::JSGlobalData& globalData, JSC::JSValue prototype) { - return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount, &s_info); + return JSC::Structure::create(globalData, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount, &s_info); } JSTestObjPrototype(JSC::JSGlobalObject* globalObject, NonNullPassRefPtr<JSC::Structure> structure) : JSC::JSObjectWithGlobalObject(globalObject, structure) { } protected: diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp index 5dd6c44..535f99b 100644 --- a/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp +++ b/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp @@ -71,9 +71,9 @@ public: virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); static const JSC::ClassInfo s_info; - static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype) + static PassRefPtr<JSC::Structure> createStructure(JSC::JSGlobalData& globalData, JSC::JSValue prototype) { - return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount, &s_info); + return JSC::Structure::create(globalData, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount, &s_info); } protected: static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags; @@ -82,7 +82,7 @@ protected: const ClassInfo JSTestSerializedScriptValueInterfaceConstructor::s_info = { "TestSerializedScriptValueInterfaceConstructor", &DOMConstructorObject::s_info, &JSTestSerializedScriptValueInterfaceConstructorTable, 0 }; JSTestSerializedScriptValueInterfaceConstructor::JSTestSerializedScriptValueInterfaceConstructor(ExecState* exec, JSDOMGlobalObject* globalObject) - : DOMConstructorObject(JSTestSerializedScriptValueInterfaceConstructor::createStructure(globalObject->objectPrototype()), globalObject) + : DOMConstructorObject(JSTestSerializedScriptValueInterfaceConstructor::createStructure(globalObject->globalData(), globalObject->objectPrototype()), globalObject) { ASSERT(inherits(&s_info)); putDirect(exec->globalData(), exec->propertyNames().prototype, JSTestSerializedScriptValueInterfacePrototype::self(exec, globalObject), DontDelete | ReadOnly); @@ -130,7 +130,7 @@ JSTestSerializedScriptValueInterface::JSTestSerializedScriptValueInterface(NonNu JSObject* JSTestSerializedScriptValueInterface::createPrototype(ExecState* exec, JSGlobalObject* globalObject) { - return new (exec) JSTestSerializedScriptValueInterfacePrototype(globalObject, JSTestSerializedScriptValueInterfacePrototype::createStructure(globalObject->objectPrototype())); + return new (exec) JSTestSerializedScriptValueInterfacePrototype(globalObject, JSTestSerializedScriptValueInterfacePrototype::createStructure(globalObject->globalData(), globalObject->objectPrototype())); } bool JSTestSerializedScriptValueInterface::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h b/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h index 175fb12..d5f8879 100644 --- a/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h +++ b/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h @@ -41,9 +41,9 @@ public: virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor&); static const JSC::ClassInfo s_info; - static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype) + static PassRefPtr<JSC::Structure> createStructure(JSC::JSGlobalData& globalData, JSC::JSValue prototype) { - return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount, &s_info); + return JSC::Structure::create(globalData, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount, &s_info); } static JSC::JSValue getConstructor(JSC::ExecState*, JSC::JSGlobalObject*); @@ -63,9 +63,9 @@ class JSTestSerializedScriptValueInterfacePrototype : public JSC::JSObjectWithGl public: static JSC::JSObject* self(JSC::ExecState*, JSC::JSGlobalObject*); static const JSC::ClassInfo s_info; - static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype) + static PassRefPtr<JSC::Structure> createStructure(JSC::JSGlobalData& globalData, JSC::JSValue prototype) { - return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount, &s_info); + return JSC::Structure::create(globalData, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount, &s_info); } JSTestSerializedScriptValueInterfacePrototype(JSC::JSGlobalObject* globalObject, NonNullPassRefPtr<JSC::Structure> structure) : JSC::JSObjectWithGlobalObject(globalObject, structure) { } protected: |