diff options
author | Lars Knoll <lars.knoll@theqtcompany.com> | 2015-05-01 00:08:55 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2015-06-17 09:03:48 +0000 |
commit | 64199b0a5842b6b57f694c14d7f1327cf5f2344f (patch) | |
tree | 5846b6e7866a5abb10bafcdefafe5fc0ceff171f /src/qml/jsruntime/qv4object.cpp | |
parent | 81d8e36c1732854a0c6b0312c0bf42804d30192e (diff) |
Store a Heap::String pointer in StringObject
Change-Id: I926c5bb2dd4f1613af6737d4200e568f0ec13d58
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src/qml/jsruntime/qv4object.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4object.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/qml/jsruntime/qv4object.cpp b/src/qml/jsruntime/qv4object.cpp index a5ec07006e..b4ad477e89 100644 --- a/src/qml/jsruntime/qv4object.cpp +++ b/src/qml/jsruntime/qv4object.cpp @@ -356,8 +356,7 @@ bool Object::hasOwnProperty(uint index) const return true; if (isStringObject()) { - String *s = static_cast<const StringObject *>(this)->d()->value.as<String>(); - if (index < (uint)s->d()->length()) + if (index < static_cast<const StringObject *>(this)->length()) return true; } if (!queryIndexed(index).isEmpty()) @@ -416,8 +415,7 @@ PropertyAttributes Object::queryIndexed(const Managed *m, uint index) return o->arrayData()->attributes(index); if (o->isStringObject()) { - String *s = static_cast<const StringObject *>(o)->d()->value.as<String>(); - if (index < (uint)s->d()->length()) + if (index < static_cast<const StringObject *>(o)->length()) return (Attr_NotWritable|Attr_NotConfigurable); } return Attr_Invalid; |