aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4arrayobject.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2013-09-25 22:42:58 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-28 13:33:43 +0200
commit18d4794e3f614eec8594f6636d569af8bc112618 (patch)
treec4f552dab56fea3f76b0b9542585a775c41db108 /src/qml/jsruntime/qv4arrayobject.cpp
parent150731fc68bcf823bec40729285813d902990cb7 (diff)
Fix Value usage in ErrorObjects
Change-Id: Iaa14ad5a8d3f085843e49195f8f4bb7bb020b9b6 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4arrayobject.cpp')
-rw-r--r--src/qml/jsruntime/qv4arrayobject.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4arrayobject.cpp b/src/qml/jsruntime/qv4arrayobject.cpp
index 02b83428fa..ea4d174bb7 100644
--- a/src/qml/jsruntime/qv4arrayobject.cpp
+++ b/src/qml/jsruntime/qv4arrayobject.cpp
@@ -273,8 +273,10 @@ ReturnedValue ArrayPrototype::method_push(SimpleCallContext *ctx)
double newLen = l + ctx->callData->argc;
if (!instance->isArrayObject())
instance->put(ctx->engine->id_length, ScopedValue(scope, Primitive::fromDouble(newLen)));
- else
- ctx->throwRangeError(Value::fromString(ctx, QStringLiteral("Array.prototype.push: Overflow")));
+ else {
+ ScopedString str(scope, ctx->engine->newString(QStringLiteral("Array.prototype.push: Overflow")));
+ ctx->throwRangeError(str);
+ }
return Primitive::fromDouble(newLen).asReturnedValue();
}