summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2009-07-16 12:19:59 (GMT)
committerOlivier Goffart <ogoffart@trolltech.com>2009-07-16 15:13:36 (GMT)
commitdbff4e318aaba904f0c7dbf7720954d3514c904a (patch)
treedc14a7b23cf56332c77a5cee3b080c186784733a /src
parent11ba9df469af573dbfdf0754569b623b5ea44542 (diff)
downloadQt-dbff4e318aaba904f0c7dbf7720954d3514c904a.zip
Qt-dbff4e318aaba904f0c7dbf7720954d3514c904a.tar.gz
Qt-dbff4e318aaba904f0c7dbf7720954d3514c904a.tar.bz2
We cant rely on property attributes from JavaScriptCore for the setter and getter
Diffstat (limited to 'src')
-rw-r--r--src/script/api/qscriptvalue.cpp6
-rw-r--r--src/script/bridge/qscriptobject.cpp10
-rw-r--r--src/script/bridge/qscriptobject_p.h2
3 files changed, 3 insertions, 15 deletions
diff --git a/src/script/api/qscriptvalue.cpp b/src/script/api/qscriptvalue.cpp
index 4d5361e..9fe9041 100644
--- a/src/script/api/qscriptvalue.cpp
+++ b/src/script/api/qscriptvalue.cpp
@@ -1821,13 +1821,13 @@ QScriptValue::PropertyFlags QScriptValue::propertyFlags(const QString &name,
result |= QScriptValue::SkipInEnumeration;
if (attribs & JSC::DontDelete)
result |= QScriptValue::Undeletable;
- if (attribs & JSC::Getter)
+ //We cannot rely on attribs JSC::Setter/Getter because they are not necesserly set by JSC (bug?)
+ if (attribs & JSC::Getter || !JSC::asObject(d->jscValue)->lookupGetter(exec, id).isUndefinedOrNull())
result |= QScriptValue::PropertyGetter;
- if (attribs & JSC::Setter)
+ if (attribs & JSC::Setter || !JSC::asObject(d->jscValue)->lookupSetter(exec, id).isUndefinedOrNull())
result |= QScriptValue::PropertySetter;
if (attribs & QScript::QObjectMemberAttribute)
result |= QScriptValue::QObjectMember;
-
result |= QScriptValue::PropertyFlag(attribs & QScriptValue::UserRange);
return result;
}
diff --git a/src/script/bridge/qscriptobject.cpp b/src/script/bridge/qscriptobject.cpp
index 5cf415a..da31579 100644
--- a/src/script/bridge/qscriptobject.cpp
+++ b/src/script/bridge/qscriptobject.cpp
@@ -144,16 +144,6 @@ bool QScriptObject::hasInstance(JSC::ExecState* exec, JSC::JSValue value, JSC::J
return d->delegate->hasInstance(this, exec, value, proto);
}
-JSC::JSValue QScriptObject::lookupGetter(JSC::ExecState*, const JSC::Identifier& propertyName)
-{
- Q_ASSERT_X(false, Q_FUNC_INFO, "implement me");
-}
-
-JSC::JSValue QScriptObject::lookupSetter(JSC::ExecState*, const JSC::Identifier& propertyName)
-{
- Q_ASSERT_X(false, Q_FUNC_INFO, "implement me");
-}
-
QScriptObjectPrototype::QScriptObjectPrototype(JSC::ExecState*, WTF::PassRefPtr<JSC::Structure> structure,
JSC::Structure* /*prototypeFunctionStructure*/)
: QScriptObject(structure)
diff --git a/src/script/bridge/qscriptobject_p.h b/src/script/bridge/qscriptobject_p.h
index a4ed94c..eaa89b2 100644
--- a/src/script/bridge/qscriptobject_p.h
+++ b/src/script/bridge/qscriptobject_p.h
@@ -59,8 +59,6 @@ public:
virtual bool getPropertyAttributes(JSC::ExecState*, const JSC::Identifier&,
unsigned&) const;
virtual void getPropertyNames(JSC::ExecState*, JSC::PropertyNameArray&);
- virtual JSC::JSValue lookupGetter(JSC::ExecState*, const JSC::Identifier& propertyName);
- virtual JSC::JSValue lookupSetter(JSC::ExecState*, const JSC::Identifier& propertyName);
virtual void mark();
virtual JSC::CallType getCallData(JSC::CallData&);
virtual JSC::ConstructType getConstructData(JSC::ConstructData&);