diff options
Diffstat (limited to 'src/script')
-rw-r--r-- | src/script/api/qscriptvalue.cpp | 2 | ||||
-rw-r--r-- | src/script/bridge/qscriptqobject.cpp | 9 | ||||
-rw-r--r-- | src/script/bridge/qscriptqobject_p.h | 5 |
3 files changed, 12 insertions, 4 deletions
diff --git a/src/script/api/qscriptvalue.cpp b/src/script/api/qscriptvalue.cpp index 6ff44a0..4d8f18a 100644 --- a/src/script/api/qscriptvalue.cpp +++ b/src/script/api/qscriptvalue.cpp @@ -1795,6 +1795,8 @@ QScriptValue::PropertyFlags QScriptValue::propertyFlags(const QString &name, result |= QScriptValue::PropertyGetter; if (attribs & JSC::Setter) result |= QScriptValue::PropertySetter; + if (attribs & QScript::QObjectMemberAttribute) + result |= QScriptValue::QObjectMember; result |= QScriptValue::PropertyFlag(attribs & QScriptValue::UserRange); return result; 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: |