qtdeclarative/tests/auto/qml
Ulf Hermann b6cf0672e6 Allow limited extensions to globals
We can allow

a, overriding data members of globals, such as Error.name
b, adding members that don't clash with any internals
c, any manipulation of toString(), toLocaleString(), valueOf(),
   and constructor

To that effect, add a "Locked" flag to our internal classes. If that is
set, disallow changing prototypes and when defining a property, check if
it shadows any non-configurable property. Furthermore, make all
non-primitive properties that are not meant to be overridden
non-configurable and non-writable.

constructor, toString(), toLocaleString() and valueOf() are exempt
because they are explicitly meant to be overridden by users. Therefore,
we let that happen and refrain from optimizing them or triggering their
implicit invocation in optimized code.

[ChangeLog][QtQml][Important Behavior Changes] The JavaScript global
objects are not frozen anymore in a QML engine. Instead, they are
selectively locked. You can extend the objects with new members as long
as you don't shadow any existing methods, and you can change or override
data members. This also means that most methods of Object.prototype,
which was previously exempt from the freezing, cannot be changed
anymore. You can, however, change or override constructor, toString(),
toLocaleString() and valueOf() on any prototype. Those are clearly meant
to be overridden by user code.

Fixes: QTBUG-101298
Task-number: QTBUG-84341
Change-Id: Id77db971f76c8f48b18e7a93607da5f947ecfc3e
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-09-07 16:57:25 +02:00
..
animation CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers 2022-07-28 14:58:42 +02:00
bindingdependencyapi CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers 2022-07-28 14:58:42 +02:00
debugger CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers 2022-07-28 14:58:42 +02:00
ecmascripttests QML: Make modules imported with registerModule() available in QML 2022-09-02 15:33:31 +02:00
linebylinelex Fix cmake warnings from using deprecated PUBLIC_LIBRARIES 2022-09-06 22:18:52 +02:00
parserstress CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers 2022-07-28 14:58:42 +02:00
qjsengine Parser: Preserve keywordiness of "static" across nested classes 2022-08-30 18:53:01 +02:00
qjsmanagedvalue CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers 2022-07-28 14:58:42 +02:00
qjsonbinding JSON: Properly handle bad objects in JSON.stringify() 2022-08-07 18:08:49 +00:00
qjsprimitivevalue CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers 2022-07-28 14:58:42 +02:00
qjsvalue CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers 2022-07-28 14:58:42 +02:00
qjsvalueiterator CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers 2022-07-28 14:58:42 +02:00
qmlbasicapp Avoid target name conflict 2022-07-27 00:31:42 +02:00
qmlcachegen CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers 2022-07-28 14:58:42 +02:00
qmlcppcodegen QmlCompiler: Prevent lookup of value type where we need an object type 2022-08-30 18:53:01 +02:00
qmldiskcache CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers 2022-07-28 14:58:42 +02:00
qmlformat qmlformat: Preserve variable declaration scope type 2022-08-11 08:46:05 +02:00
qmlimportscanner CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers 2022-07-28 14:58:42 +02:00
qmllint Disable qmllint's deferred property check 2022-08-31 13:09:32 +02:00
qmlplugindump CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers 2022-07-28 14:58:42 +02:00
qmlsplitlib Add license headers to cmake files 2022-07-08 10:41:06 +02:00
qmltc qmltc: test support for generalized group properties 2022-09-01 22:12:32 +02:00
qmltc_manual Add license headers to cmake files 2022-07-08 10:41:06 +02:00
qmltc_qprocess Add license headers to cmake files 2022-07-08 10:41:06 +02:00
qmltyperegistrar qmltyperegistrar: test warnings about duplicate exports 2022-08-05 13:03:34 +02:00
qqmlanybinding CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers 2022-07-28 14:58:42 +02:00
qqmlapplicationengine CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers 2022-07-28 14:58:42 +02:00
qqmlbinding CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers 2022-07-28 14:58:42 +02:00
qqmlchangeset CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers 2022-07-28 14:58:42 +02:00
qqmlcomponent CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers 2022-07-28 14:58:42 +02:00
qqmlconnections CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers 2022-07-28 14:58:42 +02:00
qqmlconsole CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers 2022-07-28 14:58:42 +02:00
qqmlcontext CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers 2022-07-28 14:58:42 +02:00
qqmlcpputils CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers 2022-07-28 14:58:42 +02:00
qqmldelegatemodel CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers 2022-07-28 14:58:42 +02:00
qqmldirparser CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers 2022-07-28 14:58:42 +02:00
qqmlecmascript Qml: Allow const and non-const QObjectWrappers to coexist 2022-09-07 16:57:16 +02:00
qqmlengine Allow limited extensions to globals 2022-09-07 16:57:25 +02:00
qqmlenginecleanup CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers 2022-07-28 14:58:42 +02:00
qqmlerror CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers 2022-07-28 14:58:42 +02:00
qqmlexpression CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers 2022-07-28 14:58:42 +02:00
qqmlextensionplugin CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers 2022-07-28 14:58:42 +02:00
qqmlfile CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers 2022-07-28 14:58:42 +02:00
qqmlfileselector CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers 2022-07-28 14:58:42 +02:00
qqmlglobal CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers 2022-07-28 14:58:42 +02:00
qqmlimport CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers 2022-07-28 14:58:42 +02:00
qqmlincubator CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers 2022-07-28 14:58:42 +02:00
qqmlinfo CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers 2022-07-28 14:58:42 +02:00
qqmlinstantiator CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers 2022-07-28 14:58:42 +02:00
qqmlitemmodels CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers 2022-07-28 14:58:42 +02:00
qqmljsscope tst_qqmljsscope: remove Q_SKIP in qualifiedName test 2022-09-05 14:52:25 +02:00
qqmllanguage QQmlVMEMetaObjectEndpoint: ensure property cache before accessing it 2022-09-07 09:58:00 +00:00
qqmllistcompositor CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers 2022-07-28 14:58:42 +02:00
qqmllistmodel QmlModels: Fix enum resolution in ListElement 2022-08-29 13:20:53 +02:00
qqmllistmodelworkerscript CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers 2022-07-28 14:58:42 +02:00
qqmllistreference CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers 2022-07-28 14:58:42 +02:00
qqmllocale QML tests: port away from deprecated QLocale::nativeCountryName() 2022-08-26 12:49:33 +02:00
qqmlmetaobject CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers 2022-07-28 14:58:42 +02:00
qqmlmetatype CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers 2022-07-28 14:58:42 +02:00
qqmlmoduleplugin CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers 2022-07-28 14:58:42 +02:00
qqmlnotifier Blacklist tst_qqmlnotifier::deleteFromHandler 2022-08-12 12:42:34 +02:00
qqmlobjectmodel CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers 2022-07-28 14:58:42 +02:00
qqmlopenmetaobject CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers 2022-07-28 14:58:42 +02:00
qqmlparser CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers 2022-07-28 14:58:42 +02:00
qqmlpromise Tests: do not use QT_DISABLE_DEPRECATED_BEFORE 2022-08-26 12:49:40 +02:00
qqmlproperty CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers 2022-07-28 14:58:42 +02:00
qqmlpropertycache CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers 2022-07-28 14:58:42 +02:00
qqmlpropertymap CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers 2022-07-28 14:58:42 +02:00
qqmlqt CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers 2022-07-28 14:58:42 +02:00
qqmlsettings CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers 2022-07-28 14:58:42 +02:00
qqmlsqldatabase CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers 2022-07-28 14:58:42 +02:00
qqmltablemodel CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers 2022-07-28 14:58:42 +02:00
qqmltimer CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers 2022-07-28 14:58:42 +02:00
qqmltranslation CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers 2022-07-28 14:58:42 +02:00
qqmltreemodeltotablemodel CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers 2022-07-28 14:58:42 +02:00
qqmltypeloader CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers 2022-07-28 14:58:42 +02:00
qqmlvaluetypeproviders CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers 2022-07-28 14:58:42 +02:00
qqmlvaluetypes QML tests: port away from deprecated QLocale::nativeCountryName() 2022-08-26 12:49:33 +02:00
qqmlxmlhttprequest CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers 2022-07-28 14:58:42 +02:00
qqmlxmllistmodel Add license headers to cmake files 2022-07-08 10:41:06 +02:00
qquickfolderlistmodel CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers 2022-07-28 14:58:42 +02:00
qquickworkerscript CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers 2022-07-28 14:58:42 +02:00
qrcqml CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers 2022-07-28 14:58:42 +02:00
qtqmlmodules CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers 2022-07-28 14:58:42 +02:00
qv4assembler CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers 2022-07-28 14:58:42 +02:00
qv4identifiertable CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers 2022-07-28 14:58:42 +02:00
qv4mm V4: Mark InternalClass parents when running GC 2022-08-03 08:32:33 +02:00
qv4regexp CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers 2022-07-28 14:58:42 +02:00
qwidgetsinqml Tests: do not use QT_DISABLE_DEPRECATED_BEFORE 2022-08-26 12:49:40 +02:00
registrationmacros CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers 2022-07-28 14:58:42 +02:00
v4misc CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers 2022-07-28 14:58:42 +02:00
CMakeLists.txt qml: make lexer line by line & restartable 2022-08-18 13:15:05 +02:00
runall.sh