From 18d4794e3f614eec8594f6636d569af8bc112618 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Wed, 25 Sep 2013 22:42:58 +0200 Subject: Fix Value usage in ErrorObjects Change-Id: Iaa14ad5a8d3f085843e49195f8f4bb7bb020b9b6 Reviewed-by: Simon Hausmann --- src/qml/jsruntime/qv4arrayobject.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/qml/jsruntime/qv4arrayobject.cpp') 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(); } -- cgit v1.2.3