summaryrefslogtreecommitdiff
path: root/src/script
Commit message (Collapse)AuthorAgeFilesLines
* Fix recursive calling of QScriptProgramv5.3.0-rc1v5.3.0-beta1v5.3.0release5.3.0Lars Knoll2014-03-111-1/+1
| | | | | | | | | | | | The first time a QScriptProgram is evaluated, it gets compiled and then executed. If the execution would somehow trigger another evaluation of the script program, it would run into the compile stage again (even though it already was compiled), and then trigger and assertion in debug mode (or leak memory in release builds). Task-number: QTBUG-37317 Change-Id: I83e7efd5f238d021e200258826e2e4a9520c3a7d Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Doc: Updated url variable in qdocconf files.Jerome Pasion2013-11-061-0/+1
| | | | | | | | | | | | | | | In 5.2, the HTML output is in a flatter structure and when they are hosted in qt-project.org/doc, the documentation will be found at http://qt-project.org/doc/qt-$QT_VER The url variable is used by projects outside of Qt 5 which need to link to Qt 5 documentation, such as Qt Creator. Task-number: QTBUG-34584 Change-Id: I77ed98ade58cdd4c6f5c365682993f1be3f3e958 Reviewed-by: Topi Reiniö <topi.reinio@digia.com> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com> Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com>
* use private linkage where possibleOswald Buddenhagen2013-11-011-1/+1
| | | | | Change-Id: I3c0a1ae83615120f9a0cf8202d4facf915decde2 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* WS fix in qscriptcontext.cppv5.2.0-beta1Jerome Pasion2013-10-081-1/+1
| | | | | | | -produced by git-split-ws Change-Id: I1661678174c62971a7bbf4acb2890fdf590d2f3d Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Doc: Adding "\inmodule QtScript" to Qt Script classes.Jerome Pasion2013-10-0812-9/+13
| | | | | | | | -reduces QDoc warnings -lists the classes in the C++ pages Change-Id: I97db6b8bec4d44d1ee37ed2925ef7309cd0d420f Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* Remove QtAlgorithms usage from QtScript.Friedemann Kleint2013-09-261-2/+3
| | | | | | | | | QtAlgorithms is getting deprecated, see http://www.mail-archive.com/development@qt-project.org/msg01603.html Change-Id: If4dc8f69fd75315390a4850be732715064f5fdd8 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Merge remote-tracking branch 'origin/stable' into devSergio Ahumada2013-09-061-0/+2
|\ | | | | | | Change-Id: I8352e99c9886882115b5808e6903ce09645949ba
| * exclude WebKit/JavaScriptCore from lupdate scanOswald Buddenhagen2013-09-021-0/+2
| | | | | | | | | | | | | | | | there is no point in scanning it, and it's incredibly slow. Change-Id: Ife2fe879b8285f18bb714804c532a68ed64f84d8 Reviewed-by: hjk <hjk121@nokiamail.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* | QtScript: Fix header guardTobias Hunger2013-08-291-1/+1
| | | | | | | | | | Change-Id: Ib8db978f3f5414fccfcf772f7fa9b2b7ddbc761c Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
* | Doc: Setting \qtvariable in module page.Jerome Pasion2013-08-021-1/+1
| | | | | | | | | | | | | | \qtvariable indicates the QT variable needed in .pro files. Change-Id: I018b00a19c3bbd2aa4bf34712f414569dd50775b Reviewed-by: Martin Smith <martin.smith@digia.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-07-112-10/+0
|\ \ | |/ | | | | Change-Id: I4231685b78a7886928efe191aa7f09bb8a50e81e
| * Remove references to obsolete QSA-product.Friedemann Kleint2013-07-112-10/+0
| | | | | | | | | | Change-Id: I2a89644fa7440b0ef113d956affd745716607aee Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* | Doc: Setting navigation variables for Qt Script and Qt Script ToolsJerome Pasion2013-06-261-1/+4
|/ | | | | | | -also enabled linking to 'qtdoc' for the homepage link Change-Id: I74781effabac4c73c8a286347e5aa0821d5931f0 Reviewed-by: Martin Smith <martin.smith@digia.com>
* Doc: Removed landing page from "technology-apis" group.Jerome Pasion2013-05-241-1/+0
| | | | | | | The group in qtdoc was replaced by the new overviews in qtdoc. Change-Id: I55518f8cf581a4de394863e359a3a848fc9842b0 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Doc: Fix module names in .qdocconfTopi Reinio2013-04-261-11/+11
| | | | | | | | | Use CamelCase for module name(s) used in in .qdocconf - this is required as qdoc will generate visible output (tags in example manifest files) based on these names. Change-Id: If9f79e73d823270d8ecb652d1b7b9d9d44f9562e Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Remove deprecation of QScriptContextInfo::columnNumber().Friedemann Kleint2013-03-071-3/+1
| | | | | | | | The module is done, there is no need to deprecate functions. Fix deprecation warning occurring in build. Change-Id: I01fb9d91ccc3cb4d6fb4e2134960436f18376e3e Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-02-181-1/+1
|\ | | | | | | Change-Id: Idae7dca76362ba04d0d85dec27f9d9bbd7560a9a
| * substitute fixed version numbers in qdocconf files with variablesOswald Buddenhagen2013-02-061-1/+1
| | | | | | | | | | Change-Id: I9091efd330ce903d2f78d7ecf0ca718a001a00df Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-02-0515-101/+100
|\ \ | |/ | | | | Change-Id: Ib100dac4eccddf7a72382b7d1ead7d504a572347
| * Merge branch 'release' into stableSergio Ahumada2013-01-314-10/+9
| |\ | | | | | | | | | Change-Id: If3a1efe3888b872702d75e25d1943ff79d57e9c6
| | * Fix QtScript crash on 64bit with JIT.v5.0.1Friedemann Kleint2013-01-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During back-trace generation we calculate a code offset towards JIT generated code. Using JITCode::offsetOf() will crash/assert if the offset doesn't fit into 32 bits, because the generated code can only encode relative offsets in 32-bits and not 64-bits. However in this context - backtrace generation - we just want to calculate the offset and are not interested in this architectural limitation, therefore we can just calculate the offset ourselves using the fully sized uintptr_t. Initial-patch-by: Simon.Hausmann@digia.com Task-number: QTCREATORBUG-8629 Task-number: QTBUG-23463 Change-Id: I0efadd5ed20855409122e1fcc9236fdfbc4f62a4 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
| | * Doc: Modularized Qt Script Tools documentation.Jerome Pasion2013-01-243-8/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -moved content from qtdoc -moved snippets to src/scripttools -enabled 'make docs' -edited QScriptEngineDebugger with the proper module identifier -created two way links from Qt Script to Qt Script Tools Change-Id: I83a76278969528dcb1ecbca4acc8563fe9390978 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com> Reviewed-by: Geir Vattekar <geir.vattekar@digia.com>
| | * doc: Fix namespace version to 5.0.1 for qhp documentationSergio Ahumada2013-01-121-1/+1
| | | | | | | | | | | | | | | Change-Id: I7f7eec61e442831b82aed579dd1526a12ebd71c8 Reviewed-by: hjk <qthjk@ovi.com>
| * | Doc: Fix module name formatSze Howe Koh2013-01-2612-91/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Follow the conventions at http://qt-project.org/wiki/Spelling_Module_Names_in_Qt_Documentation QtScript -> Qt Script QtScriptTools -> Qt Script Tools Change-Id: Icf6b2ea3829247475f8902334b615f9a9206cc51 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* | | Remove QT_{BEGIN,END}_HEADER macro usageSergio Ahumada2013-01-2814-56/+0
|/ / | | | | | | | | | | | | | | | | The macro was made empty in qtbase/ba3dc5f3b56d1fab6fe37fe7ae08096d7dc68bcb and is no longer necessary or used. Discussed-on: http://lists.qt-project.org/pipermail/development/2013-January/009284.html Change-Id: I7fed9ff47fd84f6cf2b418658a1ee3e7130539ac Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* | Update copyright year in Digia's license headersSergio Ahumada2013-01-1088-90/+90
|/ | | | | | Change-Id: Ic4a2739c8caf2eac95e4a72d8d38cfb912d5fe2b Reviewed-by: Akseli Salovaara <akseli.salovaara@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Doc: Replace outdated macroChristian Stenger2012-12-071-2/+2
| | | | | Change-Id: I7750e9af3eee8cee5be202094acd1d3efc4b52b0 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* QtScript: Fix link to Qt Linguist Manual.David Schulz2012-12-042-2/+2
| | | | | Change-Id: I543eee28fa1f72d2b9371b39906fd3f0219cc000 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
* remove symbian vestigesOswald Buddenhagen2012-12-041-14/+0
| | | | | Change-Id: Id4cf97c6ca3b9d4335daf4f32842fb07f51c557e Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Doc: Changed link in qdocconf file to point to landing page.Jerome Pasion2012-12-031-2/+3
| | | | | | | -affects the QCH file. Change-Id: I05d38a4bdeca359ff6f58c434e6d61198487d2a5 Reviewed-by: Kai Koehne <kai.koehne@digia.com>
* Fix up the Qt Script docsLars Knoll2012-11-293-92/+48
| | | | | Change-Id: I20e6d2fca4faef1586b5da3ff494fb8196645f34 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Change copyright holder from Nokia to DigiaSergio Ahumada2012-11-271-1/+1
| | | | | Change-Id: I3a9c2dbe0262d5139314b7447adce8bbb599f9b8 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Updated the module overviewLars Knoll2012-11-271-26/+36
| | | | | | | | | | | Mention the JS functionality in Qt Qml, and that Qt Qml can be an option for the commercial customers that can't use LGPL'ed code. Change-Id: Ibbefa160711820fb6235aa312a375e1b1b9d0b16 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com> Reviewed-by: Sami Makkonen <sami.makkonen@digia.com> Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* Doc: Removed the HTML template from the .qdocconf filesJerome Pasion2012-10-291-1/+0
| | | | | | | -qt-module-defaults.qdocconf already contains the HTML template. Change-Id: I8f4ce0d4f7b9a5a713f8b6ad81828c00f3607b27 Reviewed-by: Martin Smith <martin.smith@digia.com>
* Update docs after modularization of docsTor Arne Vestbø2012-10-112-5/+4
| | | | | | | | | The global files now live in qtbase only, and are made available to the other modules via the $QT_INSTALL_DOCS variable. Change-Id: Ia10e092bb6780d379dacafe0a10a6b78ce7f9a6c Reviewed-by: Martin Smith <martin.smith@digia.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Doc: Updated include statements to point to the doc/global templatesVenugopal Shivashankar2012-09-281-2/+2
| | | | | Change-Id: Ifdf1bb4b4bbb77cb8f5d5d4a3a6108763b672c57 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Fix header guardLars Knoll2012-09-251-0/+1
| | | | | Change-Id: I22bba8d2d175d787913d1e2269ad2ca8ff762043 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Doc: Changed title of Qt Script module pageGeir Vattekar2012-09-241-1/+1
| | | | | Change-Id: I9d4f8b6b3af98bb8cc7a4b773a5c663691e5476b Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-2489-402/+402
| | | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: Id0b72b8c895b0eab04a740bf83859c9b646dd911 Reviewed-by: Janne Anttila <janne.anttila@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* centralize load(qt_build_config)s in .qmake.confOswald Buddenhagen2012-09-111-2/+0
| | | | | Change-Id: I1d95fe8089d8384563654630b9f4b201245887b9 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* Capture full backtrace when a native function calls back into JSKent Hansen2012-08-221-2/+10
| | | | | | | | | | | | | | | | | | | | | | Commit df0ec196031d33850324dc5eeed2d71f61413885 assumed that JSC's Interpreter::throwException function is called exactly once when an exception occurs. That's wrong. If there is a native call inbetween two JS calls on the stack, the call stack will be unwound to the point of the native call frame, and throwException will return. After the native (C) call frame has been unwound, throwException will be called again to unwind remaining JS call frames, and so on. This was causing QtScript to discard the backtrace belonging to the inner-most JS frames; the backtrace would be regenerated from a partially unwound state. Fix this by ignoring subsequent calls to the uncaughtException() callback once a backtrace has been captured; the backtrace is already cleared before each evaluation is started. Task-number: QTBUG-26889 Change-Id: I03e1d60fbac5e592cff1dd5ef70f397cf94454ae Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com>
* Remove the use of the QWidgetStar metatypeid.Stephen Kelly2012-08-152-12/+7
| | | | | | | | | | It is to be removed, and is obsoleted by QMetaType::PointerToQObject. By using QMetaType::PointerToQObject, we also gain the feature that all pointers to types derived from QObject return true for QScriptValue::isQObject(). Change-Id: I18392b5b6cde3a45d060c37612d987a5cf8e8f18 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Make QScriptEngine::uncaughtExceptionBacktrace() work againKent Hansen2012-08-154-21/+80
| | | | | | | | | | | This function has been broken since Qt 4.6 (when the JavaScriptCore- based back-end was introduced). Fix it by introducing a callback in JSC that allows us to capture the stack when an uncaught exception occurs. Task-number: QTBUG-6139 Change-Id: I4a829323c9fb0c8b2f16a2e5d6f0aeb13cc32561 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Add default conversion for types long and ulongKent Hansen2012-08-142-0/+30
| | | | | | | | | | | | | | Such conversion is not guaranteed to be lossless on all platforms, but it's still reasonable to support these types by default. JSC::JSValue already had constructors for them. The type matching / overload resolution in the QObject binding already handled long and ulong, but the value conversion itself was missing, for some reason. Task-number: QTBUG-2124 Change-Id: I14ff29a8e949403234b7659c0aca8b48bcdbda0e Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Suppress JavaScriptCore 'LEAK' messages at application exitKent Hansen2012-08-131-0/+3
| | | | | | | | | | | | | | | | | | In debug mode, if a QScriptEngine was never destroyed, JavaScriptCore would output a message like LEAK: 120 Structure on stderr at exit. This is not terribly helpful to users; also, it's not common for Qt classes to produce such output. Since JavaScriptCore's only usage of the logging facility is for reporting these "leaks", we can disable logging altogether. Task-number: QTBUG-18201 Change-Id: Id598bd1f48129d821a954cc49d8e3ab715d78426 Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* follow rename of qt_module_config.prf to qt_module.prfOswald Buddenhagen2012-08-111-1/+1
| | | | | Change-Id: Ied05f26ee735d63a89a5bcf9b7afbeaa8e70809c Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* Fix GC issues related to QObject connections and ownershipKent Hansen2012-08-094-38/+108
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue 1: Even if a sender object was only weakly referenced, the connection's slot function would still get marked. If the slot was a closure, its scope could hold a reference to the sender object, so by marking the closure, the sender would get marked, too - even if there were no other references to the closure outside of the QObject connection structure. This would cause the sender object to stay alive, rather than being garbage-collected (i.e., it leaked). Issue 2: It's possible that a closure used as a slot in a connection for one QObject holds the only reference to another QObject that has connections of its own. In that case, if the first object is explicitly referenced, the second object (and its connections) should get marked. But depending on the order in which the connections were marked, the second object might get treated incorrectly. This commit solves both issues by introducing an iterative scheme for marking connections. The first pass marks only connections whose sender object is referenced elsewhere in the JS environment. The second pass marks connections whose sender object is referenced by slots of the connections marked in the first pass. And so on, until no more connections should be marked. At that point, any remaining unmarked connections are effectively dead (belonging to QObjects that can be reclaimed by the GC). Task-number: QTBUG-26590 Change-Id: I50aa66f7fe407a6827b6f2a12e027275a2fb4655 Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com>
* Add qtscriptglobal.h for the qtscript.git module EXPORT macrosThiago Macieira2012-08-099-1/+79
| | | | | | | | No library other than the core libraries should depend on their export macros being in qglobal.h. Change-Id: I6ded70813f6296ca5aa1d7d3cdb38503a5538424 Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* QScriptEngine::pushContext(): Don't inherit parent context's scopeKent Hansen2012-08-083-22/+9
| | | | | | | | | | | | | | This was a regression introduced in Qt 4.6 (JavaScriptCore-based backend). pushContext() should always create a context with a "clean" scope (only the Global Object and the context's own activation object should be in the scope chain). The scope chain API is internal, but the wrong behavior could still be observed e.g. through QScriptEngine::evaluate(). Task-number: QTBUG-18188 Change-Id: I138dabc665d7275fb85d3b5e1b473d56096a989e Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Fix QScriptContextInfo::functionMetaIndex() for overloaded slotsKent Hansen2012-07-133-60/+130
| | | | | | | | | | | | | | | | | | This was a regression against the pre-JavaScriptCore implementation, where we used to store the selected method index as an internal member of the QScriptContext(Private). But in the JSC-based implementation, QScriptContext is implemented as a pointer to a JSC::CallFrame, and there are no unused fields in CallFrame where the method index can be stashed. Refactor the Qt method call logic so that the method selection is separate from the actual processing of the target method. This way, QScriptContextInfo can compute the method index the same way that the actual method call did. Task-number: QTBUG-6133 Change-Id: I619fa8b91542d0b6ab5a44b00266cc0705c95823 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>