Commit Graph

1267 Commits

Author SHA1 Message Date
Simon Hausmann 24d0266ee4 Merge remote-tracking branch 'origin/5.9' into HEAD
Conflicts:
	src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.cpp
	src/qml/jit/qv4assembler.cpp
	src/qml/jit/qv4assembler_p.h
	src/qml/jit/qv4isel_masm.cpp
	src/qml/jsruntime/qv4context.cpp
	src/qml/jsruntime/qv4context_p.h
	src/qml/jsruntime/qv4engine.cpp
	src/qml/jsruntime/qv4vme_moth.cpp
	src/qml/memory/qv4mmdefs_p.h

Change-Id: I9966750b7cd9106b78e4c4779f12b95a481cca40
2017-03-23 14:43:46 +01:00
Simon Hausmann 5bd11b5a8c Avoid an extra stat() on the source .qml file when loading cache
For timestamp comparison it is not necessary to create another
QFileInfo() object and call exists() and lastModified(), when we can
pass that information through from the type loader.

Change-Id: I225cd36e672f1f390bddb4e6ebfafa3fc1269795
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-03-22 12:17:45 +00:00
Ulf Hermann db51441a95 Allow info messages in debug message service
QtInfoMsg > QtFatalMsg, and it was added later.

Change-Id: If565ebd491aba57b162c7f8ddb5534e416f7ab44
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-03-22 09:01:24 +00:00
Thiago Macieira 755250f2f9 QHash: use the public functions to set the global hash seed
Task-number: QTBUG-47566
Change-Id: I4a7dc1fe14154695b968fffd14abd2e3189c6ad2
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-03-16 05:47:54 +00:00
Robin Burchell 34ff6c40c1 qml: Override the new Object::instanceOf hook to allow QML type checking
[ChangeLog][QtQml] The instanceof keyword in JavaScript has been
extended to work on QML types and instances. This means that you are now
able to use it to verify that a var is indeed the type you expect (e.g.
someVar instanceof Rectangle).

Note that one of the added tests revealed a slight shortcoming in the
QML type system (QTBUG-58477). For now, we should keep consistency and
work to address the problem universally in the future.

Change-Id: I7d9bf9b64cfd037908de1ae51b01065eacb95abe
Task-number: QTBUG-24799
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-03-15 22:11:31 +00:00
Ulf Hermann af9536deea Fix QQmlMetaType::prettyTypeName to deal with malformed type names
We can have QML type names that are empty or end in '/'. In those cases
use the QMetaObject to retrieve a more meaningful type name.

Change-Id: I4dd0841de13d4e7524a104f0bbc08cb854484cfe
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-03-15 14:40:43 +00:00
Liang Qi ebb3aadeed Merge "Merge remote-tracking branch 'origin/5.8' into 5.9" into refs/staging/5.9 2017-03-14 12:47:53 +00:00
Liang Qi 12e82111ab Merge remote-tracking branch 'origin/5.9' into dev
Change-Id: I0ec164ce6e8099e6e4d6b40a3c7340737473ef4b
2017-03-14 10:49:51 +01:00
Ulf Hermann ffe538a565 QV4DebugService: Reduce unnecessary recursion and redundancy
Large parts of the protocol are unnecessary. There is no reason to send
a separate chunk of "handles" with almost every reply. The refs are
given as part of the regular data and if the client wants to find out
more, it can do further lookups. Also, it makes no sense to encode the
function and script names as objects, as they are in fact not JavaScript
objects.

Unfortunately these cleanups require some cooperation from the client.
Older clients will misbehave if we just drop the redundancy. Therefore,
we introduce parameters which the client can explicitly set with
the "connect" message. redundantRefs tells the service if redundant
references are required, namesAsObjects tells it if script and function
names have to be sent as objects/

Once we can require clients that support these options, we can drop the
code that generates redundant data.

Also, fix tst_qv4debugger::evaluateExpression() to actually check all
the expressions evaluated, not only the first and second one.

