aboutsummaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/v8
Commit message (Collapse)AuthorAgeFilesLines
* Don't enumerate Function.prototype.{connect,disconnect}Kent Hansen2011-08-261-2/+2
| | | | | | | | | | | | | | | QML/JS adds connect and disconnect methods to the standard Function.prototype object. Follow the convention of ECMA-262: Function properties should be non-enumerable. In particular, we don't want such built-in properties to show up in user code "for-in" statements. Task-number: QTBUG-21120 Change-Id: I416106badf35daddf32e16f757d37b2b09e58310 Reviewed-on: http://codereview.qt.nokia.com/3587 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Fix tst_qjsvalue::castToPointer test failureKent Hansen2011-08-244-7/+14
| | | | | | | | | | | | | In order for casting the variant's data() to work, we need to get at the actual QVariant wrapped in the JS object; copying the variant caused a stale pointer to be returned. Task-number: QTBUG-21000 Change-Id: I1a32a70d5a043c94dbbd07ef2c8048e7df7fc7bf Reviewed-on: http://codereview.qt.nokia.com/3309 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com>
* move dom error definitions to seperate files.Charles Yin2011-08-195-53/+171
| | | | | | | Change-Id: I90951ab817230e0160831db3ce2e91ceceab1352 Reviewed-on: http://codereview.qt.nokia.com/3235 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* canvas context2d needs the dom exceptions as well, so share the dom ↵Charles Yin2011-08-192-0/+54
| | | | | | | | | exception definitions Change-Id: I05ab8d87de636944585f4113f07c7d07fe9a79aa Reviewed-on: http://codereview.qt.nokia.com/3233 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Add support for a vector4d type in QMLChris Adams2011-08-182-0/+20
| | | | | | | | | | | | | QVector4D is a value-type which is supported but was not able to be constructed using a Qt object function. This commit allows properties of vector4d type to be constructed, and adds a function to the global Qt object and adds unit tests to ensure that it behaves correctly. Task-number: QTBUG-18559 Change-Id: I96509a4f496b644d20fdb1d977d0afe430d89e13 Reviewed-on: http://codereview.qt.nokia.com/1626 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Enable v8 debuggingAurindam Jana2011-08-173-0/+4
| | | | | | | | | Javascript v8 debugging service replaces the QScript debugging service. Change-Id: I25eea00eed3959b84a8f412e4c3484296d62e27b Reviewed-on: http://codereview.qt.nokia.com/2614 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
* Fix repeated compiler warning about unused engine parameterSimon Hausmann2011-08-172-3/+3
| | | | | | | | | It's unused, remove it :) Change-Id: I75f352dd3e35626603658f78e00cf6b472075df4 Reviewed-on: http://codereview.qt.nokia.com/3074 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* Improve the Qt/JavaScript (QJS) documentationKent Hansen2011-08-153-60/+264
| | | | | | | | | | | | | Make sure all public classes and functions are documented. Fix/remove broken references. Add code snippets. Add a minimal "Making Applications Scriptable" page based on the QtScript docs. Change-Id: I76a32bff776b478f01ff08b3276a0a020a1fa81f Reviewed-on: http://codereview.qt.nokia.com/2863 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com>
* Use the correct export macrosLars Knoll2011-08-113-6/+6
| | | | | | | | | | Otherwise we'll get problems when compiling on Windows. Change-Id: I2a366da3cd4cd08ba8bc8d9c8c81409737bee697 Reviewed-on: http://codereview.qt.nokia.com/2752 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com>
* Replace QScriptBagContainer by QIntrusiveListKent Hansen2011-08-116-184/+49
| | | | | | | | | | | | | | | | | | | | | | | QIntrusiveList effectively does the same as QScriptBagContainer, without the need to inherit a Node class. Let's avoid the code duplication. However, QIntrusiveList::remove() and insert() are less strict than QScriptBagContainer; introduce QScriptIntrusiveList that performs the same sanity checks (no duplicate insertion, etc). Ideally these checks would be merged into QIntrusiveList. Also rename QJSValuePrivate::reinitialize() to invalidate(), and make it not call engine->unregisterValue(this) any more. Values are only invalidated at engine destruction time, and it's the engine's responsibility to erase the list. Change-Id: I60fc61ee8f90a716a285b1dd1bf4d6a08a9349df Reviewed-on: http://codereview.qt.nokia.com/2628 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Guard QML-specific handling of value type property accessKent Hansen2011-08-111-2/+4
| | | | | | | | | | | | When using QJSEngine, there is no QDeclarativeEngine associated with the QV8Engine, so check if it's there first. This was causing the QJS qobject bindings autotest to crash. Change-Id: If2c1d414d615bfbe93580d06555f5c17b0e41eef Reviewed-on: http://codereview.qt.nokia.com/2845 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Code cleanup: unify QRegExp conversion.Jedrzej Nowacki2011-08-101-50/+1
| | | | | | | | | Remove duplicated code for QRegExp conversion. Change-Id: Ic0a6b68a317404ac6d1695f0220f257046b4ba80 Reviewed-on: http://codereview.qt.nokia.com/2703 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com>
* Add missing check in QJSValue::propertyJedrzej Nowacki2011-08-101-0/+2
| | | | | | | | | Only an object can have a property. Change-Id: I032cf3a08f777b6b47cb5a417fa796059bfc9ef5 Reviewed-on: http://codereview.qt.nokia.com/2702 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com>
* Code cleanup: unify string conversions.Jedrzej Nowacki2011-08-102-6/+5
| | | | | | | | | Unify string conversions when there is not any external string wrapper. Change-Id: I6665e33c968b9d1c6ad86595639967ddcd257667 Reviewed-on: http://codereview.qt.nokia.com/2701 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com>
* Code cleanup.Jedrzej Nowacki2011-08-101-8/+10
| | | | | | | | | Remove redundant else conditions. Change-Id: I5795bd931d9204a31e0edfea0d3489c119db1020 Reviewed-on: http://codereview.qt.nokia.com/2700 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com>
* Replace duplicated code by a function call.Jedrzej Nowacki2011-08-101-10/+1
| | | | | | | | | | According to comment the code was copied from QtScript. As the implementation is merged to QtDeclarative we can use common code path. Change-Id: Id603ef0207a1356f8c010a35fe601568a03aac48 Reviewed-on: http://codereview.qt.nokia.com/2699 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com>
* Fix outdated license headers.Jason McDonald2011-08-0520-323/+364
| | | | | | | Change-Id: I81fd41433b03b13befe0b5c68ec248ea71e8c235 Reviewed-on: http://codereview.qt.nokia.com/2596 Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com> Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Remove dead code from QJSValuePrivateKent Hansen2011-08-042-21/+0
| | | | | | | | | | | reinitialize() was used to implement setGlobalObject() and setScriptClass() in the QtScript/V8 port, but those functions will not be part of the new JS API. Change-Id: I030d371659136a407636c7a13afe7623a60a2837 Reviewed-on: http://codereview.qt.nokia.com/2623 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Move QJSValue InvalidValue definition to "inline" headerKent Hansen2011-08-042-24/+23
| | | | | | | | | | | Avoid warning "inline function ‘QJSValuePrivate::QJSValuePrivate()’ used but never defined" when only qjsvalue_p.h is included for a compilation unit. Change-Id: I75bb49dedbfcedf5f71c25210371f03663572b46 Reviewed-on: http://codereview.qt.nokia.com/2620 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Improve QJSValueIterator implementation.Jedrzej Nowacki2011-08-038-138/+221
| | | | | | | | | | | The old implementation was a hack, it had some memory leak (in case of deleted engine) and performance problems (for example all names were copied to separate QList instance instead of reusing v8::Array). Change-Id: Ic70ad511127a8c05df3c627e4496083004c6452a Reviewed-on: http://codereview.qt.nokia.com/2512 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* Ensure that the prototype chain is checked in property GetChris Adams2011-08-025-18/+18
| | | | | | | | | | | | | | This commit ensures that the prototype chain is checked during property Get operations on QObjects and other types in QML by returning an empty handle from the property Get interceptor if no valid property with the given name is found. Task-number: QTBUG-20336 Change-Id: I670ee211c74c0fdcb68c3f91b29fcc0ea8b55d6f Reviewed-on: http://codereview.qt.nokia.com/1477 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com> Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* Add support for comparing value-type propertiesChris Adams2011-08-024-1/+82
| | | | | | | | | | | | This commit allows value-types to be compared with each other and with variants. It also adds a toString() function for each value type, to allow conversion to (and comparison with) string. Task-number: QTBUG-14731 Change-Id: I5bde2820917b2fe19b581724977398680617de34 Reviewed-on: http://codereview.qt.nokia.com/1636 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Merge the QJSEngine and QJSValue development branch into master.Simon Hausmann2011-07-2925-77/+5423
| | | | | | | | | | | | This replaces the dependency to QtScript with two new builtin classes QJSValue and QJSEngine. This is still work in progress, development continues now in the master branch. Change-Id: I7f5487feb45c972f25a22b10cc81b9218b9805de Reviewed-on: http://codereview.qt.nokia.com/2299 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com>
* Fix alias warnings in QV8QObjectWrapperAaron Kennedy2011-07-292-52/+69
| | | | | | | | Task-number: QTBUG-19736 QTBUG-19693 Change-Id: I4f6c56dc4f60224dd79e669099c198b883429f54 Reviewed-on: http://codereview.qt.nokia.com/2363 Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Fix alias warnings in QDeclarativeV8HandleAaron Kennedy2011-07-291-1/+2
| | | | | | | | | Task-number: QTBUG-19736 QTBUG-19693 Change-Id: I1fd1a3146aa7be933f60917a562211142c2460bc Reviewed-on: http://codereview.qt.nokia.com/2360 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Add .arg() for Javascript String typeCharles Yin2011-07-292-0/+22
| | | | | | | | | Change-Id: I973032189c40bfa4d5450396f5bad1a7c81ac68b Task-number:QTBUG-16734 Reviewed-by:Michael Brasser Reviewed-on: http://codereview.qt.nokia.com/2134 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Initial CustomEmitter and CustomAffector implementationAlan Alpert2011-07-282-1/+2
| | | | | | | | Currently basic and can't access all properties. Change-Id: I66efc235112cffcf1a3ca5cc69099a5d09ec7691 Reviewed-on: http://codereview.qt.nokia.com/1950 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Fix translation context for QML files.Michael Brasser2011-07-281-1/+4
| | | | | | | | | | | Use the base file name as done in QtQuick 1, rather than using the entire path. This also fixes QTBUG-17255 for QtQuick 2. Change-Id: Ia27f6539f82d6caf6e7060b89ff1996d42ffb9cb Reviewed-on: http://codereview.qt.nokia.com/2246 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Ouptut non-NOTIFYable warnings againAaron Kennedy2011-07-261-0/+8
| | | | | | | | Task-number: QTBUG-20280 Change-Id: Ia950c8c9dfa14e568a306beeb72474b2d5049db1 Reviewed-on: http://codereview.qt.nokia.com/2069 Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Allow object to be accessed by multiple QDeclarativeEnginesAaron Kennedy2011-07-251-1/+1
| | | | | | | | | Task-number: QTBUG-18610 Change-Id: Idd9444018b5344586d6579ddac6a0ffd26bf7139 Reviewed-on: http://codereview.qt.nokia.com/2075 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Support better boolean conversion semanticsAaron Kennedy2011-07-251-0/+3
| | | | | | | | | Task-number: QTBUG-20242 Change-Id: Ie678f6189a8060de600b5394fbaaaef49be274c6 Reviewed-on: http://codereview.qt.nokia.com/2061 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Compile fix.Kim Motoyoshi Kalland2011-07-211-1/+1
| | | | | | | Change-Id: Ie6e1f814b6791ddc2b02a845ebd8bc20765f7193 Reviewed-on: http://codereview.qt.nokia.com/1941 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
* Fix memory leaks with QV8Engine's ExtensionDataSimon Hausmann2011-07-201-1/+1
| | | | | | | | | | The destructor has to be virtual for Deletable in order to call the destructor of the super-class. Change-Id: I3aeebe28c0a6bbfbbe3b069e88a6096dd9e173f5 Reviewed-on: http://codereview.qt.nokia.com/1867 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Enable support for QObject based module APIsAaron Kennedy2011-07-121-3/+31
| | | | | | | | Task-number: QTBUG-17318 Change-Id: Ia887f563b337b1c34ff65a0559bb7f33c18b4e28 Reviewed-on: http://codereview.qt.nokia.com/1479 Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Extract all QtQuick 1 elements into a separate library/plugin.Martin Jones2011-07-123-3/+3
| | | | | | Change-Id: I41a280de2739ee08202f4be2519e5012870090f2 Reviewed-on: http://codereview.qt.nokia.com/1391 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Implement translation functions for V8Aaron Kennedy2011-07-042-1/+127
| | | | | | | Change-Id: Ida84754969a355e7915233393a552655896ad359 Reviewed-on: http://codereview.qt.nokia.com/1028 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Remove ASCII cache from QStringHashAaron Kennedy2011-07-041-12/+1
| | | | | | | | | | Now that we have symbol ids, we struggle to recover the time spent creating the ascii hash. We can reintroduce it if we need to. Change-Id: Icb2adac6bbe69f94050e57418b7a8a7bfdb7e221 Reviewed-on: http://codereview.qt.nokia.com/1027 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Optimize QDeclarativePropertyCacheAaron Kennedy2011-07-042-6/+6
| | | | | | | | | The creation of QDeclarativePropertyCaches contributes significantly to the initial compile time of a QML app. Change-Id: Iac5d1578155dfa4678a0e21eab51f4c1675762a9 Reviewed-on: http://codereview.qt.nokia.com/1026 Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Don't exceed SMI boundsAaron Kennedy2011-07-041-7/+7
| | | | | | | | | | If we use an integer that is greater than the maximum SMI value on 32-bit systems (like ARM), v8 allocates the integer as a HeapNumber which is unbelievably slower. Change-Id: I518b5947627631a2621344b656afa0dde002fe82 Reviewed-on: http://codereview.qt.nokia.com/1025 Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* CompileAaron Kennedy2011-07-041-2/+2
| | | | | | | Change-Id: I3bc97df3cb768bcfba6581a291c6a8136cec8a92 Reviewed-on: http://codereview.qt.nokia.com/1024 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Improve performance of v8 string hashes by using symbol idAaron Kennedy2011-07-011-11/+38
| | | | | | | | | | | The symbol id is a unique integer associated with a string symbol in V8. If two symbol ids are equal, then the strings are also equal. However, if the two symbol ids are not equal, the strings may still be equal. Change-Id: Ic28f51a1eba568ae4b2a054e278f6e5e454725d6 Reviewed-on: http://codereview.qt.nokia.com/990 Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Variants should compare as equalAaron Kennedy2011-07-012-0/+33
| | | | | | | | | | | | We need to implement an object comparison callback to ensure that two variants with identical values (although different JS objects) compare as equal. We also add a v8 autotest for this callback. Change-Id: Idd1ab602d31b398a937d4df4a7bd091aa205de24 Reviewed-on: http://codereview.qt.nokia.com/989 Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Add toString for variantsAaron Kennedy2011-07-012-1/+34
| | | | | | Change-Id: Ia64adeb3640f7f7eedccd7015de729969232a07f Reviewed-on: http://codereview.qt.nokia.com/987 Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Support refreshing V8 bindingsAaron Kennedy2011-06-221-0/+8
|
* Optimize common binding writesAaron Kennedy2011-06-201-2/+2
|
* Reenable shared bindingsAaron Kennedy2011-06-202-5/+5
| | | | Now with extra "supports nested components" goodness.
* Evaluate all shared bindings together using a shared contextAaron Kennedy2011-06-173-0/+331
| | | | | | The vast majority of bindings are capable of being shared (that is, don't introduce closures themselves) and consequently this improves the performance of almost every app.
* Add "shared mode" to QML contextsAaron Kennedy2011-06-162-7/+38
|
* Fix autotestsAaron Kennedy2011-06-153-10/+24
|
* Correct handling of CONSTANT propertiesAaron Kennedy2011-06-151-1/+1
| | | | Were being marked as missing a notifier instead.