| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
-produced by git-split-ws
Change-Id: I1661678174c62971a7bbf4acb2890fdf590d2f3d
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
|
|
|
|
|
|
|
|
| |
-reduces QDoc warnings
-lists the classes in the C++ pages
Change-Id: I97db6b8bec4d44d1ee37ed2925ef7309cd0d420f
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
|\
| |
| |
| | |
Change-Id: Ib100dac4eccddf7a72382b7d1ead7d504a572347
|
| |\
| | |
| | |
| | | |
Change-Id: If3a1efe3888b872702d75e25d1943ff79d57e9c6
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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>
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
|/
|
|
|
|
| |
Change-Id: Ic4a2739c8caf2eac95e4a72d8d38cfb912d5fe2b
Reviewed-by: Akseli Salovaara <akseli.salovaara@digia.com>
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
|
|
|
|
|
| |
Change-Id: I7750e9af3eee8cee5be202094acd1d3efc4b52b0
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
|
|
|
|
|
| |
Change-Id: I22bba8d2d175d787913d1e2269ad2ca8ff762043
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Address the "###" comment.
When QScriptEngine::newQObject() is called with the option
PreferExistingWrapperObject, the resulting wrapper object is cached
by the engine, in case it will be needed later (e.g., by a subsequent
newQObject() call for the same QObject, with the same wrap options).
But if a QObject wrapper object is only referenced by the QtScript
internals (i.e., not reachable from the JSC stack/heap, or kept in a
QScriptValue), the wrapper should not be kept alive if the ownership
is ScriptOwnership, or if the ownership is AutoOwnership and the C++
object has no parent.
If the wrapper is marked in that case, it won't get collected, and
hence the C++ object will be kept alive, too. In practice, QtScript
appears to leak memory (the objects will only be destroyed when the
engine is destroyed).
Our copy of JSC doesn't have a concept of weak references; the
ClientData callback in the JSC markRoots() function (which causes
QScriptEnginePrivate::mark() to be called) was moved to the end. This
enables the wrapper and connection marking logic to determine whether
a wrapper can be safely discarded (if it hasn't been marked by JSC by
this point, it must be a weak reference).
Task-number: QTBUG-21993
Change-Id: I61f6aafc91f080b80d3f5859148e645b80d9b653
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
|
|
|
|
|
| |
Change-Id: I042d9bafe4f48a8cd23306f0864b6872776d0153
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
|
|
|
|
|
|
|
|
| |
JSC::JSValue::toString() expects that the input is valid.
Task-number: QTBUG-21896
Change-Id: I3199fcba94be5426cb3d193b57d16176daae83a0
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since objects in the scope chain have to be JSActivationObjects,
QScriptContext::setActivationObject() creates a proxy object that
should delegate access to the actual object.
This case was not handled in the toQObject() conversion function, so
for activation property access through evaluation (where the
this-object would be the proxy object, not the actual QObject), the
this-object conversion to QObject would fail, and the assert
"this-object must be a QObject" was triggered.
Task-number: QTBUG-21760
Change-Id: I40e868d9717ec76e0df18d5848c6ad99546ba34f
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
|
|
|
|
|
|
|
|
|
|
| |
This is the same as change 4822a821facbbf834c6aab5a8a7da2b3e43f09f7
in qtdeclarative. We always assume the js source code is
Utf8 encoded, as also on the C++ side.
Change-Id: I4f49484241718dfc4a2bb39a674b54df46aa8c8d
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
|
|
|
|
|
|
|
| |
QVariant::Type casts are not necessary in Qt5.
Change-Id: I43833e869379db8937839612dfb6162f878870cb
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
|
|
|
|
|
|
|
|
|
|
| |
This operation should be a no-op anyway, since at this point in time,
the fromAscii and toAscii functions simply call their fromLatin1 and
toLatin1 counterparts.
Task-number: QTBUG-21872
Change-Id: I4f44512856ea99112d8eb6d341d6058c1fc439dc
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
|
|
|
|
|
| |
Change-Id: I98d4826fcc2e3687d45edfccca956891ca0466cf
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
|
|
|
|
|
|
|
|
|
| |
Currently QMetaType::UnknownType, instead of QMetaType::Void, is used
to check if a type id is valid or not.
Change-Id: Ib185e3f28ef675c57d9b8b0d2eb4e4f124999131
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
|
|
|
|
|
|
|
|
|
|
| |
QMetaMethod::methodSignature() should be used instead, and it returns
a QByteArray.
Change-Id: I81150e238dab7eda26d0466ac407a4f3ba79a7c7
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
|
|
|
|
|
|
|
|
|
|
|
| |
The behaviour has been inconsistent
since ae85d7c965e7d50404c056a77c73bfe00267fa12 in qtbase
which added special handling of QObjects to QVariant.
Change-Id: Ie75faa3cc3387cff8894cdba025c93f2cc2ea491
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
|
|
|
|
|
| |
Change-Id: I0d1036eb75de9fcd2663ec5476d3b13edb2e264e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
|
|
|
|
|
|
|
|
|
|
| |
QDoc now has support for Doxygen style commands for italics, bold
and list items. This change applies that change in QDoc to the
actual documentation.
Task-number: QTBUG-24578
Change-Id: I7733d18ce1e3459ef618802060d176c9211d3d5f
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
|
|
|
|
|
|
|
| |
Fixes build after I0b4df4c99600cacbaafbf0bc4270cd4978600956
Change-Id: If85e4ee8c2fd43baa24cf8608ad2f81ea112ae7c
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
|
|
|
|
|
|
|
|
|
| |
Picked from 4.8 commit 3826203f744a2147bebf5f088de0d524156f59fd
Task-number: QTBUG-8323
Change-Id: I360f7592cb6a0906ab7bf402963109b7aa1edebe
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
|
|
|
|
|
| |
Change-Id: Ie28cc00899abaa3f42a0f43ed199e3c14d45df3e
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
|
|
|
|
|
|
|
|
|
|
| |
As in the past, to avoid rewriting various autotests that contain
line-number information, an extra blank line has been inserted at the
end of the license text to ensure that this commit does not change the
total number of lines in the license header.
Change-Id: I752b02a8155143626d22bd86082177550bd1cfb4
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
|
|
|
|
|
|
|
| |
Replace Nokia contact email address with Qt Project website.
Change-Id: I6597406c8041227410e672b86a567e1161a0ab59
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
|
|
|
|
|
| |
Change-Id: Ie234485162d162935e96adec388361b771342c86
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
1) The special case for LastType (QVariant) should be done before
the general conversion, to avoid calling convertValue() with
targetType == -1 (which is useless and causes a qWarning).
2) moc is about to be changed to use QMetaType::QVariant instead of
QVariant::LastType to represent the QVariant type. But to keep the
CI happy in the transition period we have to check for both. The
LastType check will be removed once qtbase has been updated.
3) Get rid of the variantFromValue function in qscriptqobject. It
was identical to QScriptEnginePrivate::jscValueToVariant.
Change-Id: Ie418facc06c6c7308bc60a3ff66b9a78b109d3d3
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
|
|
|
|
|
| |
Change-Id: I323b788326712d95f6213ab8a68c18cfe28b7c76
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
|
|
|
|
|
|
|
|
| |
QScriptContextInfoPrivate inherits QSharedData, no need
to assign ref.
Change-Id: I36ebf64952517b218a3fa9eac5ce1a794988acaa
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
|
|
|
|
|
|
|
|
|
| |
The implicit casts will be unavailable in the near future.
Change-Id: I7305bed90fdcd50e910b207dc41caa8d34467c54
Reviewed-on: http://codereview.qt-project.org/6352
Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
|
|
|
|
|
|
|
|
|
| |
Task-number: QTBUG-17255
Change-Id: Id4685f2531af1113947c55184870e3b3cd874c32
Reviewed-on: http://codereview.qt.nokia.com/2355
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
|
|
|
|
|
|
|
|
|
|
| |
There is no need to do reference counting by hand. QSharedData class
provide good encapsulation of reference counter.
Change-Id: I2611a51c2fa6673ccca69fe8ff83741ffac06ee9
Reviewed-on: http://codereview.qt.nokia.com/1378
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Olivier Goffart <olivier.goffart@nokia.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
None of these classes are POD, so they don't need to use the POD
version of QAtomicInt.
Change-Id: Ic7b134c85c4b314560ae79250e05159ffde74dfe
Merge-request: 1
Reviewed-by: Jedrzej Nowacki <jedrzej.nowacki@nokia.com>
Reviewed-on: http://codereview.qt.nokia.com/1377
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Nierob <jedrzej.nowacki@nokia.com>
|
| |
|
|
|
|
|
| |
Reviewed-by: Kai Koehne
(cherry picked from commit 0b877b48dc990ca6bb806be668d60f6ced470de2)
|