diff options
author | Lars Knoll <[email protected]> | 2014-07-28 10:07:57 +0200 |
---|---|---|
committer | Simon Hausmann <[email protected]> | 2014-11-04 20:17:54 +0100 |
commit | 486948817b26da2c62802bb93a0f671715c609d4 (patch) | |
tree | 45cd51615a6d187ac504c18c4dee4aa31cf9a771 /src/qml/jsruntime/qv4arrayobject.cpp | |
parent | 6f6b350976ccfe959223b1fbe8c21fe71efc45bd (diff) |
Move the throw methods from ExecutionContext to ExecutionEngine
The methods don't require a context, and thus shouldn't be
implemented there.
Change-Id: If058e0c5067093a4161f2275ac4288aa2bc500f3
Reviewed-by: Simon Hausmann <[email protected]>
Diffstat (limited to 'src/qml/jsruntime/qv4arrayobject.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4arrayobject.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/qml/jsruntime/qv4arrayobject.cpp b/src/qml/jsruntime/qv4arrayobject.cpp index 1d17672714..bbc0867c22 100644 --- a/src/qml/jsruntime/qv4arrayobject.cpp +++ b/src/qml/jsruntime/qv4arrayobject.cpp @@ -58,7 +58,7 @@ ReturnedValue ArrayCtor::construct(Managed *m, CallData *callData) len = callData->args[0].asArrayLength(&ok); if (!ok) - return v4->currentContext()->throwRangeError(callData->args[0]); + return v4->throwRangeError(callData->args[0]); if (len < 0x1000) a->arrayReserve(len); @@ -286,7 +286,7 @@ ReturnedValue ArrayPrototype::method_push(CallContext *ctx) instance->put(ctx->d()->engine->id_length, ScopedValue(scope, Primitive::fromDouble(newLen))); else { ScopedString str(scope, ctx->d()->engine->newString(QStringLiteral("Array.prototype.push: Overflow"))); - return ctx->throwRangeError(str); + return ctx->engine()->throwRangeError(str); } return Encode(newLen); } @@ -691,7 +691,7 @@ ReturnedValue ArrayPrototype::method_every(CallContext *ctx) Scoped<FunctionObject> callback(scope, ctx->argument(0)); if (!callback) - return ctx->throwTypeError(); + return ctx->engine()->throwTypeError(); ScopedCallData callData(scope, 3); callData->args[2] = instance; @@ -725,7 +725,7 @@ ReturnedValue ArrayPrototype::method_some(CallContext *ctx) Scoped<FunctionObject> callback(scope, ctx->argument(0)); if (!callback) - return ctx->throwTypeError(); + return ctx->engine()->throwTypeError(); ScopedCallData callData(scope, 3); callData->thisObject = ctx->argument(1); @@ -759,7 +759,7 @@ ReturnedValue ArrayPrototype::method_forEach(CallContext *ctx) Scoped<FunctionObject> callback(scope, ctx->argument(0)); if (!callback) - return ctx->throwTypeError(); + return ctx->engine()->throwTypeError(); ScopedCallData callData(scope, 3); callData->thisObject = ctx->argument(1); @@ -790,7 +790,7 @@ ReturnedValue ArrayPrototype::method_map(CallContext *ctx) Scoped<FunctionObject> callback(scope, ctx->argument(0)); if (!callback) - return ctx->throwTypeError(); + return ctx->engine()->throwTypeError(); Scoped<ArrayObject> a(scope, ctx->d()->engine->newArrayObject()); a->arrayReserve(len); @@ -827,7 +827,7 @@ ReturnedValue ArrayPrototype::method_filter(CallContext *ctx) Scoped<FunctionObject> callback(scope, ctx->argument(0)); if (!callback) - return ctx->throwTypeError(); + return ctx->engine()->throwTypeError(); Scoped<ArrayObject> a(scope, ctx->d()->engine->newArrayObject()); a->arrayReserve(len); @@ -868,7 +868,7 @@ ReturnedValue ArrayPrototype::method_reduce(CallContext *ctx) Scoped<FunctionObject> callback(scope, ctx->argument(0)); if (!callback) - return ctx->throwTypeError(); + return ctx->engine()->throwTypeError(); uint k = 0; ScopedValue acc(scope); @@ -885,7 +885,7 @@ ReturnedValue ArrayPrototype::method_reduce(CallContext *ctx) ++k; } if (!kPresent) - return ctx->throwTypeError(); + return ctx->engine()->throwTypeError(); } ScopedCallData callData(scope, 4); @@ -918,11 +918,11 @@ ReturnedValue ArrayPrototype::method_reduceRight(CallContext *ctx) Scoped<FunctionObject> callback(scope, ctx->argument(0)); if (!callback) - return ctx->throwTypeError(); + return ctx->engine()->throwTypeError(); if (len == 0) { if (ctx->d()->callData->argc == 1) - return ctx->throwTypeError(); + return ctx->engine()->throwTypeError(); return ctx->argument(1); } @@ -940,7 +940,7 @@ ReturnedValue ArrayPrototype::method_reduceRight(CallContext *ctx) --k; } if (!kPresent) - return ctx->throwTypeError(); + return ctx->engine()->throwTypeError(); } ScopedCallData callData(scope, 4); |