diff options
author | Lars Knoll <[email protected]> | 2013-10-10 16:17:28 +0200 |
---|---|---|
committer | The Qt Project <[email protected]> | 2013-10-11 08:56:26 +0200 |
commit | 40db24351b6a89a3fb30a4870afdf90a4b91663f (patch) | |
tree | 2fa70623d615cef347c4ad3f9e8422455abc4aa3 /src/qml/jsruntime/qv4booleanobject.cpp | |
parent | b0e83cdc1a3a80ecc26cb31ac046b6c743238d41 (diff) |
Smaller cleanups
Change-Id: I0a7eee96ef7c92ad4a3c5963010e3ac66fe6ed3a
Reviewed-by: Simon Hausmann <[email protected]>
Diffstat (limited to 'src/qml/jsruntime/qv4booleanobject.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4booleanobject.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4booleanobject.cpp b/src/qml/jsruntime/qv4booleanobject.cpp index 341e3003c6..d4d6201c01 100644 --- a/src/qml/jsruntime/qv4booleanobject.cpp +++ b/src/qml/jsruntime/qv4booleanobject.cpp @@ -44,6 +44,7 @@ using namespace QV4; DEFINE_MANAGED_VTABLE(BooleanCtor); +DEFINE_MANAGED_VTABLE(BooleanObject); BooleanCtor::BooleanCtor(ExecutionContext *scope) : FunctionObject(scope, QStringLiteral("Boolean")) @@ -82,7 +83,8 @@ ReturnedValue BooleanPrototype::method_toString(SimpleCallContext *ctx) if (ctx->callData->thisObject.isBoolean()) { result = ctx->callData->thisObject.booleanValue(); } else { - BooleanObject *thisObject = ctx->callData->thisObject.asBooleanObject(); + Scope scope(ctx); + Scoped<BooleanObject> thisObject(scope, ctx->callData->thisObject); if (!thisObject) ctx->throwTypeError(); result = thisObject->value.booleanValue(); @@ -93,7 +95,9 @@ ReturnedValue BooleanPrototype::method_toString(SimpleCallContext *ctx) ReturnedValue BooleanPrototype::method_valueOf(SimpleCallContext *ctx) { - BooleanObject *thisObject = ctx->callData->thisObject.asBooleanObject(); + // ### Shouldn't this work for a boolean thisObject? + Scope scope(ctx); + Scoped<BooleanObject> thisObject(scope, ctx->callData->thisObject); if (!thisObject) ctx->throwTypeError(); |