summaryrefslogtreecommitdiff
path: root/src/libs/qmljs/qmljsinterpreter.cpp
Commit message (Collapse)AuthorAgeFilesLines
* QmlJS: Add protection against attached types attaching to themselves.Christian Kamm2011-12-021-1/+1
| | | | | | | | Change-Id: Ib81d5e6baabf5ac8d18411e8936098908de2c2bb Task-number: QTCREATORBUG-6635 Reviewed-by: Leandro Melo <leandro.melo@nokia.com> (cherry picked from commit 25842cb13a18ec946fe80b6d869f2b00dbd2ce9c) Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
* QmlJS: Fixed attached objects.Christian Kamm2011-11-071-13/+7
| | | | | | Task-number: QTCREATORBUG-6450 Change-Id: Idd8e2ec3550190a137dbf0fe452c8488fb3fe1ad Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
* all: s/info@qt.nokia.com/qt-info@nokia.com/hjk2011-11-031-2/+2
| | | | | Change-Id: If18afb5d4665924e7d9250dccbc60a65e6daa75e Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
* QmlJS: Avoid an infinite loop if a qmltypes file has a cycle.Christian Kamm2011-10-311-8/+24
| | | | | | | | | | | | | The qmltypes files shipped with libraries shouldn't, but could define components that form a prototype cycle. Use of the new QmlObjectValue::prototypes() function avoids the code model getting stuck in an infinite loop for these cases. For plain ObjectValues this is already solved by using PrototypeIterator. Change-Id: I0f562672ab99b454bc3a0121c7a1b9eca43476bb Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
* QmlJS: Support .import directives in js files.Christian Kamm2011-09-281-24/+74
| | | | | | | | | | | * Allow .import... * Fix parsing of JS files when using Lexer::scanDirectives() * Clean up ImportInfo construction. * Rename ImportInfo::id to ImportInfo::as. Change-Id: I888da248f06dc6184db99aa74c3b50d7f2f5e491 Reviewed-on: http://codereview.qt-project.org/5625 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* QmlJS: Fix crash.Christian Kamm2011-09-271-1/+1
| | | | | | Change-Id: Ieacc7896eaeb478c6bd79a0865280f0cb595101e Reviewed-on: http://codereview.qt-project.org/5619 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
* QmlJS: Fix threading issue in QmlObjectValue.Christian Kamm2011-09-271-12/+14
| | | | | | | | Still need to get rid of the lock in ValueOwner::registerValue. Change-Id: If9bbc548de54edf52805906aaaf730f5c66573dd Reviewed-on: http://codereview.qt-project.org/5542 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
* QmlJS: Separate metaObjectRevision from minor version number.Christian Kamm2011-09-261-12/+32
| | | | | | | | | | | | | | | | | | They need not to be identical. Additionally: * Rename ImportInfo::name to path, because that's what it does. * Add ImportInfo::name, for getting the uri with the names separated by dots. * Allow for exportMetaObjectRevisions in qmltypes files. * Allow for exports with an empty type name, as generated by qmlRegisterRevision. They are used for associating meta object revisions with non-exported types. * Rewrite the Qt 4.7 import to QtQuick 1.0 at an early stage. In preparation for the Qt 5 type information update, where Qt 4.7 is gone. Change-Id: Ia287193623d9530a56b9eb8d2481d50aabd94c3e Reviewed-on: http://codereview.qt-project.org/5309 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
* QmlJS: Fix enum completion with 'as' imports.Christian Kamm2011-09-191-0/+27
| | | | | | Change-Id: Ifc229c23c14a6395c9d3e5f7ec76b9b04678787d Reviewed-on: http://codereview.qt-project.org/5134 Reviewed-by: Thomas Hartmann <Thomas.Hartmann@nokia.com>
* QmlJS: Rework exported C++ type registry.Christian Kamm2011-09-191-168/+130
| | | | | | | | | | | | | | | | The problem was that if you exported A 1.0, A 1.1 and B 1.0 where A is the prototype of B the code model had not enough information to know that, depending on the import, B 1.0's prototype should be A 1.1 or A 1.0. To solve this problem QmlObjectValues now store the import's version as well as the local component version. In the example above B 1.0 would have import version 1.1 if the 1.1 module was imported and thus be able to choose the right prototype. Change-Id: I7ef33f12ca5a528c62b2a8240f4b5720b0ebd4c3 Reviewed-on: http://codereview.qt-project.org/5129 Reviewed-by: Thomas Hartmann <Thomas.Hartmann@nokia.com>
* QmlJS: Change from QMap to QHash for QString keys.Christian Kamm2011-09-191-1/+1
| | | | | | | | | Tests indicate that lookup in QHash<QString, ...> is more performant even for short strings. Change-Id: I8e5a73d0f1a72e202522f397b16901887f9c3591 Reviewed-on: http://codereview.qt-project.org/5070 Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
* QmlJS: When completing enums, add Item.Foo instead of "Foo".Christian Kamm2011-09-151-10/+13
| | | | | | Change-Id: I9a74bd726d9691ca93477916159a80c04c35f52d Reviewed-on: http://codereview.qt-project.org/4987 Reviewed-by: Thomas Hartmann <Thomas.Hartmann@nokia.com>
* QmlJS: Improve completion of signals.Christian Kamm2011-09-141-17/+42
| | | | | | | | | | | | * Change from Reference to FunctionValue: There was no reason for them being References as the argument types never need lookup. * Enumerate in global completion: When you define 'signal foo(int a)' you now get completion for 'foo' and will get the function argument hint popup. Change-Id: Ic348db477a34ba468dfdb690499a9cd8fd605cd2 Reviewed-on: http://codereview.qt-project.org/4774 Reviewed-by: Thomas Hartmann <Thomas.Hartmann@nokia.com>
* QmlJS: Adjust existing code for updated QML parser.Christian Kamm2011-09-141-17/+18
| | | | | | Change-Id: I153723eeb9973be025daf47e317f7b9d076a3c72 Reviewed-on: http://codereview.qt-project.org/4733 Reviewed-by: Thomas Hartmann <Thomas.Hartmann@nokia.com>
* QmlJS: Enable 'follow symbol' for local variables.Christian Kamm2011-09-141-0/+8
| | | | | | | Task-number: QTCREATORBUG-6094 Change-Id: Icf286bc412b48dbd1cb38c47ad7b91040b5aae0f Reviewed-on: http://codereview.qt-project.org/4864 Reviewed-by: Thomas Hartmann <Thomas.Hartmann@nokia.com>
* QmlJS: Fix reference lookup cycles.Christian Kamm2011-09-121-7/+7
| | | | | | | | | | Since several reference lookups involve Evaluate which may cause further reference lookups, we need to be able to pass the existing ReferenceContext to avoid cycles. Change-Id: I2f1eeaad4d6b6ff094413d51077b03c985f6fab4 Reviewed-on: http://codereview.qt-project.org/4653 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
* QmlJS: Fix lookup for enums.Christian Kamm2011-09-051-26/+39
| | | | | | | | | | * Also look for enums in prototypes. * Report back which QmlObjectValue had the enum. * Fix a bug where enum lookup was always skipped. Change-Id: I9c9fd8f8cf9bd8cc5f1bb5688fef5786267cd794 Reviewed-on: http://codereview.qt.nokia.com/4192 Reviewed-by: Thomas Hartmann <Thomas.Hartmann@nokia.com>
* QmlJS: Add XMLHttpRequest, DB API and JSON completion.Christian Kamm2011-08-091-3/+18
| | | | | | Change-Id: I30773e8879086c1f85d331fabf9380e217b32dd7 Reviewed-on: http://codereview.qt.nokia.com/2745 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
* QmlJS: Remove Interpreter namespace.Christian Kamm2011-08-081-16/+16
| | | | | | | | | The distinction between QmlJS and QmlJS::Interpreter has always been weak and the extra namespace just added an unnecessary complication. Change-Id: I4db8ef4bd91b5f6bf610a9d23fdbf55bd60250fc Reviewed-on: http://codereview.qt.nokia.com/2743 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
* QmlJS: Share Context.Christian Kamm2011-08-081-5/+15
| | | | | | | | | | | | Previously Context was not entirely thread safe and had to be copied locally. Now it is thread safe and its lifetime managed by QSharedPointer. The non-safe parts were moved into ScopeChain in a previous commit. Change-Id: I851a93de85cbd6391dbea0fe33b011e2e093addb Reviewed-on: http://codereview.qt.nokia.com/1695 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
* QmlJS: Split Context and ScopeChain.Christian Kamm2011-08-081-92/+26
| | | | | | | | | | | | Context is created by Link and has information about imports for all Documents in a Snapshot. ScopeChain represents how lookup is done at a specific place in a Document. Change-Id: I874102d57bbaf1a497fa3f27633bed6ee75dcf10 Reviewed-on: http://codereview.qt.nokia.com/1694 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
* QmlJS: Fix type lookup issue.Christian Kamm2011-07-151-0/+3
| | | | | | | | | 0c0ffab1bbc56e6cc381eeba3dc1227793d766cd accidentally always returned null if the type was not an enum. Change-Id: Ie16d96e59cefa50c345cddb4a053fd8b60ba3cd6 Reviewed-on: http://codereview.qt.nokia.com/1693 Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
* avoid allocating QmlEnumValues each timeFawzi Mohamed2011-07-131-4/+13
| | | | | | | Change-Id: I61f39f5bafcb2c84e91f5bca4b52010a08ed9f37 Reviewed-on: http://codereview.qt.nokia.com/1592 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Christian Kamm <christian.d.kamm@nokia.com>
* QmlJS: Dump builtins per Qt version.Christian Kamm2011-07-111-17/+5
| | | | | | | Change-Id: I7b5179c4b33c24e83baf0536d158dd48d277637f Reviewed-on: http://codereview.qt.nokia.com/1305 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
* QmlJS: Make 'length' property available on all FunctionValues.Christian Kamm2011-07-051-12/+1
| | | | | | Change-Id: I62bb8f41177521db1f3213d6bd804d8e4852560d Reviewed-on: http://codereview.qt.nokia.com/1044 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
* QmlJS: Remove deprecated enum functions in QmlObjectValue.Christian Kamm2011-07-051-27/+0
| | | | | | Change-Id: I30c1636f4946f465e5924493e561310f506df3d7 Reviewed-on: http://codereview.qt.nokia.com/1043 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
* QmlJS: Move Context to its own file.Christian Kamm2011-07-051-140/+1
| | | | | | Change-Id: I91331b7039e27e2f57cc19b985c8ed86c955ec9e Reviewed-on: http://codereview.qt.nokia.com/1042 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
* QmlJS: Enforce Context always being linked.Christian Kamm2011-07-051-9/+3
| | | | | | | | The default way of creating a Context is through Link. Change-Id: Ia81f7ce90ba2b33d02eed432a61be836d404bedd Reviewed-on: http://codereview.qt.nokia.com/1041 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
* QmlJS: Remove unused methods from ContextChristian Kamm2011-07-051-11/+0
| | | | | | Change-Id: I1e4a013ee11f9747d6936c15bf81e971ca4e4f23 Reviewed-on: http://codereview.qt.nokia.com/1040 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
* QmlJS: Rename Interpreter::Engine -> ValueOwnerChristian Kamm2011-07-051-962/+110
| | | | | | | | Also move to a separate file. Change-Id: I05910e8cf04a533b5d09a1c16e612e3b99b1d606 Reviewed-on: http://codereview.qt.nokia.com/1039 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
* QmlJS: Respect the REVISION property for methods and properties.Christian Kamm2011-06-231-2/+7
| | | | | | | Task-number: QTCREATORBUG-3907 Change-Id: Ic2c1f8cafe381e5216ae7ad73502ca0fae20dda0 Reviewed-on: http://codereview.qt.nokia.com/656 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
* QmlJS: Fix completion of 'anchors.'.Christian Kamm2011-06-231-7/+7
| | | | | | | | | | The hasChildInPackage function was broken, so we completed 'anchors:' instead. Task-number: QTCREATORBUG-5180 Change-Id: I0e0d68aec3cf4e5bea991e39169beecf541ce477 Reviewed-on: http://codereview.qt.nokia.com/643 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* QmlJS: Always generate a onXyzChanged slot.Christian Kamm2011-06-231-8/+25
| | | | | | | | | Even if the NOTIFY signal listed for the property has a different name. Task-number: QTCREATORBUG-3614 Change-Id: I748cddab89732acd6a56b243610be52873225064 Reviewed-on: http://codereview.qt.nokia.com/637 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* QmlJS: Setup QmlEnumValues even if enum is non-local.Christian Kamm2011-06-221-5/+20
| | | | | | Change-Id: Ib7a3621c14b6dfbdf36c75abac282c08f47e55ca Reviewed-on: http://codereview.qt.nokia.com/559 Reviewed-by: Thomas Hartmann <Thomas.Hartmann@nokia.com>
* QmlJS: Add qsTr and friends to code model.Christian Kamm2011-06-211-4/+9
| | | | | | Change-Id: I9a16549da341500fc273ebbc480d7aa901b17e41 Reviewed-on: http://codereview.qt.nokia.com/548 Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
* Qmljs: find usages for types and packagesFawzi Mohamed2011-06-061-2/+4
| | | | | | | | | detects and finds usages of types and packages in qml and javascript Change-Id: Id13f48e435258ff10ab3e6f49049f7bb602a900f Reviewed-on: http://codereview.qt.nokia.com/277 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Christian Kamm <christian.d.kamm@nokia.com>
* QmlJS: Fix potential linking problem.Christian Kamm2011-05-301-9/+7
| | | | | | | | | Don't use plugin from libs/qmljs. Change-Id: Ia345c567cd1f244ab2191017810ef3eeb91fe0e4 Reviewed-on: http://codereview.qt.nokia.com/213 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com> Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
* QmlJS: Import 'as' has precedence over types imported without as.Christian Kamm2011-05-301-1/+14
| | | | | | Change-Id: Iece286c9d1725d2bb1e3eff57cd73af97dd8c748 Reviewed-on: http://codereview.qt.nokia.com/181 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
* QmlJS: Output qmltypes parse warnings to General messages pane.Christian Kamm2011-05-301-17/+31
| | | | | | Change-Id: I8ca100ef141082c7606bb98f8a2f81502b14e1af Reviewed-on: http://codereview.qt.nokia.com/204 Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
* QmlJS: Read the 'revision' property generated by qmldump.Christian Kamm2011-05-301-432/+0
| | | | | | Change-Id: Ia31b1845b1e1e5aabc347dc115e580c72e36f4e3 Reviewed-on: http://codereview.qt.nokia.com/200 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* QmlJS: Separate imported types and imported JS scopes.Christian Kamm2011-05-271-32/+100
| | | | | | | Task-number: QTCREATORBUG-4981 Change-Id: I06d3e428ca4928296a3d5977aeff29fc3217c37c Reviewed-on: http://codereview.qt.nokia.com/175 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
* QmlJS: Initialize error state in PrototypeIterator.Christian Kamm2011-05-251-0/+1
| | | | | | | Change-Id: I231b847607d0558080d0dc0b6392bae5b833d65a Reviewed-on: http://codereview.qt.nokia.com/107 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
* QmlJS: Refactor ObjectValue members.Christian Kamm2011-05-241-86/+85
| | | | | | | | | | | * property -> lookupMember * setProperty -> setMember * removeProperty -> removeMember Change-Id: I638479ee2b90b684283e714630bdcab237f6b3f2 Done-with: Fawzi Mohamed Reviewed-on: http://codereview.qt.nokia.com/77 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
* QmlJS: Find prototype resolution errors.Christian Kamm2011-05-201-4/+28
| | | | | | | | | | To avoid lots of follow-up errors where the root cause is a failed prototype resolution or a prototype cycle. Task-number: QTCREATORBUG-4952 Change-Id: Id474c8c6c152c993aca8c6c421b6d88eb1481676 Reviewed-on: http://codereview.qt.nokia.com/36 Reviewed-by: Thomas Hartmann <Thomas.Hartmann@nokia.com>
* QmlJS: Add tooltips to imports.Christian Kamm2011-05-121-5/+11
| | | | Task-number: QTCREATORBUG-4814
* QmlJS: Update to new QmlJS parser.Christian Kamm2011-05-121-3/+3
| | | | UiPublicMember is now initialized with a statement.
* Fix/add copyright headersTobias Hunger2011-05-061-1/+1
| | | | Change-Id: I8b73d583be1ee7183f4074bce49d5390e38631a2
* QmlJS: Stop doing significant work in constructors.Christian Kamm2011-05-061-0/+1
| | | | | | To avoid order-of-initialization problems. Reviewed-by: Thomas Hartmann
* Compilation fixPawel Polanski2011-05-041-1/+1
|
* QmlJS: Fix type detection for alias properties.Christian Kamm2011-05-041-4/+23
| | | | Task-number: QTCREATORBUG-2306