summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/webkit/JavaScriptCore/runtime
diff options
context:
space:
mode:
authorKent Hansen <khansen@trolltech.com>2009-07-13 09:19:48 (GMT)
committerKent Hansen <khansen@trolltech.com>2009-07-13 09:25:57 (GMT)
commit25e76959da84fe4c40f98cf32b7b8c69e5087681 (patch)
tree32093b3c9357c09e1a8efe49eb99bd388a602c26 /src/3rdparty/webkit/JavaScriptCore/runtime
parenta267b590d17d1e7088acf44a8ba7e307f898ccb1 (diff)
downloadQt-25e76959da84fe4c40f98cf32b7b8c69e5087681.zip
Qt-25e76959da84fe4c40f98cf32b7b8c69e5087681.tar.gz
Qt-25e76959da84fe4c40f98cf32b7b8c69e5087681.tar.bz2
add some world-class hacks to JSC to make QtScript work
QtScript needs the VM to create script objects of type QScriptObject, not JSC::Object. This is so that the class of the object can be changed dynamically using e.g. QScriptValue::setScriptClass(), or the overload of QScriptEngine::newQObject() that takes an existing object as first argument (it "promotes" the plain script object to a QObject wrapper). This makes the bindings produced by the bindings generator work. When JSC becomes a shared library, we need another solution.
Diffstat (limited to 'src/3rdparty/webkit/JavaScriptCore/runtime')
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/runtime/JSObject.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/JSObject.cpp b/src/3rdparty/webkit/JavaScriptCore/runtime/JSObject.cpp
index 415c25d..a54c322 100644
--- a/src/3rdparty/webkit/JavaScriptCore/runtime/JSObject.cpp
+++ b/src/3rdparty/webkit/JavaScriptCore/runtime/JSObject.cpp
@@ -524,7 +524,12 @@ NEVER_INLINE void JSObject::fillGetterPropertySlot(PropertySlot& slot, JSValue*
Structure* JSObject::createInheritorID()
{
+#ifdef QT_BUILD_SCRIPT_LIB
+ // ### QtScript needs the hasOwnProperty() calls etc. for QScriptObject
+ m_inheritorID = Structure::create(this, TypeInfo(ObjectType, ImplementsHasInstance));
+#else
m_inheritorID = JSObject::createStructure(this);
+#endif
return m_inheritorID.get();
}