diff options
author | Lars Knoll <lars.knoll@theqtcompany.com> | 2015-08-25 17:17:04 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@theqtcompany.com> | 2015-09-15 19:12:54 +0000 |
commit | c5f3028d43662050a6bf5419690ddd4ab4288db8 (patch) | |
tree | 183dd197eac6b72dd251d58c939f57956a0c47d2 /src/qml/jsruntime/qv4regexpobject.cpp | |
parent | 458892bcd570b5b517387a22782afe3cff2eea6d (diff) |
Cleanup
The property is always value based, so there's no need to
cast to a Property* when returning it.
Change-Id: I095a940197aedac90ad9f5491ccb9af0ca53d722
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src/qml/jsruntime/qv4regexpobject.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4regexpobject.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/qml/jsruntime/qv4regexpobject.cpp b/src/qml/jsruntime/qv4regexpobject.cpp index cea166a01c..6ee485b811 100644 --- a/src/qml/jsruntime/qv4regexpobject.cpp +++ b/src/qml/jsruntime/qv4regexpobject.cpp @@ -172,10 +172,10 @@ void RegExpObject::markObjects(Heap::Base *that, ExecutionEngine *e) Object::markObjects(that, e); } -Property *RegExpObject::lastIndexProperty() +Value *RegExpObject::lastIndexProperty() { Q_ASSERT(0 == internalClass()->find(engine()->id_lastIndex())); - return propertyAt(0); + return propertyData(0); } // Converts a JS RegExp to a QRegExp. @@ -353,9 +353,9 @@ ReturnedValue RegExpPrototype::method_exec(CallContext *ctx) return Encode::undefined(); QString s = arg->stringValue()->toQString(); - int offset = r->global() ? r->lastIndexProperty()->value.toInt32() : 0; + int offset = r->global() ? r->lastIndexProperty()->toInt32() : 0; if (offset < 0 || offset > s.length()) { - r->lastIndexProperty()->value = Primitive::fromInt32(0); + *r->lastIndexProperty() = Primitive::fromInt32(0); return Encode::null(); } @@ -366,7 +366,7 @@ ReturnedValue RegExpPrototype::method_exec(CallContext *ctx) regExpCtor->d()->clearLastMatch(); if (result == -1) { - r->lastIndexProperty()->value = Primitive::fromInt32(0); + *r->lastIndexProperty() = Primitive::fromInt32(0); return Encode::null(); } @@ -392,7 +392,7 @@ ReturnedValue RegExpPrototype::method_exec(CallContext *ctx) dd->lastMatchEnd = matchOffsets[1]; if (r->global()) - r->lastIndexProperty()->value = Primitive::fromInt32(matchOffsets[1]); + *r->lastIndexProperty() = Primitive::fromInt32(matchOffsets[1]); return array.asReturnedValue(); } |