diff options
author | Lars Knoll <lars.knoll@digia.com> | 2014-01-04 22:32:13 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-01-09 07:46:50 +0100 |
commit | 6e05ab2bc4598b86082766e5a51ad3a6c9e637b7 (patch) | |
tree | f51441e052be395b2f0aa6acb5f7a339bc2c394c /src/qml/jsruntime/qv4object.cpp | |
parent | ff18885e0a7f7527eb96a9f2047507e7f418db45 (diff) |
Add Object::hasOwnProperty()
This allows us to remove more getOwnProperty calls. This will
be required later on to extend our array handling.
Change-Id: I7b7f5887990cd443accf51891644fdfbb849cf35
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4object.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4object.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4object.cpp b/src/qml/jsruntime/qv4object.cpp index fc54933aca..53db957189 100644 --- a/src/qml/jsruntime/qv4object.cpp +++ b/src/qml/jsruntime/qv4object.cpp @@ -420,6 +420,16 @@ bool Object::__hasProperty__(uint index) const return false; } +bool Object::hasOwnProperty(const StringRef name) const +{ + return const_cast<Object *>(this)->__getOwnProperty__(name) != 0; +} + +bool Object::hasOwnProperty(uint index) const +{ + return const_cast<Object *>(this)->__getOwnProperty__(index) != 0; +} + ReturnedValue Object::get(Managed *m, const StringRef name, bool *hasProperty) { return static_cast<Object *>(m)->internalGet(name, hasProperty); |