aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4string_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/jsruntime/qv4string_p.h')
-rw-r--r--src/qml/jsruntime/qv4string_p.h15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/qml/jsruntime/qv4string_p.h b/src/qml/jsruntime/qv4string_p.h
index 7dd912a41f..7ad428a502 100644
--- a/src/qml/jsruntime/qv4string_p.h
+++ b/src/qml/jsruntime/qv4string_p.h
@@ -120,10 +120,6 @@ struct Q_QML_EXPORT String : public Managed {
return _text.length();
}
- static String *cast(const Value &v) {
- return v.asString();
- }
-
QString _text;
mutable Identifier *identifier;
mutable uint stringHash;
@@ -142,6 +138,17 @@ protected:
static bool isEqualTo(Managed *that, Managed *o);
};
+template<>
+inline String *value_cast(const Value &v) {
+ return v.asString();
+}
+
+template<>
+inline ReturnedValue value_convert<String>(ExecutionContext *ctx, const Value &v)
+{
+ return v.toString(ctx)->asReturnedValue();
+}
+
}
QT_END_NAMESPACE