Task-number: QTBUG-42435
Change-Id: If93d2a2b9d0b8035f85dbef871bc1b03f199171d
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-03-14 09:02:51 +00:00
Liang Qi 435774ced1 Merge remote-tracking branch 'origin/5.8' into 5.9
Conflicts:
	src/qml/qml/qqmlimport.cpp

Change-Id: I26f8d18fe8af664ee8573116f182fe12b71e089a
2017-03-13 07:29:03 +01:00
Ulf Hermann d5d12e1d6f Set source location for all loop body-to-front jumps
Task-number: QTBUG-59204
Change-Id: Id1a73b228cd3386c7fcc7712c2485f387238b65e
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
2017-03-07 10:54:46 +00:00
Ulf Hermann 13335bdee5 Fix build with -no-feature-library
The versionUriList() function is unused in this case, and we cannot
build the extension plugins test.

Change-Id: I6c2ea1c2d078e508b0752efb45f4ccdfdbcbf22e
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-03-06 15:27:45 +00:00
Ulf Hermann 408620ea99 Fix building with -no-feature-process
Drop an unused include, don't try to build qmlplugindump in this
case, and add some guards around QProcess includes and usages.

Change-Id: I6ce5985a8dd1967f146016a7acd1ea31fb3bda2a
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-03-02 11:43:49 +00:00
Liang Qi 78dd18a0cd Merge remote-tracking branch 'origin/5.9' into dev
Change-Id: I6cbd83b61fac34c2ba6936711289ec09a490719a
2017-03-02 09:05:12 +01:00
Ulf Hermann c67d33db5b Add a source location to the final Jump in a for loop
Otherwise it will assume the last statement as the location of the
jump, and that might be a statement that is never hit.

Task-number: QTBUG-59204
Change-Id: I66019a284b061358939b23e649ca0832b5442388
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-02-28 16:33:05 +00:00
Ulf Hermann 5a9fd4f49e V4 Debugger: Don't crash when stepping to the end of a script
The last instruction is a return, which leads to an invalid context.
Don't try to save that context, but rather clear the current one.

Change-Id: I468b7420c4ca0842209c9b00478f99cc4dc69726
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-02-28 16:33:00 +00:00
Liang Qi afec9016d0 Merge remote-tracking branch 'origin/5.9' into dev
Change-Id: I92b13a9c1727644d63e125c1e6f1fdac72720ad7
2017-02-28 13:04:17 +01:00
Liang Qi b1fa22c168 Merge remote-tracking branch 'origin/5.8' into 5.9
Conflicts:
	src/qml/compiler/qv4ssa.cpp
	src/quick/accessible/qaccessiblequickview_p.h
	src/quick/items/qquickmousearea.cpp
	src/quick/util/qquickanimatorjob.cpp
	tools/qmlplugindump/main.cpp

Change-Id: I84474cf39895b9b757403971d2e9196e8c9d1809
2017-02-24 11:48:14 +01:00
Jake Petroules 9bca88ea41 Flip a broken qtConfig condition
This amends e0c119cc.

Change-Id: I5be65d23e176198ec9d5420a7f6fe270a4573bc3
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-02-22 03:03:47 +00:00
Ionut Alexandrescu bf1bd3abc9 Add a javascript push method binding to QQmlListProperty
Create a PropertyList prototype, and add the push method to
QQmlListProperty that call the append function if it has been defined.

Added a unit test and updated the documentation.

Change-Id: I2647766e98b60bf0546f6d6ed1422a616e0d3a07
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-02-21 12:30:30 +00:00
Kevin Ottens 06ad843b22 Add missing qmlRegisterExtendedUncreatableType variant
We need another qmlRegisterExtendedUncreatableType allowing to pass the
metaObjectRevision as third parameter. Otherwise extended uncreatable
types can't use for instance REVISION in their properties.

This is missing for some of the Qt 3D types for which we are cleaning up
the versioning for 5.9.0 and which fall in this category.

