Make sure to enumerate the properties as well as the invokable methods.
Fixes various tests in qmltest
Change-Id: If40dbc8f2203f99d75523e40f78849224e301481
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
This test relies on the global object vs. context ordering and consequently
fails right now
Change-Id: I6b6cec38bf2d2074c2fcfacf9b499bc7a97cca44
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Move the engine pointer from QJSValuePrivate to PersistentValuePrivate
and set it back to null in the memory manager destructor.
Change-Id: I904b365221e1559701353cb359eac768928ad918
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Fixes a crash in the qquickmultipointtoucharea test
Change-Id: Ic1ca5220e5e7a569e3cc499ba120296fb885d6c0
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
There's no reason to disallow calling model.set() with
an ArrayObject as argument.
Change-Id: I44baad677ca34e1fb4188b89f0a548af84580b4f
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
In non-strict mode we can use with() and eval() again, and so these tests pass.
Change-Id: I66b16653a28b1d7e420e53c012d7908c8fc6c29a
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
The parser needs to be fixed to better parse localized dates, times
and timezone fields
Change-Id: I6542ee459e7135b6f845fb5fc89685cb8c2d67c5
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Forcing them to strict lead to too many incompatibilites
to 5.1, so let's rather leave them non strict
Change-Id: I7c3bafc9a840daa565add7abbad0d0042cdae332
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
QQmlValueTypeWrapper stores its prototype in a global variable
(PersistentValue), which doesn't work when using multiple engines. Instead
this patch introduces the QML extensions structure to hold things like
prototypes for type extensions to JS that are specific to QML.
Change-Id: I41a71029edb6ce895eb80db7aa0809aab86b31db
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
This reverts commit 0e9cd8b409.
This optimization breaks ShaderEffects with changing fragment
and vertex shaders and needs some more thought.
Task-number: QTBUG-31837
Change-Id: I1abe249c65dd785825c249a7c22baee928bd76c8
Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
Writing to a read-only property or trying to deleting will throw an exception
in strict mode and thus abort the execution. Make the test work in strict and
non-strict mode by surrounding the offending statements with individual
try/catch pairs.
Change-Id: I25f803b6ffd7ef721ac874f53a37b3208b5c05ab
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
This needs the same fix as the one in the QFileDialogHelper (change
I7a3b2321f4a1bf179dced8e98598559f396386db). However to be even safer,
we can check for a null pointer before calling any methods on the
QWindow.
Task-number: QTBUG-31834
Change-Id: I319326f06fb2c92dc898fd12be86b6c7b7f87e5a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Remove the column number from the expected output, as we generate those
QQmlBinding objects from within a v4 callback and produce the line number
and column number from the stack trace of the engine, which currently
doesn't produce column numbers.
Change-Id: I9840f0ab571d4261570dd079436aaa9f81e27abf
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
When calling Qt.binding(f), don't modify f and set the bindingKeyFlag
there, but instead we must return a _new_ function that acts as proxy
and has the bindingKeyFlag set to true, similar to how the V8 based
implementation created a clone.
Change-Id: I4998359869c02e32c89e929793bf74a4adafcb72
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Make the test-case compile with strict mode, where function declarations
are not allowed within blocks. An alternative would be to use function
expressions here.
Change-Id: If7e1cc23ef4a0c6a83e4ba8ae03dc9c6b678730d
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Function declarations in QML mode should be similar to function expressions and
therefore need to go to the return value of the function..
Change-Id: Ib1dd8a970a967f2456d0558be74edf5d74d288e5
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
The worker script creates a special QmlContextWrapper
that doesn't contain many things found in the main thread.
However we still need to be able to cast to it, so it
should be the same class as the regular context wrapper.
Fixes parts of the worker script auto tests.
Change-Id: I3697b2b0080dc4ac967eb447e2efd0f28fbab465
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Revert the initialization part of 42825af048 in
the IR, apparently it is needed.
Change-Id: Ia415133ee2fb6cd060fa5a0e5da7b711ac98ddd1
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
In V4 URLs were mapped to strings, with V8 they were mapped to opaque
variants, which is also what we do with v4 at the moment. In the future
we want to provide a real JS API for URLs, but that is a feature that
should be discussed in a wider scope and developed on the dev branch.
Change-Id: I17660066b2797239eddebad03f49ffa424f86f78
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Exclude the test262 test suite, as qmlmin can't deal with
all of the test cases there.
Change-Id: Ie56c0d9adecc6b1ae0ddcbcd3edd5b0eaf30cd4d
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Skip properties that are function objects when converting a V4 Object to a
QJsonObject. For arrays the function object gets replaced with null.
Fix the test case for arrays to have the correct expected output.
Change-Id: I3ee63935d038e0922e33ac6e64e9c31ecfbd4a7e
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
When converting to a memory managed string, we need to add
the PersistentValuePrivate to the chain of persistent objects.
Otherwise the string stored in the JSValue can get garbage
collected.
Change-Id: I159fd77a7ae6f29e4121969cac962bd12b0f9bc7
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Without the private export on these classes, the private
export on the QSGDefaultImageNode and QSGDefaultTextureNode
is useless, as the symbols fail to resolve
Change-Id: I25a265a7669e5f5015c482aa24fe154c2c9a1062
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
eval() works differently in strict mode, and it's nicely covered by
test262
Change-Id: I9bb84753032d5106c94d78afe765680f3d85348d
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
This reverts commit 2bd6e240a3.
This doesn't work properly as the code generator will not keep those
initializations at the beginning of the function, resulting in
uninitialized values in ctx->locals[], which gives valgrind warnings
when they're marked.
Change-Id: I81501e0ea80e7f76b7d9112fea261e406084b69b
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
This reverts commit 01526deb81.
This doesn't work properly as the code generator will not keep those
initializations at the beginning of the function, resulting in
uninitialized values in ctx->locals[], which gives valgrind warnings
when they're marked.
Change-Id: I8f671c85b6744c80b6fe11b628bf6b6de125a6bd
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
When marking the var properties of a VME-metaobject (we decided to keep its
QObject alive), then we must also mark the var properties of the parent
VME-metaobject. The two property var inheritance tests verify that.
Change-Id: If1f0d4f3daef78d42adb7052cc1ce7bbdd6da585
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Add column to expected warning message
* Get rid of eval that doesn't make sense with only one JS engine
and doesn't work in strict mode
Change-Id: I63cd3784cd8c255af8832ea5ca1e6e5e2d48431e
Reviewed-by: Lars Knoll <lars.knoll@digia.com>