aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4booleanobject.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2013-10-11 13:29:44 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-10-11 16:01:24 +0200
commitdfca0ef6ee9c8725bc111dadf1d5addd12f23944 (patch)
tree3032623a60d86e8f2b2d13a485894ed1cb6795d2 /src/qml/jsruntime/qv4booleanobject.cpp
parente964fc34269bc2087fb3246172a1890224a160bd (diff)
Correctly set the vtbl for Boolean and NumberObject
Also accept a boolean primitive as input to Boolean.prototype.valueOf() Change-Id: I5b94d8d65b86e26860b9844eb4bf823577c8e924 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4booleanobject.cpp')
-rw-r--r--src/qml/jsruntime/qv4booleanobject.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4booleanobject.cpp b/src/qml/jsruntime/qv4booleanobject.cpp
index d4d6201c01..025f98351f 100644
--- a/src/qml/jsruntime/qv4booleanobject.cpp
+++ b/src/qml/jsruntime/qv4booleanobject.cpp
@@ -95,7 +95,9 @@ ReturnedValue BooleanPrototype::method_toString(SimpleCallContext *ctx)
ReturnedValue BooleanPrototype::method_valueOf(SimpleCallContext *ctx)
{
- // ### Shouldn't this work for a boolean thisObject?
+ if (ctx->callData->thisObject.isBoolean())
+ return ctx->callData->thisObject.asReturnedValue();
+
Scope scope(ctx);
Scoped<BooleanObject> thisObject(scope, ctx->callData->thisObject);
if (!thisObject)