Change-Id: I20ebec339814d7f43cc4b2b58090406b0d5fb97e
Task-Id: QTBUG-58895
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-02-17 07:57:37 +00:00
Ulf Hermann 74dc6ef8d5 Directly load already known metaproperties in QV4QObjectWrapper
A method and a property can have the same name in a QObject. This is
not directly expressible in a JS object, but when iterating the
properties of a wrapped QObject we should not look them up by name as
we might find the wrong one this way. However, as we already know what
we are looking for, there is no need for any further searching anyway.

Task-number: QTBUG-58887
Change-Id: I68574008c7a078baab9b343d550cc27956b0d5a9
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-02-15 13:51:26 +00:00
Lars Knoll 802bebd566 Merge remote-tracking branch 'origin/5.9' into dev
Change-Id: I372850330c1d92edc5b07596759f0db3a59082a8
2017-02-14 08:21:39 +01:00
Robin Burchell bdb20c74eb As crazy as it is, redefinition of global properties should work
Furthermore, some of the ES6 tests do check for this behavior (this
fixes at least 9 of the tests in /test/built-ins/Object/, maybe more
elsewhere).

createMutableBinding used hasProperty(String*) to determine whether or
not it needs to actually define a property, which checks the prototype
chain.

This would be fine, but when writing values to properties, we used find() on
the InternalClass (which is equivilent to Object::hasOwnProperty), which
would fail as the property doesn't "really" exist on the object, it's somewhere
in the prototype chain. Thus, we'd incorrectly throw an exception in strict mode.

I see no regressions in ES5 from this change.

Change-Id: I3b097306f220a891955ec11eea860264746bc0ee
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-02-09 14:53:18 +00:00
Robin Burchell 33f54d1109 Add String.prototype.repeat from ECMAScript 6
Change-Id: I0ec59436e2dd1cd2e20e14434bc9753b09882238
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-02-09 14:52:46 +00:00
Ulf Hermann fedcd26ce8 Use QQmlType for looking up enums, even on singletons
QQmlType has more information than the bare QMetaType. The optimizer
already uses it for looking up enums, so some code would behave
differently, depending on whether the optimizer was enabled or not.

In some cases we cannot use QQmlType for lookup of enums because
QQmlType might have been created with only a callback. The object
only shows up later in that case. Then the only thing we can do is
query the metatype.

We can test this by adding an eval() because eval() disables
optimization for the surrounding code.

Task-number: QTBUG-58394
Change-Id: I8c90591b19fe1ed3e5339d877f9e6ec7c6f9aa73
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-02-08 16:36:55 +00:00
Robin Burchell d6280f7729 DatePrototype: In ES6, this is an Object, not a DateObject
Quoting 20.3.4:
    The Date prototype object is the intrinsic object %DatePrototype%. The Date
    prototype object is itself an ordinary object. It is not a Date instance
    and does not have a [[DateValue]] internal slot.

Aside from Symbol failures (which we expect, because we don't have a
Symbol implementation at this time), Date.prototype only has these two
failures left in ES6:

    setFullYear/new-value-time-clip in strict mode
    setFullYear/new-value-time-clip in non-strict mode
    setMonth/new-value-time-clip in strict mode
    setMonth/new-value-time-clip in non-strict mode

These seem to be related to handling of overflow conditions.

Change-Id: I0b7f65fbef3f709ff56ecfc8e5a5d5cf974b7515
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-02-07 10:14:30 +00:00
Robin Burchell 8779521704 Date.prototype: Fixes for ES6 compliance
* Don't return -0 from TimeClip (20.3.1.15, 1)
* Mark length configurable (19.2.4.1)
* toUTCString and toGMTString must be the the same object (B.2.4.3)

Brings us a bit closer to passing tests. Still some failures in other
areas.

