Update test262.py to work with an up to date version of
the Ecmascript test suite and update the suite to current
master.
test262 does also contain tests for experimental features
that are not yet part of the standard. As we don't want to
test those, test262.py contains a hardcoded list of those
features.
As this brings in all the ES6/7/8 tests in the test suite, it
requires us to add a large list of failing tests to
TestExpectations. But like this we can more easily track
work towards better ES6 compatibility and make sure we
don't introduce regressions.
Currently, we pass around 60% of the test suite.
Task-number: QTBUG-66950
Change-Id: I6ea75702e6f89e901e4752b73219d2f48ed53c10
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Remove unused flag that indicates whether a cache file contains
executable code. Since we don't embed executable code anymore we can get
rid of that along with the code that attempts to creat an executable
mapping.
Change-Id: I50e9770dc69b31319288a75379fd2f5db4c0a0f4
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Add rvalue constructor and assignment operator, to reduce the amount of
atomic operations as a consequence of the typeloader changes that
replace the manual reference counting with QQmlRefPointer usage.
Change-Id: Id36be54e717cf2e83b0027b818f11e20b4fde0ce
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Finally the handling of the asynchronously retrievable qqmldir data
obtained via QQmlTypeLoader::getQmldir(url) becomes simpler when doing
QQmlRefPointer.
Change-Id: I557980482f8d1a3c7e4189dee92564ec5e6dfb48
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
The manual addref() and then release() in notifyComplete() are hard to
read. It's simpler to let m_waitingFor store QQmlRefPointer instances,
at the expense of iteration code that's harer to read.
Change-Id: Idc51fbb1b24e0bd466381b9a1ad10fbd38fc8ac1
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
QQmlScriptData is another data type that is best reference counted using
automatic means.
Change-Id: I9e25ac81ccdc03c2eefa35fcecc9cdfcc06dfe0a
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
We have a few places in the type loader where we do adventurous manual
reference counting, where getType() returns a raw pointer that has been
addref()'ed and then sometimes somehow we call release() later. Commit
0b394e30bb is an example of where this can
easily go wrong. As a consequence and also in preparation for future
work on the type loader, this patch starts replacing the manual
reference counting there.
Changing the return type from QQmlTypeData *getType() to a
QQmlRefPointer<> itself is not sufficient though, as the implicit
operator T*() will still allow the caller to store the result as a raw
pointer. Therefore this patch removes the "unsafe" implicit extraction
operator.
As a result of that change, other types that are sometimes stored in
QQmlRefPointer are also affected and their usage needs to be adapted
to QQmlRefPointer usage or manual raw pointer extraction with .data().
Change-Id: I18fd40634047f13196a237f4e6766cbef3bfbea2
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
When the text element is inside a Qt Quick layout and we set the implicit width,
this can trigger the Layout to resize the width further down in the stack. At
this point, a recursion guard we have in place to protect against binding
loops will cause us to ignore the size update. The end result is that the text
width has changed, but the contents have not been updated to reflect this.
This change detects this case by checking if the width of the text changed
while the recursion guard was in place, and if it was, we call updateSize()
again to make sure everything is up-to-date.
I added a second admittedly ugly recursion guard for this out of paranoia.
I haven't seen any case where this might cause an infinite recursion, but
it seemed better to be on the safe side.
[ChangeLog][Text] Fixed an issue where updating text inside a layout would
not cause it to correctly adapt to its new width.
Task-number: QTBUG-53279
Change-Id: I1e421a7073428fa490a24be36208a2077f5836dd
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
function foo() { let x; function x() {} }
would crash. Throw an error instead now.
Change-Id: I5e5588deb21c1777be15a6656baefc422d59ff0c
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
If there is no name for the binding, we need to store it's
value as a temp on the stack for further destructuring.
Change-Id: Ibf8651e5aed4f45f2ca5f2d2d3ddeb8fc60b5f9f
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
This requires some interaction between parser and
lexer as static is only recognized as a keyword
directly in the class declaration.
Change-Id: Ib64157ae6ad542706a5eee8ff4ec7f9cb79a62c3
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
This basically updates all grammar rules in the
qqmljs.g file to be in line with the ES7 specification.
Some special handling for the lookahead rules appearing
in the spec was needed and is implemented through empty
lookahead rules in the grammar, that might push an
additional token into the token stream.
Renamed some classes in the AST to be in line with
the names used in ES7, and removed some other ones
(SourceElements) that are no longer used.
The ES7 grammar rules contain lots of variations of
the base rules (with In/Return/Yield/Default suffixes).
With the exception of the In and Default rules, these
are implemented through state tracking in the parser
and lexer.
Change-Id: I4017d97cd050ed816c1dad11833e882cba30801a
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
In preparation for the ES6 changes, where one or two files
won't parse correctly anymore.
Change-Id: Ie83e684761b2d7dcdec1d44f67006f60fb6e500c
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Use referenceForName() consistently to do the lookup
of a symbol. Otherwise we might get errors if the name
refers to a local name that we do not export from the
current scope
Change-Id: I09e5816260cec8107411a8562e7f7b76f36912bf
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
To bring the naming in line with the naming used in the
ES7 grammar specification.
Change-Id: Ie996bba5fb7d08e0790a8e55d3de62961a7257a8
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
It's not a keyword outside of generator functions, so extend the
qmlmode boolean on the lexer to become a more general parsemode that
we can use to also turn the yield keyword on and of.
The parser can then set the flag when it enters the body of a generator
function.
Change-Id: Ibf792d4c7c567d825c6706f7b4997362c87fc575
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Unify duplicated code for the regular and NotIn cases, and rather
simply keep them as different states, but execute the same code to
create the AST.
Change-Id: I05687423f95323c23a0340a1d80f99a355628cc4
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
add support for destructuring of arrays when passing
arguments to functions.
Change-Id: I19feb39aa3ae520ec7591d49d1b14ceaa78783c6
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Destructuring objects works, but arrays are not
yet supported.
Change-Id: I61e917e1964e3c719f71b8f11d194e09dfe288c2
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
It's not required and makes the refactoring of the function
parameter handling required for ES6 a lot harder.
Change-Id: I0273449219ea9f3324353d6cf9166c1b58eb914b
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Rename defaultExpression to initializer, and the fix the spelling
of Initialiser to Initializer.
Change-Id: I049039a742bdb77cb5f6beab9a28ff3b6f47a605
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Those are not allowed as soon as we have default values for parameters
or rest arguments.
Change-Id: I7dec826c37e6045e4dd1f6b0adb90301efe33daf
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
function foo(a, b, ...c) {...} now works correctly.
Change-Id: Ie442a0e7cc5e9dc4156e56b348bba305cced8531
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
The parser can also handle rest parameters correctly, this will
however require some additional work in the runtime to support
it correctly.
Change-Id: Ib6f4d27683774966b2d2aac075494d2f5066d2a2
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
This requires a bit of bookeeping in the lexer, as we can have
arbitrary expressions inside the ${...}. To make this work, keep
a stack of template states, in which we count the unclosed braces
to match up with the correct closing brace.
Implements support for `...`. Expressions of the type Foo`...`
and Foo()`...` will come in follow-up commits.
Change-Id: Ia332796cfb77895583d0093732e6f56c8b0662c9
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Let's not check in the files generated by qlalr. This is ok, as
qlalr is part of qtbase since a long time.
Change-Id: I1298c76e919169c8f02f1e5d067f128a9f2a7542
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Removing identifiers from the propertyhash could cause subtle issues
if there was an identifier that hashed to the same value as the identifier
being removed stored in the hash afterwards. This identifier could
end up in a state where it could not be found anymore.
Amends ea164ca4a8
Change-Id: I2881865ee83833b6364d9be55579b8fc7d7c5016
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
This function will come in handy in later patches as well.
Change-Id: Id4d6437dcd74f5e69e43d1e56c4c5aa4f2cee462
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
The watchdog timer's usual 5 minutes is roughly how long the test
takes to run (and it gets run twice), so there's a good chance of
timing out. Avoid flakiness by giving it a third as much again on
top of the default.
Change-Id: I7cc9e392ab939ffe45d92bde635433d272e17388
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
If lists had spacing, snapping would have gaps where snapItemAt would
return nullptr eventhough there were items above and below in the list.
I.e. if we have a list with items of size 100, and a spacing of 100, and
scroll to 110 (right below the first item), then the first item would fail
because this is false:
itemTop+itemSize()/2 >= pos (50 >= 110)
And the next item (the one we should have snapped to), would fail because
this is false:
itemTop-prevItemSize/2 < pos (200-100/2 < 110)
The meaning of first part was probably to see if the middle of the current
item is inside the view.
The meaning of the second part was probably to see if the middle of the
previous item is outside the view.
This patch refactors the code so it's more visible what's happening and
fixes the bug by taking the spacing into account when computing the position of
the halfway positions.
Task-number: QTBUG-59852
Change-Id: I60eec0d16e91d2f22d70b97d11bcde5d88ac2997
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
This enables us to drop the QML dependency from a number of tests. This
is desirable because we want to test that we didn't do any incompatible
changes to the debug framework.
Change-Id: I937dd45d3079eac15c200c9d68bb4c911f61afc0
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Deleting d->contentItem may call into the platform
plugin, for example if the contentItem is a Window. This
can again make the platform (plugin) generate events
for the QQuickWindow that is being destroyed. The QQuickWindow
may try to use the now invalid d->contentItem during
event processing, and crash.
This is especially prone to happening if/when the platform
plugin does less queuing of events, for example on macOS
after commit ed483346.
Fix this by clearing the d->contentItem pointer before
deleting it. Also make sure all d->contentItem accesses
have nullptr checks.
Task-number: QTBUG-67802
Change-Id: Ieff97711fbe15818948d4b6ade069b096a55c683
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
This patch partially reverts 098ba08653.
Only QtWebGL will use separate buffers for indices and vertices. This
patch gives a performance boost.
Task-number: QTBUG-66191
Task-number: QTBUG-67147
Change-Id: I58b4db2bdf44cd954390e85e079de82031caf9e5
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This means QtQmlDebug needs its own qqmlprofilerdefintions.h. This is a
good thing because this way we notice if we change the definitions in an
incompatible way. The test uses QtQmlDebug after all. Also,
qqmldebugserviceinterfaces_p.h is not available anymore, which means the
service names have to be spelled out. This, also, is beneficial as it
prevents us from accidentally changing the names.
In the context of QmlDebug we don't need to namespace the profiler
definitions, either. This simplifies some code.
Task-number: QTBUG-60996
Change-Id: Ibb39e48c9b758687d68b8ce4431f45eb26939a09
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
The submodule has now reverted my "fix" for a test the ES spec
initially lead me to think was misguided; the test is fine, in fact,
but I was using the wrong time-zone to run it. That's now fixed here,
so we can take in the revert of the mis-fix.
Task-number: QTBUG-67010
Change-Id: I89c8236ce11ee4dc16eb145e37f4510e19977bb2
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Just because we need a data stream version for QQmlDebugPacket, we don't
need to add such a huge dependency. Using a template here adds some
boiler plate to all users of QQmlDebugPacket, but this is worth it.
Task-number: QTBUG-60996
Change-Id: Ibade8757e28ac772942129c22c8721b504da3aee
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>