diff options
Diffstat (limited to 'src/qml/jsruntime/qv4arrayobject.cpp')
| -rw-r--r-- | src/qml/jsruntime/qv4arrayobject.cpp | 6 |
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(); } |
