diff options
author | Kent Hansen <khansen@trolltech.com> | 2009-07-02 10:21:40 (GMT) |
---|---|---|
committer | Kent Hansen <khansen@trolltech.com> | 2009-07-02 10:21:40 (GMT) |
commit | db684926cf69e329ca845c6204bbbbd5506721e6 (patch) | |
tree | ba7fe1b29f242222da52d8193c89ba63b0256b5d /src/script/bridge | |
parent | 481211251438441aee79b8bc6178e7157eba7f61 (diff) | |
download | Qt-db684926cf69e329ca845c6204bbbbd5506721e6.zip Qt-db684926cf69e329ca845c6204bbbbd5506721e6.tar.gz Qt-db684926cf69e329ca845c6204bbbbd5506721e6.tar.bz2 |
implement QScriptValue::QObjectMember property flag
Diffstat (limited to 'src/script/bridge')
-rw-r--r-- | src/script/bridge/qscriptqobject.cpp | 9 | ||||
-rw-r--r-- | src/script/bridge/qscriptqobject_p.h | 5 |
2 files changed, 10 insertions, 4 deletions
diff --git a/src/script/bridge/qscriptqobject.cpp b/src/script/bridge/qscriptqobject.cpp index ae7a75b..3cd0091 100644 --- a/src/script/bridge/qscriptqobject.cpp +++ b/src/script/bridge/qscriptqobject.cpp @@ -146,7 +146,8 @@ static inline QByteArray methodName(const QMetaMethod &method) static unsigned flagsForMetaProperty(const QMetaProperty &prop) { return (JSC::DontDelete - | (!prop.isWritable() ? unsigned(JSC::ReadOnly) : unsigned(0))); + | (!prop.isWritable() ? unsigned(JSC::ReadOnly) : unsigned(0)) + | QObjectMemberAttribute); } static int indexOfMetaEnum(const QMetaObject *meta, const QByteArray &str) @@ -1151,7 +1152,7 @@ bool QObjectWrapperObject::getPropertyAttributes(JSC::ExecState *exec, if (hasMethodAccess(method, index, opt)) { if (!(opt & QScriptEngine::ExcludeSuperClassMethods) || (index >= meta->methodOffset())) { - attributes = 0; + attributes = QObjectMemberAttribute; if (opt & QScriptEngine::SkipMethodsInEnumeration) attributes |= JSC::DontEnum; return true; @@ -1174,7 +1175,7 @@ bool QObjectWrapperObject::getPropertyAttributes(JSC::ExecState *exec, index = qobject->dynamicPropertyNames().indexOf(name); if (index != -1) { - attributes = 0; + attributes = QObjectMemberAttribute; return true; } @@ -1184,7 +1185,7 @@ bool QObjectWrapperObject::getPropertyAttributes(JSC::ExecState *exec, QMetaMethod method = meta->method(index); if (hasMethodAccess(method, index, opt) && (methodName(method) == name)) { - attributes = 0; + attributes = QObjectMemberAttribute; if (opt & QScriptEngine::SkipMethodsInEnumeration) attributes |= JSC::DontEnum; return true; diff --git a/src/script/bridge/qscriptqobject_p.h b/src/script/bridge/qscriptqobject_p.h index e1d4c8b..2e508ba 100644 --- a/src/script/bridge/qscriptqobject_p.h +++ b/src/script/bridge/qscriptqobject_p.h @@ -38,6 +38,11 @@ QT_BEGIN_NAMESPACE namespace QScript { +enum AttributeExtension { + // ### Make sure there's no conflict with JSC::Attribute + QObjectMemberAttribute = 1 << 12 +}; + class QObjectWrapperObject : public JSC::JSObject { public: |