aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4string.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2013-09-19 13:17:55 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-22 01:06:20 +0200
commit78b49cf8361b1462cc94a061916a15f0b98e27e3 (patch)
tree01ac33be8df5d1cf2801ed34275d22bff7934e62 /src/qml/jsruntime/qv4string.cpp
parenta9bdc91cefabb3729d0240fce4c01a669be09dbf (diff)
Convert the last methods in qv4object_p.h
Change-Id: I4fda83a0832760c277e629d4e658da718c0bf92b Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4string.cpp')
-rw-r--r--src/qml/jsruntime/qv4string.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/qml/jsruntime/qv4string.cpp b/src/qml/jsruntime/qv4string.cpp
index 7995e37a6f..e70bf7d626 100644
--- a/src/qml/jsruntime/qv4string.cpp
+++ b/src/qml/jsruntime/qv4string.cpp
@@ -131,10 +131,10 @@ void String::destroy(Managed *that)
ReturnedValue String::get(Managed *m, const StringRef name, bool *hasProperty)
{
- Scope scope(m->engine());
-
- String *that = static_cast<String *>(m);
ExecutionEngine *v4 = m->engine();
+ Scope scope(v4);
+ ScopedString that(scope, static_cast<String *>(m));
+
if (name->isEqualTo(v4->id_length)) {
if (hasProperty)
*hasProperty = true;
@@ -149,13 +149,15 @@ ReturnedValue String::get(Managed *m, const StringRef name, bool *hasProperty)
}
if (hasProperty)
*hasProperty = true;
- return v4->stringClass->prototype->getValue(Value::fromString(that), pd, attrs);
+ return v4->stringClass->prototype->getValue(that, pd, attrs);
}
ReturnedValue String::getIndexed(Managed *m, uint index, bool *hasProperty)
{
- String *that = static_cast<String *>(m);
- ExecutionEngine *engine = that->engine();
+ ExecutionEngine *engine = m->engine();
+ Scope scope(engine);
+ ScopedString that(scope, static_cast<String *>(m));
+
if (index < that->_text.length()) {
if (hasProperty)
*hasProperty = true;
@@ -170,7 +172,7 @@ ReturnedValue String::getIndexed(Managed *m, uint index, bool *hasProperty)
}
if (hasProperty)
*hasProperty = true;
- return engine->stringClass->prototype->getValue(Value::fromString(that), pd, attrs);
+ return engine->stringClass->prototype->getValue(that, pd, attrs);
}
void String::put(Managed *m, const StringRef name, const ValueRef value)