Change-Id: I905216b8653ac0b33cb27e6b773616521fbb5daa
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-02-07 10:14:22 +00:00
Erik Verbruggen 04c98022d9 Fix move ordering while resolving edges in register allocation
When register allocation on an IR in SSA form is done, the last step is
to turn the Phi nodes into moves and swaps and put those instructions in
the predecessors. As the Phi nodes are conceptually "executed in
parallel", this can result in cycles:
  r1 <- r0
  r0 <- r1
These have to be turned into a swap instruction. Also, the moves have to
be ordered in order to make sure that no values are overwritten:
  r1 <- r0
  r2 <- r1
Here the two moves need to be switched. The comments in the code
document the algorithm.

Change-Id: I4151988681f7554b00a3eb70d224e6e2f29ebf04
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-02-04 12:03:00 +00:00
Robin Burchell bc5cdd23f1 parser: Add "let" keyword (& T_LET)
We also tie this up to the existing skeletal "const" support so that they
are also checked for duplicate declarations.

While we do that, change from using a boolean to an enum so we make the scope of
a declaration a little more easily comprehensible.

Change-Id: I6a6e08aed4e16a53690d6f6bafb55632807b6024
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-02-03 15:10:25 +00:00
Robin Burchell 5f807a6276 Codegen: Disallow duplicate declarations of const properties
Spec 13.3.1.1 (Static Semantics: Early Errors) says:

    It is a Syntax Error if the BoundNames of BindingList contains any
    duplicate entries.

Only let/const are supposed to be treated in this way, so we ensure that
one of them has been marked read-only (since we don't support "let"
yet).

There's still no runtime check on assigning to a constant-declared variable.

[ChangeLog][QtQml] "const" variable declarations now throw a SyntaxError if
multiple attempts to declare the same variable name are found. Note that
"const" is still not fully spec-compliant (i.e. reassignment at runtime is
not disallowed).

Task-number: QTBUG-58493
Change-Id: I31fd5f2bf3e79d48734e8ecb714c4e7f47e31d2a
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-02-03 15:10:18 +00:00
Robin Burchell b7090f1334 Fix a crash in setInternalClass
Revealed by the ES6 testsuite, ./test/built-ins/Object/freeze/15.2.3.9-2-1.js
and probably others. We cannot unconditionally dereference memberData,
it may not always exist.

ES6 tests test/built-ins/Object/freeze before:
    === Summary ===
     - Ran 92 tests
     - Passed 66 tests (71.7%)
     - Failed 26 tests (28.3%)

after:
    === Summary ===
     - Ran 92 tests
     - Passed 90 tests (97.8%)
     - Failed 2 tests (2.2%)

Change-Id: I22a6c9ca081394ba15edfde09f73769eb3ce47b3
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-02-03 12:48:40 +00:00
Michael Brasser 22b03fd6d3 Enable PropertyChanges to correctly restore binding on alias
Change-Id: I88ffdd1d1224705e980e449b6c799c9f186143b1
Task-number: QTBUG-58271
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-02-02 19:23:34 +00:00
Robin Burchell b63393c7aa Codegen: Disallow const declaration without an initializer expression
This seems to match up with the spec behavior. 13.3.1.1 (Static Semantics:
Early Errors) says:

    It is a Syntax Error if Initializer is not present and IsConstantDeclaration
    of the LexicalDeclaration containing this production is true.

In addition, we also allow "const" to be used in JS mode too. We don't
yet fully support the semantics, but as it's there, why not let it work.

[ChangeLog][QtQml] "const" variable declarations are now available in JS
as well as QML mode.

[ChangeLog][QtQml] "const" variable declarations now require an
initializer, bringing them closer to the required spec behavior.

Task-number: QTBUG-58493
Change-Id: Ife5d5979b3e7a5d7340bf04f43605f847ee25ee2
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-02-02 15:49:13 +00:00
Shawn Rutledge f96b77bf46 add QQmlEngine::offlineStorageDatabaseFilePath(db), use in LocalStorage
This is C++ API to get the actual storage path for a particular database.

[ChangeLog][QtQml] Added QQmlEngine::offlineStorageDatabaseFilePath(dbName)
to allow getting the actual storage path for a particular database.

