summaryrefslogtreecommitdiffstats
path: root/tests/auto/qscriptvalue
diff options
context:
space:
mode:
authorKent Hansen <khansen@trolltech.com>2009-08-10 09:24:09 (GMT)
committerKent Hansen <khansen@trolltech.com>2009-08-10 09:24:09 (GMT)
commit692f13f4980cf13acef3164bfe2d89721e09a406 (patch)
tree02cba1ecf94926f858aa2629e58ac89a4f8fcb2b /tests/auto/qscriptvalue
parenta5cc9714deb37281d97f03f3eaf23ebd0be41f0f (diff)
downloadQt-692f13f4980cf13acef3164bfe2d89721e09a406.zip
Qt-692f13f4980cf13acef3164bfe2d89721e09a406.tar.gz
Qt-692f13f4980cf13acef3164bfe2d89721e09a406.tar.bz2
make property flags lookup work for properties in prototype chain
JSObject::getPropertyAttributes() does not follow the prototype chain, so we have to do it.
Diffstat (limited to 'tests/auto/qscriptvalue')
-rw-r--r--tests/auto/qscriptvalue/tst_qscriptvalue.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/auto/qscriptvalue/tst_qscriptvalue.cpp b/tests/auto/qscriptvalue/tst_qscriptvalue.cpp
index 2b48c30..56a91be 100644
--- a/tests/auto/qscriptvalue/tst_qscriptvalue.cpp
+++ b/tests/auto/qscriptvalue/tst_qscriptvalue.cpp
@@ -2077,6 +2077,14 @@ void tst_QScriptValue::getSetProperty()
object.setProperty("flagProperty", str, QScriptValue::UserRange);
QCOMPARE(object.propertyFlags("flagProperty"), QScriptValue::UserRange);
+ // flags of property in the prototype
+ {
+ QScriptValue object2 = eng.newObject();
+ object2.setPrototype(object);
+ QCOMPARE(object2.propertyFlags("flagProperty", QScriptValue::ResolveLocal), 0);
+ QCOMPARE(object2.propertyFlags("flagProperty"), QScriptValue::UserRange);
+ }
+
// using interned strings
QScriptString foo = eng.toStringHandle("foo");