diff options
Diffstat (limited to 'src/qml/jsruntime/qv4value.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4value.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/qml/jsruntime/qv4value.cpp b/src/qml/jsruntime/qv4value.cpp index e4f84b22fb..004f7cb6a3 100644 --- a/src/qml/jsruntime/qv4value.cpp +++ b/src/qml/jsruntime/qv4value.cpp @@ -269,21 +269,26 @@ double Primitive::toInteger(double number) #ifndef V4_BOOTSTRAP String *Value::toString(ExecutionEngine *e) const { - return toString(e->currentContext()); + if (isString()) + return stringValue(); + return RuntimeHelpers::convertToString(e, ValueRef::fromRawValue(this))->getPointer(); } String *Value::toString(ExecutionContext *ctx) const { - if (isString()) - return stringValue(); - return RuntimeHelpers::convertToString(ctx, ValueRef::fromRawValue(this))->getPointer(); + return toString(ctx->engine()); } -Object *Value::toObject(ExecutionContext *ctx) const +Object *Value::toObject(ExecutionEngine *e) const { if (isObject()) return objectValue(); - return RuntimeHelpers::convertToObject(ctx, ValueRef::fromRawValue(this))->getPointer(); + return RuntimeHelpers::convertToObject(e, ValueRef::fromRawValue(this))->getPointer(); +} + +Object *Value::toObject(ExecutionContext *ctx) const +{ + return toObject(ctx->engine()); } #endif // V4_BOOTSTRAP |