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/qv4regexpobject.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/qv4regexpobject.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4regexpobject.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/qml/jsruntime/qv4regexpobject.cpp b/src/qml/jsruntime/qv4regexpobject.cpp index f1771782d7..b16a6bd875 100644 --- a/src/qml/jsruntime/qv4regexpobject.cpp +++ b/src/qml/jsruntime/qv4regexpobject.cpp @@ -254,7 +254,7 @@ ReturnedValue RegExpCtor::construct(Managed *m, CallData *callData) Scoped<RegExpObject> re(scope, r); if (re) { if (!f->isUndefined()) - return ctx->throwTypeError(); + return ctx->engine()->throwTypeError(); return Encode(ctx->d()->engine->newRegExpObject(re->value(), re->global())); } @@ -281,14 +281,14 @@ ReturnedValue RegExpCtor::construct(Managed *m, CallData *callData) } else if (str.at(i) == QLatin1Char('m') && !multiLine) { multiLine = true; } else { - return ctx->throwSyntaxError(QStringLiteral("Invalid flags supplied to RegExp constructor")); + return ctx->engine()->throwSyntaxError(QStringLiteral("Invalid flags supplied to RegExp constructor")); } } } Scoped<RegExp> regexp(scope, RegExp::create(ctx->d()->engine, pattern, ignoreCase, multiLine)); if (!regexp->isValid()) - return ctx->throwSyntaxError(QStringLiteral("Invalid regular expression")); + return ctx->engine()->throwSyntaxError(QStringLiteral("Invalid regular expression")); return Encode(ctx->d()->engine->newRegExpObject(regexp, global)); } @@ -353,7 +353,7 @@ ReturnedValue RegExpPrototype::method_exec(CallContext *ctx) Scope scope(ctx); Scoped<RegExpObject> r(scope, ctx->d()->callData->thisObject.as<RegExpObject>()); if (!r) - return ctx->throwTypeError(); + return ctx->engine()->throwTypeError(); ScopedValue arg(scope, ctx->argument(0)); arg = RuntimeHelpers::toString(ctx, arg); @@ -417,7 +417,7 @@ ReturnedValue RegExpPrototype::method_toString(CallContext *ctx) Scope scope(ctx); Scoped<RegExpObject> r(scope, ctx->d()->callData->thisObject.as<RegExpObject>()); if (!r) - return ctx->throwTypeError(); + return ctx->engine()->throwTypeError(); return ctx->d()->engine->newString(r->toString())->asReturnedValue(); } @@ -427,7 +427,7 @@ ReturnedValue RegExpPrototype::method_compile(CallContext *ctx) Scope scope(ctx); Scoped<RegExpObject> r(scope, ctx->d()->callData->thisObject.as<RegExpObject>()); if (!r) - return ctx->throwTypeError(); + return ctx->engine()->throwTypeError(); ScopedCallData callData(scope, ctx->d()->callData->argc); memcpy(callData->args, ctx->d()->callData->args, ctx->d()->callData->argc*sizeof(Value)); |