summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2009-07-22 10:50:43 (GMT)
committerOlivier Goffart <ogoffart@trolltech.com>2009-07-22 10:59:19 (GMT)
commit5d2ad577a42c8cbdd095ef336dd4275638901d59 (patch)
tree19a6512c5d867ca727eff4de83efdfe52a5c0c4b
parentf98debbe7ce8accf746fb3ff9cecfef214451e93 (diff)
downloadQt-5d2ad577a42c8cbdd095ef336dd4275638901d59.zip
Qt-5d2ad577a42c8cbdd095ef336dd4275638901d59.tar.gz
Qt-5d2ad577a42c8cbdd095ef336dd4275638901d59.tar.bz2
fix QScriptValue::isError
Reviewed-by: Kent Hansen
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/runtime/NativeErrorPrototype.cpp4
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/runtime/NativeErrorPrototype.h11
-rw-r--r--tests/auto/qscriptvalue/tst_qscriptvalue.cpp1
3 files changed, 14 insertions, 2 deletions
diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/NativeErrorPrototype.cpp b/src/3rdparty/webkit/JavaScriptCore/runtime/NativeErrorPrototype.cpp
index 84190a0..650a0fd 100644
--- a/src/3rdparty/webkit/JavaScriptCore/runtime/NativeErrorPrototype.cpp
+++ b/src/3rdparty/webkit/JavaScriptCore/runtime/NativeErrorPrototype.cpp
@@ -30,7 +30,11 @@ namespace JSC {
ASSERT_CLASS_FITS_IN_CELL(NativeErrorPrototype);
NativeErrorPrototype::NativeErrorPrototype(ExecState* exec, PassRefPtr<Structure> structure, const UString& name, const UString& message)
+#ifdef QT_BUILD_SCRIPT_LIB
+ : ErrorInstance(structure)
+#else
: JSObject(structure)
+#endif
{
putDirect(exec->propertyNames().name, jsString(exec, name), 0);
putDirect(exec->propertyNames().message, jsString(exec, message), 0);
diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/NativeErrorPrototype.h b/src/3rdparty/webkit/JavaScriptCore/runtime/NativeErrorPrototype.h
index 77bfe8a..48a9d7e 100644
--- a/src/3rdparty/webkit/JavaScriptCore/runtime/NativeErrorPrototype.h
+++ b/src/3rdparty/webkit/JavaScriptCore/runtime/NativeErrorPrototype.h
@@ -22,10 +22,19 @@
#define NativeErrorPrototype_h
#include "JSObject.h"
+#ifdef QT_BUILD_SCRIPT_LIB
+#include "ErrorInstance.h"
+#endif
namespace JSC {
- class NativeErrorPrototype : public JSObject {
+ class NativeErrorPrototype :
+#ifdef QT_BUILD_SCRIPT_LIB //According to ECMAScript Specification 15.11.7, errors must have the "Error" class
+ public ErrorInstance
+#else
+ public JSObject
+#endif
+ {
public:
NativeErrorPrototype(ExecState*, PassRefPtr<Structure>, const UString& name, const UString& message);
};
diff --git a/tests/auto/qscriptvalue/tst_qscriptvalue.cpp b/tests/auto/qscriptvalue/tst_qscriptvalue.cpp
index b0df6fd..ddd846a 100644
--- a/tests/auto/qscriptvalue/tst_qscriptvalue.cpp
+++ b/tests/auto/qscriptvalue/tst_qscriptvalue.cpp
@@ -1653,7 +1653,6 @@ void tst_QScriptValue::isError()
for (int i = 0; i < errors.size(); ++i) {
QScriptValue ctor = eng.globalObject().property(errors.at(i));
QVERIFY(ctor.isFunction());
- QEXPECT_FAIL("", "Error.prototype should itself be an Error object", Continue);
QVERIFY(ctor.property("prototype").isError());
}
QVERIFY(!eng.globalObject().isError());