summaryrefslogtreecommitdiffstats
path: root/src/script/api/qscriptengine_p.h
diff options
context:
space:
mode:
authorKent Hansen <kent.hansen@nokia.com>2010-03-01 10:11:30 (GMT)
committerKent Hansen <kent.hansen@nokia.com>2010-03-01 14:37:26 (GMT)
commit9d38d8005876d808f499591d1427b227f4b9764f (patch)
treea8a7119f30c762be04df15e537507fa1351d9644 /src/script/api/qscriptengine_p.h
parent2fa8c8d4ddc162297a05f2908e0d86eb2c738153 (diff)
downloadQt-9d38d8005876d808f499591d1427b227f4b9764f.zip
Qt-9d38d8005876d808f499591d1427b227f4b9764f.tar.gz
Qt-9d38d8005876d808f499591d1427b227f4b9764f.tar.bz2
Avoid conversion between JavaScriptCore String type and QString
Use JSC::UString internally. Only when the public API demands it should a JSC::UString be converted to a QString. Reviewed-by: Jedrzej Nowacki
Diffstat (limited to 'src/script/api/qscriptengine_p.h')
-rw-r--r--src/script/api/qscriptengine_p.h20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/script/api/qscriptengine_p.h b/src/script/api/qscriptengine_p.h
index d0d020a..a05e12c 100644
--- a/src/script/api/qscriptengine_p.h
+++ b/src/script/api/qscriptengine_p.h
@@ -165,7 +165,7 @@ public:
static inline qint32 toInt32(JSC::ExecState *, JSC::JSValue);
static inline quint32 toUInt32(JSC::ExecState *, JSC::JSValue);
static inline quint16 toUInt16(JSC::ExecState *, JSC::JSValue);
- static inline QString toString(JSC::ExecState *, JSC::JSValue);
+ static inline JSC::UString toString(JSC::ExecState *, JSC::JSValue);
static inline QDateTime toDateTime(JSC::ExecState *, JSC::JSValue);
#ifndef QT_NO_REGEXP
@@ -181,8 +181,8 @@ public:
static inline JSC::JSValue property(JSC::ExecState*, JSC::JSValue, quint32 index,
int resolveMode = QScriptValue::ResolvePrototype);
static JSC::JSValue propertyHelper(JSC::ExecState*, JSC::JSValue, quint32, int resolveMode);
- static inline JSC::JSValue property(JSC::ExecState*, JSC::JSValue, const QString &, int resolveMode);
- static inline void setProperty(JSC::ExecState*, JSC::JSValue object, const QString &name, JSC::JSValue,
+ static inline JSC::JSValue property(JSC::ExecState*, JSC::JSValue, const JSC::UString &, int resolveMode);
+ static inline void setProperty(JSC::ExecState*, JSC::JSValue object, const JSC::UString &name, JSC::JSValue,
const QScriptValue::PropertyFlags &flags = QScriptValue::KeepExistingFlags);
static void setProperty(JSC::ExecState*, JSC::JSValue object, const JSC::Identifier &id, JSC::JSValue,
const QScriptValue::PropertyFlags &flags = QScriptValue::KeepExistingFlags);
@@ -191,7 +191,7 @@ public:
static QScriptValue::PropertyFlags propertyFlags(JSC::ExecState*, JSC::JSValue value,
const JSC::Identifier &id, const QScriptValue::ResolveFlags &mode);
static inline QScriptValue::PropertyFlags propertyFlags(JSC::ExecState*, JSC::JSValue value,
- const QString &name, const QScriptValue::ResolveFlags &mode);
+ const JSC::UString &name, const QScriptValue::ResolveFlags &mode);
static bool convertValue(JSC::ExecState*, JSC::JSValue value,
int type, void *ptr);
@@ -629,7 +629,7 @@ inline void QScriptValuePrivate::initFrom(const QString &value)
engine->registerScriptValue(this);
}
-inline JSC::JSValue QScriptEnginePrivate::property(JSC::ExecState *exec, JSC::JSValue value, const QString &name, int resolveMode)
+inline JSC::JSValue QScriptEnginePrivate::property(JSC::ExecState *exec, JSC::JSValue value, const JSC::UString &name, int resolveMode)
{
return property(exec, value, JSC::Identifier(exec, name), resolveMode);
}
@@ -655,13 +655,13 @@ inline JSC::JSValue QScriptEnginePrivate::property(JSC::ExecState *exec, JSC::JS
}
inline QScriptValue::PropertyFlags QScriptEnginePrivate::propertyFlags(JSC::ExecState *exec, JSC::JSValue value,
- const QString &name,
+ const JSC::UString &name,
const QScriptValue::ResolveFlags &mode)
{
return propertyFlags(exec, value, JSC::Identifier(exec, name), mode);
}
-inline void QScriptEnginePrivate::setProperty(JSC::ExecState *exec, JSC::JSValue objectValue, const QString &name,
+inline void QScriptEnginePrivate::setProperty(JSC::ExecState *exec, JSC::JSValue objectValue, const JSC::UString &name,
JSC::JSValue value, const QScriptValue::PropertyFlags &flags)
{
setProperty(exec, objectValue, JSC::Identifier(exec, name), value, flags);
@@ -677,7 +677,7 @@ inline JSC::JSValue QScriptValuePrivate::property(quint32 index, int resolveMode
return QScriptEnginePrivate::property(engine->currentFrame, jscValue, index, resolveMode);
}
-inline JSC::JSValue QScriptValuePrivate::property(const QString &name, int resolveMode) const
+inline JSC::JSValue QScriptValuePrivate::property(const JSC::UString &name, int resolveMode) const
{
JSC::ExecState *exec = engine->currentFrame;
return QScriptEnginePrivate::property(exec, jscValue, JSC::Identifier(exec, name), resolveMode);
@@ -701,7 +701,7 @@ inline void QScriptValuePrivate::setProperty(quint32 index, const JSC::JSValue &
QScriptEnginePrivate::setProperty(engine->currentFrame, jscValue, index, value, flags);
}
-inline void QScriptValuePrivate::setProperty(const QString &name, const JSC::JSValue &value,
+inline void QScriptValuePrivate::setProperty(const JSC::UString &name, const JSC::JSValue &value,
const QScriptValue::PropertyFlags &flags)
{
JSC::ExecState *exec = engine->currentFrame;
@@ -919,7 +919,7 @@ inline quint16 QScriptEnginePrivate::toUInt16(JSC::ExecState *exec, JSC::JSValue
return QScript::ToUInt16(toNumber(exec, value));
}
-inline QString QScriptEnginePrivate::toString(JSC::ExecState *exec, JSC::JSValue value)
+inline JSC::UString QScriptEnginePrivate::toString(JSC::ExecState *exec, JSC::JSValue value)
{
JSC::JSValue savedException;
saveException(exec, &savedException);