RESOLVED FIXED 36603
[Qt] QScriptEngine doesn't give an access to global object
https://bugs.webkit.org/show_bug.cgi?id=36603
Summary [Qt] QScriptEngine doesn't give an access to global object
Jędrzej Nowacki
Reported 2010-03-25 08:01:27 PDT
The QScriptEngine should be used to retrieve a global object. http://qt.nokia.com/doc/4.6/qscriptengine.html#globalObject
Attachments
Fix v1 (4.62 KB, patch)
2010-03-25 08:09 PDT, Jędrzej Nowacki
no flags
Fix v2 (4.62 KB, patch)
2010-03-25 08:42 PDT, Jędrzej Nowacki
no flags
Jędrzej Nowacki
Comment 1 2010-03-25 08:09:46 PDT
Created attachment 51642 [details] Fix v1 New API
WebKit Review Bot
Comment 2 2010-03-25 08:11:34 PDT
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.
Jędrzej Nowacki
Comment 3 2010-03-25 08:42:47 PDT
Created attachment 51643 [details] Fix v2 Fix the space after comma...
Kent Hansen
Comment 4 2010-03-26 02:17:27 PDT
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.
WebKit Commit Bot
Comment 5 2010-03-28 03:03:56 PDT
Comment on attachment 51643 [details] Fix v2 Clearing flags on attachment: 51643 Committed r56686: <http://trac.webkit.org/changeset/56686>
WebKit Commit Bot
Comment 6 2010-03-28 03:04:01 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.