Task-number: QTBUG-52013
Change-Id: I1cbd9454c537f08c97f4dafc06fd6b14e81c51af
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-02-02 13:19:57 +00:00
Liang Qi 6b1f857db5 Merge remote-tracking branch 'origin/5.8' into dev
Change-Id: I312dcd7f8bbe6e15b157406e174c160e0eb7e225
2017-01-30 12:56:18 +01:00
Robin Burchell e74a1d0b34 Enable resolution of composite types in QQmlTypeNameCache
We didn't have resolution of composite types previously, which is a
prerequisite to do more exciting things with QML types in JavaScript
(such as instanceof).

By deferring the resolution to QQmlImports, we can avoid the need to
fill the cache with types that may not be needed, while still finding
types which are requested.

In the future, we could consider removing the "special" handling for composite
singletons as they should be found through QQmlImports now. If we do
that, we may still want to cache the QUrl for the types, to avoid using
QQmlImports too often directly, as it is a little slow itself.

This change doesn't regress tst_compilation.

Task-number: QTBUG-24799
Change-Id: I9ba2e4829ca49008fd180fb488c586475cf90674
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-01-27 11:57:57 +00:00
Jake Petroules e0c119ccd4 Use qtConfig where appropriate
Change-Id: Ibe2a256ce5f208b3431c32a124aacf616641c965
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-01-26 16:59:44 +00:00
Liang Qi 0076c44d39 Merge remote-tracking branch 'origin/5.8' into dev
Conflicts:
	src/quick/util/qquickutilmodule.cpp
	tools/qmllint/main.cpp

Change-Id: Ic2283f88c293ca7fc776de3e83eb4c7812309d8a
2017-01-26 00:34:21 +01:00
Robin Burchell b9fe2c2bfd Teach QQmlDirParser to ignore the classname keyword
This saves QQmlImport from some unnecessary bad lookups when finding
types (due to classname being misinterpreted as belonging as a
component).

Change-Id: I36e622e357e55e98a5af46911709640c5d8fa291
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-01-24 17:37:34 +00:00
Jan Arve Saether 941fb369eb Stabilize test
Obviously, if the animation still hasn't stopped, we cannot expect it to
fail on the next QTRY_COMPARE, since that might wait until it then passes,
thus CI will log that as an XPASS.

This failed during CI run for MSVC 2015:
XPASS  : tst_QPauseAnimationJob::multipleSequentialGroups() QCOMPARE(((group.state())), QAbstractAnimationJob::Stopped) returned TRUE unexpectedly.
 tst_qpauseanimationjob.cpp(396) : failure location

Change-Id: I25151123b8fc2617f2a4d3690215e6a1ed2856ff
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2017-01-24 10:37:14 +00:00
Robin Burchell b3629b4c27 tst_qqmlecmascript: Add some simple coverage for instanceof
Since I'm working on this, it is nice to have some simple verification
that things are working. I don't expect this to provide full coverage,
but it should at least make sure that the basics are ok, and nicely
provides a place to put further tests if it ever somehow breaks.

Change-Id: If91154dee836cc514515bde122e48b271de22676
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-01-20 13:28:54 +00:00
Ulf Hermann d7cd210bb4 Make inspector animation speed test more robust
We don't exactly know when the animation speed is actually set and the
system clock may play tricks on us. Consider the test failed when the
wrong animation speed is witnessed 3 times in a row and successful if
the correct one is witnessed 3 times in a row. Also, make sure we don't
confuse lines from different hits of the timer.

Task-number: QTBUG-58186
Change-Id: Iaa2c35f723a92f32131e36084399b3d32accb7d0
Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
2017-01-18 12:43:49 +00:00
Simon Hausmann 89c6bee139 Fix support for QJSValue as C++ signal parameter type, part 2
After commit 0e3380f9c6 we wouldn't crash
anymore, if QJSValue::UndefinedValue was provided as value for a
QJSValue C++ signal parameter. However that was not a complete fix for
the regression of commit aa869cbb06, as
other primitive values stored in QJSValue as QVariant were not
converted, so for example QJSValue(42). So let's fix this once and for
all by using QJSValuePrivate::valueForData, that handles all types of
QJSValuePrivate encodings.

