diff options
Diffstat (limited to 'src/qml/jsruntime/qv4value.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4value.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/qml/jsruntime/qv4value.cpp b/src/qml/jsruntime/qv4value.cpp index d1289bba7f..784628071b 100644 --- a/src/qml/jsruntime/qv4value.cpp +++ b/src/qml/jsruntime/qv4value.cpp @@ -88,7 +88,8 @@ double Value::toNumberImpl() const if (isString()) return RuntimeHelpers::stringToNumber(stringValue()->toQString()); { - Scope scope(managed()->engine()); + Q_ASSERT(isObject()); + Scope scope(objectValue()->engine()); ScopedValue prim(scope, RuntimeHelpers::toPrimitive(ValueRef::fromRawValue(this), NUMBER_HINT)); if (scope.engine->hasException) return 0; @@ -123,7 +124,8 @@ QString Value::toQStringNoThrow() const if (isString()) return stringValue()->toQString(); { - Scope scope(managed()->engine()); + Q_ASSERT(isObject()); + Scope scope(objectValue()->engine()); ScopedValue ex(scope); bool caughtException = false; ScopedValue prim(scope, RuntimeHelpers::toPrimitive(ValueRef::fromRawValue(this), STRING_HINT)); @@ -175,7 +177,8 @@ QString Value::toQString() const if (isString()) return stringValue()->toQString(); { - Scope scope(managed()->engine()); + Q_ASSERT(isObject()); + Scope scope(objectValue()->engine()); ScopedValue prim(scope, RuntimeHelpers::toPrimitive(ValueRef::fromRawValue(this), STRING_HINT)); return prim->toQString(); } |