Example: bool foo() { QScriptEngine engine; return engine.evaluate("1").isObject(); } Function foo() returns true. It seems that isObject() function call automatically converts a primitive value to a corespondent object wrapper. Issue is visible only if the value is returned as result of evaluate call. This: bool foo() { return QScriptValue(1).isObject(); } works correctly.
Created attachment 49493 [details] Fix v1
Proposed patch depends on 34850
Looks good, except for the misspelling in the doc for refineJSValue ("retruns"), and I think it should say "Refines the state of this ... and returns the new state". No reason to use different wording in the description when the function already has a descriptive name.
Created attachment 49500 [details] Fix v2 (In reply to comment #3) > Looks good, except for the misspelling in the doc for refineJSValue > ("retruns"), and I think it should say "Refines the state of this ... and > returns the new state". No reason to use different wording in the description > when the function already has a descriptive name. Done. As previous patch this one is dependent on bug 34850, that means it cant be applied right now. I have tried apply it on trunk; ~/dev/WebKit$ git apply -v /tmp/isObjectV2.diff Checking patch JavaScriptCore/ChangeLog... Checking patch JavaScriptCore/qt/api/qscriptvalue_p.h... Checking patch JavaScriptCore/qt/tests/qscriptvalue/tst_qscriptvalue_generated.cpp... error: while searching for: { QFETCH(bool, expected); QCOMPARE(value.isObject(), expected); } DEFINE_TEST_FUNCTION(isObject) void tst_QScriptValue::toString_initData() { QTest::addColumn<QString>("expected"); error: patch failed: JavaScriptCore/qt/tests/qscriptvalue/tst_qscriptvalue_generated.cpp:552 error: JavaScriptCore/qt/tests/qscriptvalue/tst_qscriptvalue_generated.cpp: patch does not apply
Created attachment 49903 [details] Fix v3 Changes: - refineJSValue was renamed to refinedJSValue - fix typo in a comment.
Comment on attachment 49903 [details] Fix v3 Clearing flags on attachment: 49903 Committed r55502: <http://trac.webkit.org/changeset/55502>
All reviewed patches have been landed. Closing bug.