diff options
author | Olivier Goffart <ogoffart@trolltech.com> | 2009-09-21 10:56:11 (GMT) |
---|---|---|
committer | Olivier Goffart <ogoffart@trolltech.com> | 2009-09-21 14:29:16 (GMT) |
commit | 65b4ce3c51283adb76dcb73cc654b06359b1ae00 (patch) | |
tree | c71e10c6da5f986cc83ab520efce3a5952114efe /src/3rdparty | |
parent | 1b34feacef7a2d3ac005449a7cfbcb08a6bbf947 (diff) | |
download | Qt-65b4ce3c51283adb76dcb73cc654b06359b1ae00.zip Qt-65b4ce3c51283adb76dcb73cc654b06359b1ae00.tar.gz Qt-65b4ce3c51283adb76dcb73cc654b06359b1ae00.tar.bz2 |
QtScript: Fix comparing QVariant and QObject.
This add a hook inside JSC to be able to implement our own comparison function
when comparing objects.
Reviewed-by: Kent Hansen
Diffstat (limited to 'src/3rdparty')
-rw-r--r-- | src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSObject.h | 3 | ||||
-rw-r--r-- | src/3rdparty/javascriptcore/JavaScriptCore/runtime/Operations.h | 6 |
2 files changed, 8 insertions, 1 deletions
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSObject.h b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSObject.h index 15b7957..35f7832 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSObject.h +++ b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSObject.h @@ -189,6 +189,9 @@ namespace JSC { virtual bool isActivationObject() const { return false; } virtual bool isWatchdogException() const { return false; } virtual bool isNotAnObjectErrorStub() const { return false; } +#ifdef QT_BUILD_SCRIPT_LIB + virtual bool compareToObject(ExecState*, JSObject *other) { return other == this; } +#endif void allocatePropertyStorage(size_t oldSize, size_t newSize); void allocatePropertyStorageInline(size_t oldSize, size_t newSize); diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Operations.h b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Operations.h index acfc6c2..a0caff4 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Operations.h +++ b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Operations.h @@ -73,7 +73,11 @@ namespace JSC { if (v1.isObject()) { if (v2.isObject()) - return v1 == v2; + return v1 == v2 +#ifdef QT_BUILD_SCRIPT_LIB + || asObject(v1)->compareToObject(exec, asObject(v2)) +#endif + ; JSValue p1 = v1.toPrimitive(exec); if (exec->hadException()) return false; |