The QScriptEngine should be used to retrieve a global object. http://qt.nokia.com/doc/4.6/qscriptengine.html#globalObject
Created attachment 51642 [details] Fix v1 New API
Attachment 51642 [details] did not pass style-queue: Failed to run "WebKitTools/Scripts/check-webkit-style" exit_code: 1 WARNING: File exempt from style guide. Skipping: "JavaScriptCore/qt/api/qscriptengine_p.cpp" JavaScriptCore/qt/tests/qscriptengine/tst_qscriptengine.cpp:63: Missing space after , [whitespace/comma] [3] WARNING: File exempt from style guide. Skipping: "JavaScriptCore/qt/api/qscriptengine_p.h" WARNING: File exempt from style guide. Skipping: "JavaScriptCore/qt/api/qscriptengine.cpp" WARNING: File exempt from style guide. Skipping: "JavaScriptCore/qt/api/qscriptengine.h" Total errors found: 1 in 6 files If any of these errors are false positives, please file a bug against check-webkit-style.
Created attachment 51643 [details] Fix v2 Fix the space after comma...
Comment on attachment 51643 [details] Fix v2 > + QScriptEngine API was enriched by globalObject() method > + which give an access to the global object. Grammar nitpick: "gives access to..." > +void tst_QScriptEngine::globalObject() > +{ > + QScriptEngine engine; > + QScriptValue global = engine.globalObject(); > + QScriptValue self = engine.evaluate("this"); > + QVERIFY(global.isObject()); > + QVERIFY(engine.globalObject().equals(engine.evaluate("this"))); > + QEXPECT_FAIL("", "strictlyEquals is broken - bug 36600 in bugs.webkit.org", Continue); > + QVERIFY(engine.globalObject().strictlyEquals(self)); > +} We're starting to need property() and setProperty() now; then this test could verify that global variables introduced by evaluate() are reflected by global.property(), and global.setProperty() calls are reflected by evaluate(), since that is a rather crucial feature. Remember to update this test once that API is added. The rest of the patch looks good.
Comment on attachment 51643 [details] Fix v2 Clearing flags on attachment: 51643 Committed r56686: <http://trac.webkit.org/changeset/56686>
All reviewed patches have been landed. Closing bug.