diff options
author | Kent Hansen <kent.hansen@nokia.com> | 2012-01-17 15:23:01 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-02-02 08:10:24 +0100 |
commit | 54c51c89e21800b3a455127b3c19a3c5b30ee319 (patch) | |
tree | 9781a998567abf4513919cc08e928a3df03eecbf /tests/auto/declarative/qjsvalue/tst_qjsvalue.cpp | |
parent | ed84a6ee63ac7a53f37efad3eb4a7e4eaa047242 (diff) |
Remove QJSValue::propertyFlags() function
Rationale: The API is incomplete. There is no way to set/update the
flags; adding a third (optional) argument to setProperty() is ugly.
If necessary, a QJSPropertyDescriptor API should be added, to enable
complete setting/querying of properties.
The flags were moved to QJSValuePrivate, and the propertyFlags()
implementation kept, because there is one place the read-only flag
is checked internally (in qv8typewrapper).
Task-number: QTBUG-23604
Change-Id: I089dce28dbda428662aac7c8d1536987fe6d855c
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
Diffstat (limited to 'tests/auto/declarative/qjsvalue/tst_qjsvalue.cpp')
-rw-r--r-- | tests/auto/declarative/qjsvalue/tst_qjsvalue.cpp | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/tests/auto/declarative/qjsvalue/tst_qjsvalue.cpp b/tests/auto/declarative/qjsvalue/tst_qjsvalue.cpp index e478dc3fd3..1d7ae1ff47 100644 --- a/tests/auto/declarative/qjsvalue/tst_qjsvalue.cpp +++ b/tests/auto/declarative/qjsvalue/tst_qjsvalue.cpp @@ -3665,32 +3665,4 @@ void tst_QJSValue::nestedObjectToVariant() QCOMPARE(o.toVariant(), expected); } -void tst_QJSValue::propertyFlags_data() -{ - QTest::addColumn<QString>("program"); - QTest::addColumn<uint>("expected"); - - QTest::newRow("nothing") << "" << 0u; -#if 0 // FIXME: No getter/setter API - QTest::newRow("getter") << "o.__defineGetter__('prop', function() { return 'blah' } );\n" << uint(QJSValue::PropertyGetter); - QTest::newRow("setter") << "o.__defineSetter__('prop', function(a) { this.setted_prop2 = a; } );\n" << uint(QJSValue::PropertySetter); - QTest::newRow("getterSetter") << "o.__defineGetter__('prop', function() { return 'ploup' } );\n" - "o.__defineSetter__('prop', function(a) { this.setted_prop3 = a; } );\n" << uint(QJSValue::PropertySetter|QJSValue::PropertyGetter); -#endif - QTest::newRow("nothing2") << "o.prop = 'nothing'" << 0u; -} - -void tst_QJSValue::propertyFlags() -{ - QFETCH(QString, program); - QFETCH(uint, expected); - QJSEngine eng; - eng.evaluate("o = new Object;"); - eng.evaluate(program); - QJSValue o = eng.evaluate("o"); - - QCOMPARE(uint(o.propertyFlags("prop")), expected); -} - - QTEST_MAIN(tst_QJSValue) |