aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4managed.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@theqtcompany.com>2015-09-01 13:46:46 +0200
committerLars Knoll <lars.knoll@theqtcompany.com>2015-09-22 08:20:18 +0000
commitff347ccb093c8be4b44305516e644a17d01d6c30 (patch)
tree2c3fd59e1cd2e273e8044f0572212d946f94ab88 /src/qml/jsruntime/qv4managed.cpp
parentbf8403d8d4c39efc02dc38b5d75194ff712192fe (diff)
Fixes to Error objects
Move the name and message property into the prototype as per JS spec. Only define the message property in the object itself if the value used for construction is not undefined. In addition, clean up creation of the objects and centralize it in a few template methods. Change-Id: I014017b710575b30bf4e0b0228111878f5c73b9a Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src/qml/jsruntime/qv4managed.cpp')
-rw-r--r--src/qml/jsruntime/qv4managed.cpp24
1 files changed, 1 insertions, 23 deletions
diff --git a/src/qml/jsruntime/qv4managed.cpp b/src/qml/jsruntime/qv4managed.cpp
index bb7ee43b4e..e2de36d18e 100644
--- a/src/qml/jsruntime/qv4managed.cpp
+++ b/src/qml/jsruntime/qv4managed.cpp
@@ -88,29 +88,7 @@ QString Managed::className() const
s = "RegExp";
break;
case Type_ErrorObject:
- switch (static_cast<Heap::ErrorObject *>(d())->errorType) {
- case Heap::ErrorObject::Error:
- s = "Error";
- break;
- case Heap::ErrorObject::EvalError:
- s = "EvalError";
- break;
- case Heap::ErrorObject::RangeError:
- s = "RangeError";
- break;
- case Heap::ErrorObject::ReferenceError:
- s = "ReferenceError";
- break;
- case Heap::ErrorObject::SyntaxError:
- s = "SyntaxError";
- break;
- case Heap::ErrorObject::TypeError:
- s = "TypeError";
- break;
- case Heap::ErrorObject::URIError:
- s = "URIError";
- break;
- }
+ s = ErrorObject::className(static_cast<Heap::ErrorObject *>(d())->errorType);
break;
case Type_ArgumentsObject:
s = "Arguments";