aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml
Commit message (Collapse)AuthorAgeFilesLines
* Unify deleteProperty and deleteIndexedProperty vtable methodsLars Knoll2018-06-2615-80/+69
| | | | | Change-Id: I25245818c6ff2104642594476cb9684bac824f29 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Move special handling of getOwnProperty for StringObject where it belongsLars Knoll2018-06-263-10/+23
| | | | | | | | Move the code into a virtual method of StringObject, bringing us closer in line with the ES7 spec. Change-Id: Iaf460f5a5517fe059a30be8c403d71625453b80a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix string memory leak in JavaScript ASTSimon Hausmann2018-06-257-20/+27
| | | | | | | | | | | | | Commit 02252ae08d introduced a QString member in a JS memory pool class, which leaks unfortunately as the pool is not designed to call destructors of allocated types. Typically strings in the AST are derived from input and therefore a QStringRef is fine. The bindingIdentifier in the PatterElement however is sometimes synthesized, so a separate storage for dynamically allocated strings in the memory pool allows for using QStringRef again. Change-Id: I94d090df653d784c554452722b3b759031e4735b Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* doc: Remove hint to use not recommended constructorRainer Keller2018-06-251-3/+0
| | | | | | | | | The documentation of QQmlListProperty states that this constructor should not be used in production code. Removing this statement prevents users from unintentional usage. Change-Id: I19130204384d5dbef79cec828de49a628af60c02 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Improve error messageRainer Keller2018-06-251-1/+2
| | | | | | | | | Show information about used types to help the user determine what went wrong. Change-Id: Ia71f21ee2bd53ba751bf0a3f7718f949d0e8330d Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Add defaultLogLevel to LoggingCategoryTomasz Olszak2018-06-253-4/+49
| | | | | | | | | | | | | Add possibility to define default logging category log level. Just like in QLoggingCategory constructor. [ChangeLog][QML Elements][LoggingCategory] Added defaultLogLevel property. It is possible to define default log level that LoggingCategory is enabled for. Task-number: QTBUG-67094 Change-Id: I12557dfb7c228c40b325d0dccde4c525acae0300 Reviewed-by: Michael Brasser <michael.brasser@live.com>
* Merge "Merge remote-tracking branch 'origin/5.11' into dev" into ↵Liang Qi2018-06-2526-52/+93
|\ | | | | | | refs/staging/dev
| * Merge remote-tracking branch 'origin/5.11' into devUlf Hermann2018-06-2526-52/+93
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/qmltooling/packetprotocol/qpacketprotocol.cpp src/quick/handlers/qquickhandlerpoint.cpp src/quick/handlers/qquicksinglepointhandler.cpp tests/auto/qml/ecmascripttests/test262 Change-Id: I8908ec8c6116ca626fbd269af7625d4c429429ca
| | * Doc: Move literal codeblocks to snippet filesVenugopal Shivashankar2018-06-223-6/+58
| | | | | | | | | | | | | | | Change-Id: Iff45ea6cf414717fd1cb0a194eef390a9f153838 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
| | * Fix crash in binding setup during async load from a LoaderErik Verbruggen2018-06-211-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change 91ac4a8d099d10fdfd5aa631da02727b7917d85f removed the source location from QQmlBindingFunction, because it can be retrieved from the QV4::Function in the QV4::CppStackFrame. However, if a binding is initialized as part of an asynchronous load from a Loader component, there might not be a valid function pointer in that frame. In this specific case, we fall back to the source location of the binding function. Task-number: QTBUG-68738 Change-Id: I2d3f17e4cb82be1e70a54cb66f9cf9c17f541f95 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| | * Script::parse(): improve "function expressions as statement" error msgMitch Curtis2018-06-201-3/+4
| | | | | | | | | | | | | | | Change-Id: I3c54c90bfa48d2f6ba78b898413133e49b66c208 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| | * revert change 353164263c55825a0ec72d30128c50560c626334Lars Knoll2018-06-194-18/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The change was too aggressive in trying to avoid marking the array data. We didn't catch all cases where on could be inserting a GC controlled object into the array data. Let's be safe and always mark the content of array data objects. Task-number: QTBUG-68894 Change-Id: Ifbb628be898c0903596b1a483212384295b01df5 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
| | * Doc: Add missing dots (qtdeclarative)Paul Wicking2018-06-1918-24/+24
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-68933 Change-Id: Ibb5aa227e82825085e7214e17dcffcb17fd44157 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* | | Fix compiler warningSimon Hausmann2018-06-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | qml/qqmlmetatype.cpp:1876:58: warning: ‘QString::QString(const char*)’ is deprecated: Use fromUtf8, QStringLiteral, or QLatin1String [-Wdeprecated-declarations] Element names that are const char * in the API are expected to be UTF-8 encoded. Change-Id: I12aab141e4a4d03ca3a025e8575c80dfea5242fe Reviewed-by: Richard Weickelt <richard@weickelt.de> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | Fix a smaller spec incompatibility in ProxyLars Knoll2018-06-251-7/+7
| | | | | | | | | | | | | | | | | | | | | A null trap is also allowed. Change-Id: I9dd2548c27c6341dc9ad725fb5be5bebd6c04b9a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Add Proxy support for prototype handlingLars Knoll2018-06-2519-96/+195
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cleanup get/setPrototypeOf and fix some smaller incompatibilities in the default implementation for Object. Add the methods to the vtable and reimplement them according to spec for ProxyObjects. Clean up the Object.prototype.get/setPrototypeOf/__proto__ methods and fix a smaller bug in the Reflect API for those methods. Change-Id: I6e438753332ec4db963d6cdcf86f340ff212777a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Support preventExtensions in Proxy handlersLars Knoll2018-06-256-3/+46
| | | | | | | | | | | | | | | Change-Id: I03aaacc260bdb46eb09c597598a45fbb25d6d7b6 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Add support for isExtensible in proxy handlersLars Knoll2018-06-254-1/+41
| | | | | | | | | | | | | | | Change-Id: I580ff0ab33fa58bcd42f6cc500f4a20ee5b05e87 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Fix length properties of global constructorsLars Knoll2018-06-255-4/+5
| | | | | | | | | | | | | | | Change-Id: I4e9e1635f404082b0e8b333dc13a33d27e4f4b50 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Implement support for getOwnPropertyDescript and has in Proxy objectsLars Knoll2018-06-252-0/+109
| | | | | | | | | | | | | | | Change-Id: Ie7a15afebdfbad31738d2d944d4128065b8a611f Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Add virtual interface for hasPropertyLars Knoll2018-06-256-45/+32
| | | | | | | | | | | | | | | | | | | | | This is required to correctly support Proxy Change-Id: I95ec17e919915290a05ad9501cd649452ab82135 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Fix a source of potential bugs in the Identifier tableLars Knoll2018-06-251-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | Make sure we never add strings that represent array indices into the identifier table. Change-Id: Ib4a500d44b6ff58a71b7a55053c9be9f2580aea8 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Implement a virtual interface for getOwnPropertyLars Knoll2018-06-2521-191/+135
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is required to support Proxy properly, and at the same time fixes a couple of test failures. The new interface also replaces the old query and queryIndexed virtual interfaces, as those where doing a subset of what getOwnProperty does. Change-Id: I750e366b475ce971d6d9edf35fa17b7a2b07f771 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Partial Proxy supportLars Knoll2018-06-258-0/+400
|/ / | | | | | | | | | | | | | | get, set and deleteProperty proxying is implemented, the others require some more changes in our engine. Change-Id: I4dd4b154b1a582f5e36cdc9429fa049fd37d5167 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Clean up finally code genSimon Hausmann2018-06-231-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of emitting GetException MoveReg <returnvaluetemp>, <returnaddress> StoreReg <exceptiontemp> ... LoadReg <exceptionTemp> MoveReg <returnvaluetemp>, <returnaddress> SetException and implicitly relying on MoveReg to not clobber the accumulator, it's cleaner to produce MoveReg <returnvaluetemp>, <returnaddress> GetException StoreReg <exceptiontemp> ... MoveReg <returnvaluetemp>, <returnaddress> LoadReg <exceptionTemp> SetException Change-Id: I3c392ba5fb75aa2ad3ef32aa776fa7acbc25317c Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Add run time assertion for local handlingSimon Hausmann2018-06-231-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | Commit f44782d0cdbdb800d9c31d5aff712fbf29d52edc fixed the missing call context creation that would lead to language/statements/break/S12.8_A2.js failing. It wouldn't always fail as the invalid cast from the global context to a call context would access memory that happens to be available just for the test. An assertion however will not require us to rely on memory setup. Change-Id: I131a2242004cd5e4d518e58cc9f6a79037f962d2 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Fix remaining failues with qjstest --jitSimon Hausmann2018-06-223-2/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The codegen generates code like this for the unwind handling: GetException MoveReg <somereg>, <return value reg> SetException In the interpreter, MoveReg doesn't clobber the accumulator, but in the JIT it did. Change-Id: I7a9c8200468115ca37403ec8a0d511210e2b25fd Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Fix language/expressions/equals/coerce-symbol-to-prim-return-prim.js with JITSimon Hausmann2018-06-222-129/+122
| | | | | | | | | | | | | | | | | | Use the same method for comparing values for the JIT as well as the interpreter, so that the test passes with interpreter as well as the JIT. Change-Id: I2e0249d8e915c816a64adc922839cb71f0e065db Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Improve GC safety of compare functionSimon Hausmann2018-06-221-5/+32
| | | | | | | | | | | | | | | | | | When comparing values we may end up calling user-defined conversion functions, which in turn may accidentally end up triggering the GC. So any intermediate managed values we fetch, we must save on the JS stack. Change-Id: I810a46f740f22f8fd71a83ed362301cfc822190d Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | QQmlDebugConnector: Don't complain about new pluginKey if it's unchangedUlf Hermann2018-06-221-1/+1
| | | | | | | | | | | | | | | | We cannot set the plugin key to a new value if we've already instantiated the plugin. Setting the same value again, is a noop, though. Change-Id: Ib2d2cb3dc20d8d3d7f1673957970f5235e3aeccc Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Enable perf map writing on all platformsErik Verbruggen2018-06-211-3/+1
| | | | | | | | | | | | | | | | This is controlled by a environment variable, so the code won't be executed if not explicitly asked for. Change-Id: Iec7be17ae1f21f604064e12f35ffe24be0407760 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Check that toObject() didn't failLars Knoll2018-06-211-0/+2
| | | | | | | | | | | | | | | | Avoid a crash below if the toObject call failed and threw an exception. Change-Id: I82a12c5cd8892c176d345d7f4b0cf3297357f272 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Extend V4's Math object with methods new in ES6Edward Welbourne2018-06-212-5/+206
| | | | | | | | | | | | | | | | | | | | Added: acosh, asinh, atanh, cbrt, clz32, cosh, expm1, fround, hypot, imul, sinh, tanh and trunc. Some needed hand-coding for android, whose std:: is defective. Fixed some buglets in existing asin and round in the process. Change-Id: I0858d45430dc0f5944c53723545717ca1ffa6ef7 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Add support for ReflectLars Knoll2018-06-215-1/+364
| | | | | | | | | | | | | | | | Implemented all methods in Reflect, only some smaller bugs left in there. Change-Id: I53d2304d0e59566aec64e200cd995e02afcfc33e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Add support for function calls with spreadLars Knoll2018-06-2110-42/+235
| | | | | | | | | | | | | | | | | | | | | | Function calls with thread are modelled by pushing an empty value in front of every argument that requires spreading. The runtime methods callWithSpread and constructWithSpread then take care of spreading out the arguments. Change-Id: Ie877c59d3d9d08fc5f20d7befb7153c7b716bf30 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Get rid of LoadElement and LoadProperty instruction overloadsLars Knoll2018-06-218-87/+34
| | | | | | | | | | | | | | Always use the overload where the value is in the accumulator. Change-Id: I6a3d81fea7aae957e0cf6efd123d7739f8880c95 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Unify DeleteMember and DeleteSubscript instructionsLars Knoll2018-06-219-92/+34
| | | | | | | | | | | | | | | | The delete operator is rarely used, so it's simpler to unify these into one DeleteProperty instruction. Change-Id: I8c0d4455b35efb03db2ab0010df70030d774a6ae Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Get rid of the unused JumpEmpty instructionLars Knoll2018-06-218-37/+0
| | | | | | | | | | Change-Id: I117687939e0f02d801dbad8de7761b4c799f2035 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Add support for spread expressions in Array literalsLars Knoll2018-06-212-35/+140
| | | | | | | | | | Change-Id: I613d853dbb34d86ebedd871e9676d3206f1e3349 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Provide API to access singletons associated with a QQmlEngineRichard Weickelt2018-06-216-9/+142
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds allows C++ code to retrieve the instance of a registered singleton type. Until now this required a deturn via QML expression. Two methods are added to QQmlEngine: A generic one that encapsulates all singleton objects in a QJSValue and a template function for QObject-derived singleton types. An additional convenience function is added to query the QML type id. This function may also be used for other purposes in the future. [ChangeLog][QtQml][QQmlEngine] Added API to access singletons associated with a QQmlEngine. Task-number: QTBUG-39970 Change-Id: I67c132ede35f80b9aaf1c5e5456715cf4f1b0848 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Variables declared in strict eval code don't all escapeLars Knoll2018-06-211-1/+1
| | | | | | | | | | | | | | | | | | eval() calls in strict mode code create their own context, so even though we don't have a parent context, those variables do not escape, and can be allocated on the stack. Change-Id: Iea1853452fe1f792468fd6108851f04a1acf9b66 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | QQmlDelegateModel: even for QAIM, only use first column by defaultRichard Moe Gustavsen2018-06-212-4/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In 2f9afadd5d9b4899397dca, we introduced a change in QQmlAdaptorModel so that a QAIM model report that it contains "rows * cols" number of model items, and not just "rows". This was needed, otherwise TableView would only display the first column of such models. It turns out, however, that also ListView will now detect that a QAIM contain more items than just the items in the first column. The result will be that it ends up adding all the other columns underneath the first column in the view. To avoid this unforseen change, this patch will revert this logic, and instead add a private variable that can be set if the new behavior is wanted (e.g by TableView). Change-Id: I8c13da99f05e2f922362e498d1fa1779cdbd0d72 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Fix const expressions containing destructuring patternsLars Knoll2018-06-212-2/+1
| | | | | | | | | | | | | | | | Don't throw a syntax error when encountering a destructuring pattern. Change-Id: I93250a2963d2d50ff61d725229e1b51be17689e9 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Fix array destructuring nested in a rest elementLars Knoll2018-06-212-24/+23
| | | | | | | | | | Change-Id: I3a8c15fe221bff04a3b9b21ed8c0b06c04770a3d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Fix more issues with destructuringLars Knoll2018-06-214-30/+50
| | | | | | | | | | | | | | | | | | | | Fix destructuring targets that are complex lhs expressions. There are still some failures remaining, but this fixes another larger chunk of test cases. Change-Id: Icf08f42d7c70d4e81be5d5d2e27ebe6249d25467 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Remove some dead codeLars Knoll2018-06-213-28/+0
| | | | | | | | | | | | | | maxNumberOfArguments isn't used anymore. Change-Id: Ibb891101b971b4b0b01be7897e6d1490e1dde62c Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Fix handling of elisions in destructuring expressionsLars Knoll2018-06-215-24/+17
| | | | | | | | | | | | | | | | We need to iterator over elisions at the end, as those could trigger side effects by calling iterator.next() Change-Id: Ieb5fa3562b6e60fdf179fa228510b2eeaaf9da30 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Fix more test failures for destructuring expressionsLars Knoll2018-06-211-3/+6
| | | | | | | | | | | | | | | | Fix parsing of var { x = function(){} } = ... Change-Id: I524e39c7a556c392a5359eafc445b59020ccadf2 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Correctly set the name of anonymous functions in most casesLars Knoll2018-06-211-0/+6
| | | | | | | | | | | | | | | | If the anonymous function is bound to an identifier, set the name to the identifier. Change-Id: Idbb3170210e6f91cca3c9bd36b2b6ddcb3a50c7b Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Allow a trailing comma in parameter listsLars Knoll2018-06-211-8/+19
| | | | | | | | | | | | | | | | This got changed in ES8, but let's already take this in now, as there are quite a few tests checking this behavior. Change-Id: I73f86b8fd8a681881bcc9cc3132bef1589d5194f Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>