Task-number: QTBUG-58133
Change-Id: Ib7c0461b18df6260ccd4bce729ae2348281eb7f3
Reviewed-by: Arnaud Vrac <avrac@freebox.fr>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-01-18 05:51:05 +00:00
Robin Burchell 0412de08fd qmlInfo: Switch message level to QtInfoMsg, matching the function name
qmlInfo predated info-level messages in QtCore, and as such previously sent
warning-level messages despite the unfortunate naming. Now that we have
an actual qmlWarning function, and we have switched our code to use it,
we can change qmlInfo's behavior to better match the function naming.

This does have the impact that existing qmlInfo callers will
basically need a s/qmlInfo/qmlWarning/g to retain the same QDebug level in
user code, but I feel that this behavior change makes sense given the better
consistency with C++-side QDebug we attain.

[ChangeLog][QtQml][Important Behavior Changes] qmlInfo now reports messages with
a QtMsgType of QtInfoMsg instead of QtWarningMsg. To continue to send warnings,
callers should migrate to the newly-introduced qmlWarning function.

Change-Id: I16c88d94377b5956eb6921b64af7c84d1ca024f6
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-01-17 14:06:39 +00:00
Robin Burchell 2c826af7c3 tests: Remove some vestigial references
qtdeclarative hasn't relied on qtwebkit for a long time (since
fbfb27a44a &
56d34a653a as early as 2011!).

Change-Id: If02572617034bf2c3eecbf081b96b1ed0ad65b45
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-01-16 15:13:54 +00:00
Robin Burchell 01f7a9dbe2 QQmlApplicationEngine: Yet another fix after QUrl behavior changes in QtBase
Picture the following application:
    QQmlApplication qAppEngine("main.qml");

With main.qml:
    ...
    AComponentInTheSameDirectory {
    }
    ...

This was failing, with the error:
    file:main.qml:13 AComponentInTheSameDirectory is not a type

Which is wrong, but also reveals the root cause in that the
original filename was not a fully resolved path.

Change-Id: Ifc5557cc43f4bb92fd121ea9f7a37f09b3b38a9b
Reviewed-by: David Faure <david.faure@kdab.com>
2017-01-16 15:13:49 +00:00
Liang Qi 60300fda46 Merge remote-tracking branch 'origin/5.8' into dev
Conflicts:
	.qmake.conf

Change-Id: I9d87ed86e95b5901a86cc3aa65d7ac39b0b708c2
2017-01-14 22:17:32 +01:00
Simon Hausmann 0e3380f9c6 Fix crash when C++ QJSValue parameterized signal interacts with JS
When converting the parameters of a C++ signal to JS values to provide
to a signal handler written in JS, the conversion of a QJSValue to a
QV4::Value* may yield a null pointer in case of a default constructed
QJSValue for example. This is a regression from commit
aa869cbb06 and we must check for this.

Task-number: QTBUG-58133
Change-Id: I528b606b2851dfb3072e54902bd8843d31571a55
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-01-13 12:41:33 +00:00
Robin Burchell 5a5f140e60 QQmlInfo: Add qmlDebug & qmlWarning functions alongside qmlInfo
This way, we can correctly write to multiple levels of QDebug with QML context
information. A followup change will port all existing callers, and
subsequently change qmlInfo's message level to QtInfoMsg.

[ChangeLog][QtQml] Introduced qmlDebug & qmlWarning functions to qqmlinfo.h, in
addition to the pre-existing qmlInfo function. As a side effect, QQmlError has
also gained messageType() and setMessageType().

Change-Id: I04ced5952c5c3c58293a89a6767c7b545c03cc0a
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-01-11 13:49:04 +00:00