aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlecmascript
Commit message (Collapse)AuthorAgeFilesLines
* Be (somewhat more) consistent about the value of piEdward Welbourne2017-06-141-1/+1
| | | | | | | | | Use M_PI in C++ and Math.PI in JavaScript (including QML). Use qmath.h's value for M_PI where we can't avoid an explicit value. Task-number: QTBUG-58083 Change-Id: Iabe938aff62ceac27b939ec33c6ee5e854aac15e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-06-074-0/+34
|\ | | | | | | Change-Id: I61ab3d0bd8cc02f640c60c037226eace09ec09ba
| * QQmlIRBuilder: Only query type name cache for type namesRobin Burchell2017-05-194-0/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The behavior here was always incorrect: type names must start with an uppercase letter, so querying the type name cache with a lowercase string is wrong. However, this was turned into a larger problem by making more extensive use of QQmlTypeNameCache in e74a1d0b342f2c95dc3a543c8c9ec07fd52d8fe0, as it contained a lot of new types (including composite types, which previously were only in the cache if they were singletons). Task-number: QTBUG-60547 Change-Id: I40be2d535e99d3e1af250d995d7149ecbe2965d7 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | QmlContextWrapper -> QQmlContextWrapperRobin Burchell2017-05-041-1/+1
| | | | | | | | | | | | | | That poor Q looked so lonely. Change-Id: I29a0aa0574fefa5be8ffaa9857e03500c914c830 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devLars Knoll2017-05-022-0/+23
|\| | | | | | | Change-Id: I71275a2076c3d32ee2896571be882067320a2e9e
| * Merge remote-tracking branch 'origin/5.8' into 5.9Simon Hausmann2017-04-272-0/+23
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qtqmlglobal.h src/qtqmlglobal_p.h src/jsruntime/qv4global_p.h src/qml/compiler/compiler.pri src/qml/compiler/qv4ssa.cpp src/qmldevtools/qtqmldevtoolsglobal_p.h tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp Change-Id: I55c5d015b2cb1053b83b9c61caaf004fb49ee486
| | * V4: Fix issues with very small loops5.8Erik Verbruggen2017-04-182-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Loops consisting of just a single basic block (e.g. a do-while loop with no nested loops or if statements) have a back-edge to themselves. There were 2 problems: - loop detection would create LoopInfo for any loop header referred to by blocks inside the loop (and a 1 block loop doesn't have body blocks), nor would it mark the loop header as such - when splitting critical edges, the newly inserted block would not be marked as part of the loop This is a problem specifically for 1 block loops: the block ends with a CJUMP, so the back-edge is a critical edge. So the new block inserted by edge splitting wouldn't be marked as belonging to the loop. The end result was that the life-time intervals for temporaries that are defined before the loop, but that are used inside the loop, and not after the loop, would have their life-time ended before the loop ends (instead of spanning the whole loop, *including* the back-edge). This in turns could lead to the stack/register allocator re-using the storage for that temporary, resulting in strange things happening. Task-number: QTBUG-59012 Change-Id: Ic946c73913711272efea2151cb85350412ca2fde Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Add support for std::vector and QVector matching the support for QListVille Voutilainen2017-04-212-3/+35
| | | | | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-60133 Change-Id: I5497dc3c4a1c3922e7147d7a20593c75a0d9d0e9 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | qml: Override the new Object::instanceOf hook to allow QML type checkingRobin Burchell2017-03-151-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [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>
* | | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-02-283-0/+54
|\| | | | | | | | | | | Change-Id: I92b13a9c1727644d63e125c1e6f1fdac72720ad7
| * | Directly load already known metaproperties in QV4QObjectWrapperUlf Hermann2017-02-153-0/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | Merge remote-tracking branch 'origin/5.9' into devLars Knoll2017-02-141-0/+13
|\| | | | | | | | | | | Change-Id: I372850330c1d92edc5b07596759f0db3a59082a8
| * | Fix a crash in setInternalClassRobin Burchell2017-02-031-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | As crazy as it is, redefinition of global properties should workRobin Burchell2017-02-091-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | parser: Add "let" keyword (& T_LET)Robin Burchell2017-02-031-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | Codegen: Disallow duplicate declarations of const propertiesRobin Burchell2017-02-031-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | Codegen: Disallow const declaration without an initializer expressionRobin Burchell2017-02-021-0/+57
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge remote-tracking branch 'origin/5.8' into devLiang Qi2017-01-262-2/+13
|\| | | | | | | | | | | | | | | Conflicts: src/quick/util/qquickutilmodule.cpp tools/qmllint/main.cpp Change-Id: Ic2283f88c293ca7fc776de3e83eb4c7812309d8a
| * Fix support for QJSValue as C++ signal parameter type, part 2Simon Hausmann2017-01-182-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After commit 0e3380f9c6ab6e3ea7398caccf5aa84f1575f1cd 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 aa869cbb06bcf005e238059a2cb0205947ff0b5f, 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>
* | tst_qqmlecmascript: Add some simple coverage for instanceofRobin Burchell2017-01-201-0/+64
|/ | | | | | | | | | 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>
* Fix crash when C++ QJSValue parameterized signal interacts with JSSimon Hausmann2017-01-133-0/+4
| | | | | | | | | | | | 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 aa869cbb06bcf005e238059a2cb0205947ff0b5f and we must check for this. Task-number: QTBUG-58133 Change-Id: I528b606b2851dfb3072e54902bd8843d31571a55 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Inline the qmlScope and urlScope methodsLars Knoll2016-12-041-1/+1
| | | | | | | They are only a couple of lines and used only in one place. Change-Id: Iee9139e78d5d7fd385cae39d6dd5fad7e5d461b5 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Start cleaning up the QmlContextWrapperLars Knoll2016-12-041-1/+1
| | | | | | | | | The class should get merged with the QV4::QmlContext class. Simplify the cleanup by moving both classes into a common file. Change-Id: I0074da79701d5f41eb51681b70fcde85bfd45fc1 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-10-102-0/+22
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/quick/quickwidgets/quickwidget/main.cpp src/qml/jsruntime/qv4jsonobject.cpp src/qml/jsruntime/qv4qobjectwrapper.cpp src/qml/jsruntime/qv4qobjectwrapper_p.h src/qml/qml/qqmlengine.cpp src/qml/qml/qqmlpropertycache.cpp src/qml/qml/qqmlpropertycache_p.h src/quick/items/qquickanimatedsprite.cpp src/quick/items/qquickitem.cpp src/quick/items/qquickitem.h src/quick/items/qquickitem_p.h src/quick/items/qquickview_p.h src/quick/scenegraph/qsgcontext.cpp src/quick/scenegraph/qsgdefaultrendercontext.cpp Change-Id: I172c6fbff97208f21ed4c8b6db3d1747a889f22b
| * Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-10-042-0/+22
| |\ | | | | | | | | | Change-Id: I48764527fa1ab6d8d59c24552394459b1cdc58ee
| | * qv4jsonobject: Make use of QVariant::toString in stringificationRobin Burchell2016-09-302-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | This covers a whole host of missing cases, notably QUrl stored in a QV4::Value. Task-number: QTBUG-50592 Change-Id: I8afd772046c7bfbbcf916a7e90a57be5257b9df8 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | QML: Also check for correct destroy() chainingErik Verbruggen2016-10-061-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Check that the destroy() method of Heap::Base was called when a Managed object needs destruction. This checks if a call to the parent's destroy() method was accidentally omitted. Change-Id: Id025ecd6d4744bf3eab23503fbe317ed2a461138 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | QML: Make Heap::Object and all subclasses trivialErik Verbruggen2016-10-061-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GCC6 might dead-store-eliminate out our secret write to Base::mmdata, because it expects all memory content to be "undefined" before constructor calls. Clang might take the same approach if the constructor of Heap::Object is removed. By making these structs trivial, it also makes them memcpy-able. Change-Id: I055b2ad28311b997fbe059849ebda4d5894eaa9b Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | QML: Introduce destroy() on Base subclassesErik Verbruggen2016-10-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | This removes the destructors of subclasses of Base, making them nearly trivial. Change-Id: Ia6f7d467e87899b5ad37b8709a8f633a51689d59 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Fix binding dependencies when used in together with functionsSimon Hausmann2016-08-302-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a function called from a binding would access a scope or context property, we would end up registering those dependencies as permanent dependencies in the expression and set m_permanentDependenciesRegistered to true. Then after the binding evaluation itself, we would not end up registering the real binding's permanent dependencies. Change-Id: I3b6c1c181aa064d535362c736b5b2bbc4f576ba9 Done-with: Erik Task-number: QTBUG-54394 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* | | Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-08-172-0/+105
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/compiler/qqmltypecompiler.cpp src/qml/compiler/qv4isel_moth.cpp src/qml/compiler/qv4ssa_p.h src/qml/qml/qqmlobjectcreator.cpp Change-Id: I8bb7fe773d657f908f20ee5e72c2b9bd643f6260
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-08-132-0/+105
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/compiler/qv4isel_moth.cpp src/qml/compiler/qv4ssa_p.h tests/benchmarks/qml/qqmlimage/qqmlimage.pro tests/benchmarks/qml/qqmlimage/tst_qqmlimage.cpp Change-Id: Iad11ce7fdf0c6d200fdebc16a94081bd8069a87a
| | * Fix crash with Component.onDestructionSimon Hausmann2016-08-052-0/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A call to a handler of Component.onDestruction may end up causing WeakValues such as QQmlData::jsWrapper to be set again, even though they've been set to undefined in an earlier iteration of the loop that walks through the weak references. That in turn may result in invalid object references to objects that are scheduled for destruction by the collector. So after calling all destroy handlers for QObjects, reset all of the weak values again. Task-number: QTBUG-54939 Change-Id: I00ebabb76274e296fb1bd90d8d3e21dbbb920b57 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-08-091-2/+5
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/qml/qqmlcomponent.cpp tests/auto/quick/scenegraph/tst_scenegraph.cpp Change-Id: Ibc811b95a57f175ca53337db7bbd1f575a745937
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-08-051-2/+5
| |\| | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/qmltooling/qmldbg_debugger/qv4debugservice.cpp src/plugins/qmltooling/qmldbg_debugger/qv4debugservice.h Change-Id: I1e6a9424e7f87d9e4ac1ea387ec70e151106f1c7
| | * Relax negativeYear EcmaScript testUlf Hermann2016-08-031-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | EcmaScript doesn't in fact require the date to be represented in english. Thus, only test for the year number to be contained in the date string. Change-Id: I5b89c14a833b317f259f4cd2855b3f24310a7d72 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | QJSValue: Adapt to introduction of QMetaType::NullptrChristian Kandeler2016-08-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | [ChangeLog][QtQml][Important Behavior Changes] A JS null value converted to a QVariant now has type QMetaType::Nullptr rather than QMetaType::VoidStar. Change-Id: I91a64e444ada0f1884fe807f9973348ba1a878ff Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Merge remote-tracking branch 'origin/5.7' into devEdward Welbourne2016-08-022-0/+34
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/quick/items/qquickshadereffect.cpp 5.7 had a bug-fix in code dev has replaced wholesale. src/quick/items/qquickwindow.cpp src/quick/items/qquickwindow_p.h One side changed a method's signature; the other side renamed a method declared adjacent to it and changed some code using it, moving some from the public class to its private partner. tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp One side added a blank line before a comment the other re-wrote. Kept the re-write, killed the stray blank. .qmake.conf Ignore 5.7's change to MODULE_VERSION. src/qml/compiler/qqmltypecompiler.cpp src/qml/compiler/qqmlpropertyvalidator.cpp 5.7 changed code in the former that dev moved to the latter. Reflect 5.7's changes there, adapted to dev's form. src/qml/qml/qqmlobjectcreator.cpp One side added new QVariant types; the other changed how it handled each type of QVariant (without git seeing any conflict); adapted the new stanzas to work the same as the transformed ones. tests/manual/v4/test262 dev had a broken sha1 for it; so used 5.7's 9741ac4655808ac46c127e3d1d8ba3d27ada618e Change-Id: I1fbe2255b97d6ef405cdd1d0cea7fab8dc351d6f
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-08-011-0/+7
| |\| | | | | | | | | | | | | | | | | | | | | | Conflicts: tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp tests/auto/quick/qquickitem/tst_qquickitem.cpp Change-Id: If261f8eea84dfa5944bb55de999d1f70aba528fd
| | * JS: Check for errors before using sub-expression resultsErik Verbruggen2016-07-201-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | Specifically: don't de-reference a result and assume that it's not-null. Task-number: QTBUG-54687 Change-Id: If07d3250a95a7815ab7a3262b88e0227965ef8e7 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Edward Welbourne2016-07-152-0/+27
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/quick/demos/photoviewer/deployment.pri One side made it redundant; the other removed part of it; remove it all ! src/quick/scenegraph/util/qsgatlastexture.cpp One side changed a preprocessor condition, the other a code condition, on adjacent lines; keep both changes. tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp One side changed a condition, the other the content of its block; keep both. Change-Id: Idb8937f92a7edb28212449dfe0c5cfdb8e6de986
| | * Fix logic bug when deleting properties of JS objectsLars Knoll2016-07-142-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code used the size of the internal class in an inconsistent way. It should simply compute and work with the old internal class size, as that reflects the old object layout. [ChangeLog][QtQml] Fix assertion when deleting properties of JS objects Task-number: QTBUG-54589 Change-Id: Ie3db70437e780215d08a1a96491db75f8b859754 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Minor optimizationSimon Hausmann2016-06-274-0/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I've seen people write property SomeItem myProperty: null This is an unnecessary initialization that ends up creating a binding expression. Generally there's handling missing for null and undefined, but in this very case we should just optimize away the initializer expression, because QObject style properties are initialized to null by default, as opposed to undefined. Change-Id: I7af4cd45461304753c93cef3926f6e92d3b6c95d Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | V4: Pass scope around as parameters inside the runtime.Erik Verbruggen2016-06-221-6/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The implementation of many (or all) runtime functions consist of first creating a QV4::Scope, which saves and restores the JS stack pointer. It also prevents tail-calls because of that restoring behavior. In many cases it suffices to do that at the entry-point of the runtime. The return value of a JS function call is now also stored in the scope. Previously, all return values were stored in a ScopedValue, got loaded on return, and immediately stored in another ScopedValue in the caller. This resulted in a lot of stores, where now there is only one store needed, and no extra ScopedValue for every function. Change-Id: I13d80fc0ce72c5702ef1536d41d12f710c5914fa Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-05-135-1/+78
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/jsapi/qjsengine.cpp src/qml/qml/qqmlengine_p.h src/quick/items/qquickanchors.cpp src/quick/items/qquickanimatedimage_p_p.h src/quick/items/qquickitem_p.h tests/auto/qml/qqmlecmascript/testtypes.h tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp tests/benchmarks/qml/creation/tst_creation.cpp Change-Id: I65861e32f16e8a04c7090a90231627e1ebf6ba6f
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-05-062-0/+25
| |\| | | | | | | | | | Change-Id: I3c6a93917cb46868cdb9dd50566b90c70f67102e
| | * Fix crash when trying to call a property of the scope or context objectSimon Hausmann2016-05-012-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For calls on properties of the scope or context object the thisObject parameter in the callData is a reference to the QmlContext, not a real object - therefore the toString conversion fails. Task-number: QTBUG-52340 Change-Id: I08d01cc5c05920c2fac46ddd40fa41e630bcade3 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
| * | Add QVector support to JS sequencesKevin Ottens2016-05-033-1/+39
| | | | | | | | | | | | | | | | | | Change-Id: I731355aa1754721236f3711a65af4f96781cebc0 Task-number: QTBUG-51467 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-04-272-0/+14
| |\| | | | | | | | | | | | | | | | | | | | | | Conflicts: src/quick/items/qquickimagebase.cpp src/imports/layouts/plugin.cpp Change-Id: I5f48474df4034a1347ec74795c85d369a55b6b21
| | * Also match QJSValue conversion types in MatchScore.Michael Bruning2016-04-202-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This had the effect that overloaded methods were always mapped to the wrong slot. [ChangeLog][QtQml][Important Behavior Changes] When matching the method signature of a invokable method to the slot in the metaobject, the matching function now assigns the best match to a QJSValue if the parameter actually is a QJSValue. This corrects the previous behavior, where QJSValue and int were given the same match score even though QJSValue would have been the best match. Task-number: QTBUG-51746 Change-Id: I906e7b006ee5af92ea760ed1625e5047aef123bf Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>