diff options
author | Lars Knoll <[email protected]> | 2013-09-13 14:11:55 +0200 |
---|---|---|
committer | The Qt Project <[email protected]> | 2013-09-18 13:14:03 +0200 |
commit | 49aead7f236f8b8a6ab85adc4b5eace1c1e4dde6 (patch) | |
tree | 21b01c30b568bd79176a5dfe4ec2437e2545660e /src/qml/jsruntime/qv4booleanobject.cpp | |
parent | 2a43ec129a544d80c9cc3266b5eccce0f6ba66ef (diff) |
Extend the ReturnedValue mechanism to pointers to Managed objects
Add a Returned<T> that we can return instead of raw pointers
to Managed objects.
Start using the Returned<T> for a few methods.
Also clean up all our classes to use the Q_MANAGED macro instead
of manually defining their vtable.
Change-Id: I0a2962e47f3de955cd2cd8474f8f3fcc9e36d084
Reviewed-by: Simon Hausmann <[email protected]>
Diffstat (limited to 'src/qml/jsruntime/qv4booleanobject.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4booleanobject.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4booleanobject.cpp b/src/qml/jsruntime/qv4booleanobject.cpp index 6fb21433d6..86ddebd6c3 100644 --- a/src/qml/jsruntime/qv4booleanobject.cpp +++ b/src/qml/jsruntime/qv4booleanobject.cpp @@ -54,13 +54,13 @@ BooleanCtor::BooleanCtor(ExecutionContext *scope) ReturnedValue BooleanCtor::construct(Managed *m, CallData *callData) { bool n = callData->argc ? callData->args[0].toBoolean() : false; - return Value::fromObject(m->engine()->newBooleanObject(Value::fromBoolean(n))).asReturnedValue(); + return Encode(m->engine()->newBooleanObject(Value::fromBoolean(n))); } ReturnedValue BooleanCtor::call(Managed *, CallData *callData) { bool value = callData->argc ? callData->args[0].toBoolean() : 0; - return Value::fromBoolean(value).asReturnedValue(); + return Encode(value); } void BooleanPrototype::init(ExecutionContext *ctx, const Value &ctor) |