diff options
author | Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org> | 2011-02-08 21:19:32 (GMT) |
---|---|---|
committer | Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org> | 2011-02-09 11:50:43 (GMT) |
commit | e8abc416f07f74dd12e75b61be0aeac297b7a1f8 (patch) | |
tree | 46147a4346490d166ba3d0924a5508c3002ce675 /tests/auto/qscriptengine/tst_qscriptengine.cpp | |
parent | ebfbc5c03f689304fdd250fba46bbbfffb9af254 (diff) | |
download | Qt-e8abc416f07f74dd12e75b61be0aeac297b7a1f8.zip Qt-e8abc416f07f74dd12e75b61be0aeac297b7a1f8.tar.gz Qt-e8abc416f07f74dd12e75b61be0aeac297b7a1f8.tar.bz2 |
QScriptEngine: fix property flags for native functions
Fix the tests and implementation to conform with ECMA-262, property
"prototype" of the function and "constructor" of the prototype object
associated with the function.
Reviewed-by: Kent Hansen
Diffstat (limited to 'tests/auto/qscriptengine/tst_qscriptengine.cpp')
-rw-r--r-- | tests/auto/qscriptengine/tst_qscriptengine.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/tests/auto/qscriptengine/tst_qscriptengine.cpp b/tests/auto/qscriptengine/tst_qscriptengine.cpp index 2f7e0b5..b609d8c 100644 --- a/tests/auto/qscriptengine/tst_qscriptengine.cpp +++ b/tests/auto/qscriptengine/tst_qscriptengine.cpp @@ -344,8 +344,8 @@ void tst_QScriptEngine::newFunction() QScriptValue prot = fun.property("prototype", QScriptValue::ResolveLocal); QVERIFY(prot.isObject()); QVERIFY(prot.property("constructor").strictlyEquals(fun)); - QCOMPARE(fun.propertyFlags("prototype"), QScriptValue::Undeletable); - QCOMPARE(prot.propertyFlags("constructor"), QScriptValue::Undeletable | QScriptValue::SkipInEnumeration); + QCOMPARE(fun.propertyFlags("prototype"), QScriptValue::Undeletable | QScriptValue::SkipInEnumeration); + QCOMPARE(prot.propertyFlags("constructor"), QScriptValue::SkipInEnumeration); } // prototype should be Function.prototype QCOMPARE(fun.prototype().isValid(), true); @@ -369,8 +369,8 @@ void tst_QScriptEngine::newFunctionWithArg() QScriptValue prot = fun.property("prototype", QScriptValue::ResolveLocal); QVERIFY(prot.isObject()); QVERIFY(prot.property("constructor").strictlyEquals(fun)); - QCOMPARE(fun.propertyFlags("prototype"), QScriptValue::Undeletable); - QCOMPARE(prot.propertyFlags("constructor"), QScriptValue::Undeletable | QScriptValue::SkipInEnumeration); + QCOMPARE(fun.propertyFlags("prototype"), QScriptValue::Undeletable | QScriptValue::SkipInEnumeration); + QCOMPARE(prot.propertyFlags("constructor"), QScriptValue::SkipInEnumeration); } // prototype should be Function.prototype QCOMPARE(fun.prototype().isValid(), true); @@ -397,10 +397,9 @@ void tst_QScriptEngine::newFunctionWithProto() QCOMPARE(fun.prototype().strictlyEquals(eng.evaluate("Function.prototype")), true); // public prototype should be the one we passed QCOMPARE(fun.property("prototype").strictlyEquals(proto), true); - QCOMPARE(fun.propertyFlags("prototype"), QScriptValue::Undeletable); + QCOMPARE(fun.propertyFlags("prototype"), QScriptValue::Undeletable | QScriptValue::SkipInEnumeration); QCOMPARE(proto.property("constructor").strictlyEquals(fun), true); - QCOMPARE(proto.propertyFlags("constructor"), - QScriptValue::Undeletable | QScriptValue::SkipInEnumeration); + QCOMPARE(proto.propertyFlags("constructor"), QScriptValue::SkipInEnumeration); QCOMPARE(fun.call().isNull(), true); QCOMPARE(fun.construct().isObject(), true); |