From cb16e0adba54015963f2cd8a3f0188965c0c9ef8 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Wed, 3 Feb 2010 17:40:00 +1000 Subject: We use JavaScript, not ECMAScript. Task-number: QTBUG-7720 --- doc/src/declarative/advtutorial2.qdoc | 4 +- doc/src/declarative/declarativeui.qdoc | 6 +- doc/src/declarative/dynamicobjects.qdoc | 4 +- doc/src/declarative/ecmascriptblocks.qdoc | 225 --------------------------- doc/src/declarative/example-slideswitch.qdoc | 4 +- doc/src/declarative/extending.qdoc | 6 +- doc/src/declarative/globalobject.qdoc | 2 +- doc/src/declarative/javascriptblocks.qdoc | 225 +++++++++++++++++++++++++++ doc/src/declarative/propertybinding.qdoc | 12 +- doc/src/declarative/qmldocument.qdoc | 2 +- doc/src/declarative/qmlreference.qdoc | 2 +- doc/src/declarative/qtbinding.qdoc | 2 +- doc/src/declarative/scope.qdoc | 8 +- src/declarative/qml/qmlexpression.cpp | 4 +- src/declarative/qml/qmlscript.cpp | 2 +- 15 files changed, 254 insertions(+), 254 deletions(-) delete mode 100644 doc/src/declarative/ecmascriptblocks.qdoc create mode 100644 doc/src/declarative/javascriptblocks.qdoc diff --git a/doc/src/declarative/advtutorial2.qdoc b/doc/src/declarative/advtutorial2.qdoc index dcc7c70..2aa68f3 100644 --- a/doc/src/declarative/advtutorial2.qdoc +++ b/doc/src/declarative/advtutorial2.qdoc @@ -48,7 +48,7 @@ first thing to do is to generate all of the blocks. Now we need to dynamically generate all of these blocks, because you have a new, random set of blocks every time. As they are dynamically generated every time the new game button is clicked, as opposed to on startup, we will be dynamically generating the blocks -in the ECMAScript, as opposed to using a \l Repeater. +in the JavaScript, as opposed to using a \l Repeater. This adds enough script to justify a new file, \c{samegame.js}, the intial version of which is shown below @@ -62,7 +62,7 @@ The \c createBlock function is a lot bigger, and I'll explain it block by block. First we ensure that the component has been constructed. QML elements, including composite ones like the \c Block.qml that we've written, are never created directly in script. While there is a function to parse and create an arbitrary QML string, in the case where you are repeatedly creating the same item you will want to use the \c createComponent function. \c createComponent is -a built-in function in the declarative ECMAScript, and returns a component object. +a built-in function in the declarative JavaScript, and returns a component object. A component object prepares and stores a QML element (usually a composite element) for easy and efficient use. When the component is ready, you can create a new instance of the loaded QML with the \c createObject method. If the component is loaded remotely (over HTTP for example) then you will have to wait for the component to finish loading diff --git a/doc/src/declarative/declarativeui.qdoc b/doc/src/declarative/declarativeui.qdoc index ae64361..8228c11 100644 --- a/doc/src/declarative/declarativeui.qdoc +++ b/doc/src/declarative/declarativeui.qdoc @@ -55,8 +55,8 @@ language, and a rich set of \l {QML Elements}{QML elements} that can be used from QML. QML is an extension to \l {http://www.ecma-international.org/publications/standards/Ecma-262.htm} -{ECMAScript}, that provides a mechanism to declaratively build an object tree -of QML elements. QML improves the integration between ECMAScript and Qt's +{JavaScript}, that provides a mechanism to declaratively build an object tree +of QML elements. QML improves the integration between JavaScript and Qt's existing QObject based type system, adds support for automatic \l {Property Binding}{property bindings} and provides \l {Network Transparency}{network transparency} at the language level. @@ -83,7 +83,7 @@ completely new applications. QML is fully \l {Extending QML}{extensible from C+ \list \o \l {QML Documents} \o \l {Property Binding} -\o \l {ECMAScript Blocks} +\o \l {JavaScript Blocks} \o \l {QML Scope} \o \l {Network Transparency} \o \l {Data Models} diff --git a/doc/src/declarative/dynamicobjects.qdoc b/doc/src/declarative/dynamicobjects.qdoc index c8ea981..fede2cd 100644 --- a/doc/src/declarative/dynamicobjects.qdoc +++ b/doc/src/declarative/dynamicobjects.qdoc @@ -44,13 +44,13 @@ \title Dynamic Object Creation QML has some support for dynamically loading and managing QML objects from -within ECMAscript blocks. It is preferable to use the existing QML elements for +within Javascript blocks. It is preferable to use the existing QML elements for dynamic object management wherever possible; these are \l{Loader}, \l{Repeater}, \l{ListView}, \l{GridView} and \l{PathView}. It is also possible to dynamically create and manage objects from C++, and this is preferable for hybrid QML/C++ applications - see \l{Using QML in C++ Applications}. Dynamically creating and managing objects from -within ECMAscript blocks is intended for when none of the existing QML elements +within Javascript blocks is intended for when none of the existing QML elements fit the needs of your application, and you do not desire for your application to involve C++ code. diff --git a/doc/src/declarative/ecmascriptblocks.qdoc b/doc/src/declarative/ecmascriptblocks.qdoc deleted file mode 100644 index 749111f..0000000 --- a/doc/src/declarative/ecmascriptblocks.qdoc +++ /dev/null @@ -1,225 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! -\page qmlecmascript.html -\title ECMAScript Blocks - -QML encourages building UIs declaratively, using \l {Property Binding} and the -composition of existing \l {QML Elements}. If imperative code is required to implement -more advanced behavior, the \l Script element can be used to add ECMAScript code directly -to a QML file, or to include an external ECMAScript file. - -The \l Script element is a QML language \e intrinsic. It can be used anywhere in a -QML file, \e except as the root element of a file or sub-component, but cannot be -assigned to an object property or given an id. The included ECMAScript is evaluated -in a scope chain. The \l {QML Scope} documentation covers the specifics of scoping -in QML. - -A restriction on the ECMAScript used in QML is that you cannot add new members to the -global object. This happens transparently when you try to use a variable without -declaring it, and so declaring local variables is required when using ECMA script in -QML. - -The global object in QML has a variety of helper functions added to it, to aid UI -implementation. See \l{QML Global Object} for further details. - -Note that if you are adding a function that should be called by external elements, -you do not need the \l Script element. See \l {Extending types from QML#Adding new methods} -{Adding new methods} for information about adding slots that can be called externally. - -\section1 Inline Script - -Small blocks of ECMAScript can be included directly inside a \l {QML Document} as -the body of the \l Script element. - -\code -Rectangle { - Script { - function factorial(a) { - a = Integer(a); - if (a <= 0) - return 1; - else - return a * factorial(a - 1); - } - } -} -\endcode - -Good programming practice dictates that only small script snippets should be written -inline. QML prohibits the declaration of anything other than functions in an inline -script block. For example, the following script is illegal as an inline script block -as it declares the non-function variable \c lastResult. - -\code -// Illegal inline code block -var lastResult = 0 -function factorial(a) { - a = Integer(a); - if (a <= 0) - lastResult = 1; - else - lastResult = a * factorial(a - 1); - return lastResult; -} -\endcode - -\section1 Including an External File - -To avoid cluttering the QML file, large script blocks should be in a separate file. -The \l Script element's \c source property is used to load script from an external -file. - -If the previous factorial code that was illegal as an inline script block was saved -into a "factorial.js" file, it could be included like this. - -\code -Rectangle { - Script { - source: "factorial.js" - } -} -\endcode - -The \c source property may reference a relative file, or an absolute path. In the -case of a relative file, the location is resolved relative to the location of the -\l {QML Document} that contains the \l Script element. If the script file is not -accessible, an error will occur. If the source is on a network resource, the -enclosing QML document will remain in the \l {QmlComponent::status()}{waiting state} -until the script has been retrieved. - -\section1 Running Script at Startup - -It is occasionally necessary to run a block of ECMAScript code at application (or -component instance) "startup". While it is tempting to just include the startup -script as \e {global code} in an external script file, this can have severe limitations -as the QML environment may not have been fully established. For example, some objects -might not have been created or some \l {Property Binding}s may not have been run. -\l {QML Script Restrictions} covers the exact limitations of global script code. - -The QML \l Component element provides an \e attached \c onCompleted property that -can be used to trigger the execution of script code at startup after the -QML environment has been completely established. - -The following QML code shows how to use the \c Component::onCompleted property. - -\code -Rectangle { - Script { - function startupFunction() { - // ... startup code - } - } - - Component.onCompleted: startupFunction(); -} -\endcode - -Any element in a QML file - including nested elements and nested QML component -instances - can use this attached property. If there is more than one script to -execute at startup, they are run sequentially in an undefined order. - -\section1 QML Script Restrictions - -QML \l Script blocks contain standard ECMAScript code. QML introduces the following -restrictions. - -\list -\o Script code cannot modify the global object. - -In QML, the global object is constant - existing properties cannot be modified or -deleted, and no new properties may be created. - -Most ECMAScript programs do not explicitly modify the global object. However, -ECMAScript's automatic creation of undeclared variables is an implicit modification -of the global object, and is prohibited in QML. - -Assuming that the \c a variable does not exist in the scope chain, the following code -is illegal in QML. - -\code -// Illegal modification of undeclared variable -a = 1; -for (var ii = 1; ii < 10; ++ii) a = a * ii; - console.log("Result: " + a); -\endcode - -It can be trivially modified to this legal code. - -\code -var a = 1; -for (var ii = 1; ii < 10; ++ii) a = a * ii; - console.log("Result: " + a); -\endcode - -Any attempt to modify the global object - either implicitly or explicitly - will -cause an exception. If uncaught, this will result in an warning being printed, -that includes the file and line number of the offending code. - -\o Global code is run in a reduced scope - -During startup, if a \l Script block includes an external file with "global" -code, it is executed in a scope that contains only the external file itself and -the global object. That is, it will not have access to the QML objects and -properties it \l {QML Scope}{normally would}. - -Global code that only accesses script local variable is permitted. This is an -example of valid global code. - -\code -var colors = [ "red", "blue", "green", "orange", "purple" ]; -\endcode - -Global code that accesses QML objects will not run correctly. - -\code -// Invalid global code - the "rootObject" variable is undefined -var initialPosition = { rootObject.x, rootObject.y } -\endcode - -This restriction exists as the QML environment is not yet fully established. -To run code after the environment setup has completed, refer to -\l {Running Script at Startup}. - -\endlist - -*/ diff --git a/doc/src/declarative/example-slideswitch.qdoc b/doc/src/declarative/example-slideswitch.qdoc index 492a8ea..41a8574 100644 --- a/doc/src/declarative/example-slideswitch.qdoc +++ b/doc/src/declarative/example-slideswitch.qdoc @@ -108,7 +108,7 @@ For more information on states see \l{qmlstates}{QML States}. \section2 Functions -We add two ECMAScript functions to our switch: +We add two JavaScript functions to our switch: \snippet examples/declarative/slideswitch/content/Switch.qml 2 @@ -121,7 +121,7 @@ states (\e on and \e off). This second function is called when the knob is released and we want to make sure that the knob does not end up between states (neither \e on nor \e off). If it is the case call the \c toggle() function otherwise we do nothing. -For more information on scripts see \l{qmlecmascript.html}{ECMAScript Blocks}. +For more information on scripts see \l{qmlecmascript.html}{JavaScript Blocks}. \section2 Transition \snippet examples/declarative/slideswitch/content/Switch.qml 7 diff --git a/doc/src/declarative/extending.qdoc b/doc/src/declarative/extending.qdoc index 893838f..42b054f 100644 --- a/doc/src/declarative/extending.qdoc +++ b/doc/src/declarative/extending.qdoc @@ -380,11 +380,11 @@ implement the rsvp attached property. \snippet examples/declarative/extending/signal/example.qml 0 \snippet examples/declarative/extending/signal/example.qml 1 -The QML snippet shown above associates the evaluation of a ECMAScript expression +The QML snippet shown above associates the evaluation of a JavaScript expression with the emission of a Qt signal. All Qt signals on a registered class become available as special "signal -properties" within QML to which the user can assign a single ECMAScript +properties" within QML to which the user can assign a single JavaScript expression. The signal property's name is a transformed version of the Qt signal name: "on" is prepended, and the first letter of the signal name upper cased. For example, the signal used in the example above has the following @@ -464,7 +464,7 @@ HappyBirthday's name property remains up to date with the celebrant. Property binding is a core feature of QML. In addition to assigning literal values, property bindings allow the developer to assign an arbitrarily complex -ECMAScript expression that may include dependencies on other property values. +JavaScript expression that may include dependencies on other property values. Whenever the expression's result changes - through a change in one of its constituent values - the expression is automatically reevaluated and the new result assigned to the property. diff --git a/doc/src/declarative/globalobject.qdoc b/doc/src/declarative/globalobject.qdoc index b26f223..764552a 100644 --- a/doc/src/declarative/globalobject.qdoc +++ b/doc/src/declarative/globalobject.qdoc @@ -43,7 +43,7 @@ \page qmlglobalobject.html \title QML Global Object -Contains all the properties of the ECMAScript global object, plus: +Contains all the properties of the JavaScript global object, plus: \tableofcontents diff --git a/doc/src/declarative/javascriptblocks.qdoc b/doc/src/declarative/javascriptblocks.qdoc new file mode 100644 index 0000000..9c72a9c --- /dev/null +++ b/doc/src/declarative/javascriptblocks.qdoc @@ -0,0 +1,225 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! +\page qmljavascript.html +\title JavaScript Blocks + +QML encourages building UIs declaratively, using \l {Property Binding} and the +composition of existing \l {QML Elements}. If imperative code is required to implement +more advanced behavior, the \l Script element can be used to add JavaScript code directly +to a QML file, or to include an external JavaScript file. + +The \l Script element is a QML language \e intrinsic. It can be used anywhere in a +QML file, \e except as the root element of a file or sub-component, but cannot be +assigned to an object property or given an id. The included JavaScript is evaluated +in a scope chain. The \l {QML Scope} documentation covers the specifics of scoping +in QML. + +A restriction on the JavaScript used in QML is that you cannot add new members to the +global object. This happens transparently when you try to use a variable without +declaring it, and so declaring local variables is required when using Java script in +QML. + +The global object in QML has a variety of helper functions added to it, to aid UI +implementation. See \l{QML Global Object} for further details. + +Note that if you are adding a function that should be called by external elements, +you do not need the \l Script element. See \l {Extending types from QML#Adding new methods} +{Adding new methods} for information about adding slots that can be called externally. + +\section1 Inline Script + +Small blocks of JavaScript can be included directly inside a \l {QML Document} as +the body of the \l Script element. + +\code +Rectangle { + Script { + function factorial(a) { + a = Integer(a); + if (a <= 0) + return 1; + else + return a * factorial(a - 1); + } + } +} +\endcode + +Good programming practice dictates that only small script snippets should be written +inline. QML prohibits the declaration of anything other than functions in an inline +script block. For example, the following script is illegal as an inline script block +as it declares the non-function variable \c lastResult. + +\code +// Illegal inline code block +var lastResult = 0 +function factorial(a) { + a = Integer(a); + if (a <= 0) + lastResult = 1; + else + lastResult = a * factorial(a - 1); + return lastResult; +} +\endcode + +\section1 Including an External File + +To avoid cluttering the QML file, large script blocks should be in a separate file. +The \l Script element's \c source property is used to load script from an external +file. + +If the previous factorial code that was illegal as an inline script block was saved +into a "factorial.js" file, it could be included like this. + +\code +Rectangle { + Script { + source: "factorial.js" + } +} +\endcode + +The \c source property may reference a relative file, or an absolute path. In the +case of a relative file, the location is resolved relative to the location of the +\l {QML Document} that contains the \l Script element. If the script file is not +accessible, an error will occur. If the source is on a network resource, the +enclosing QML document will remain in the \l {QmlComponent::status()}{waiting state} +until the script has been retrieved. + +\section1 Running Script at Startup + +It is occasionally necessary to run a block of JavaScript code at application (or +component instance) "startup". While it is tempting to just include the startup +script as \e {global code} in an external script file, this can have severe limitations +as the QML environment may not have been fully established. For example, some objects +might not have been created or some \l {Property Binding}s may not have been run. +\l {QML Script Restrictions} covers the exact limitations of global script code. + +The QML \l Component element provides an \e attached \c onCompleted property that +can be used to trigger the execution of script code at startup after the +QML environment has been completely established. + +The following QML code shows how to use the \c Component::onCompleted property. + +\code +Rectangle { + Script { + function startupFunction() { + // ... startup code + } + } + + Component.onCompleted: startupFunction(); +} +\endcode + +Any element in a QML file - including nested elements and nested QML component +instances - can use this attached property. If there is more than one script to +execute at startup, they are run sequentially in an undefined order. + +\section1 QML Script Restrictions + +QML \l Script blocks contain standard JavaScript code. QML introduces the following +restrictions. + +\list +\o Script code cannot modify the global object. + +In QML, the global object is constant - existing properties cannot be modified or +deleted, and no new properties may be created. + +Most JavaScript programs do not explicitly modify the global object. However, +JavaScript's automatic creation of undeclared variables is an implicit modification +of the global object, and is prohibited in QML. + +Assuming that the \c a variable does not exist in the scope chain, the following code +is illegal in QML. + +\code +// Illegal modification of undeclared variable +a = 1; +for (var ii = 1; ii < 10; ++ii) a = a * ii; + console.log("Result: " + a); +\endcode + +It can be trivially modified to this legal code. + +\code +var a = 1; +for (var ii = 1; ii < 10; ++ii) a = a * ii; + console.log("Result: " + a); +\endcode + +Any attempt to modify the global object - either implicitly or explicitly - will +cause an exception. If uncaught, this will result in an warning being printed, +that includes the file and line number of the offending code. + +\o Global code is run in a reduced scope + +During startup, if a \l Script block includes an external file with "global" +code, it is executed in a scope that contains only the external file itself and +the global object. That is, it will not have access to the QML objects and +properties it \l {QML Scope}{normally would}. + +Global code that only accesses script local variable is permitted. This is an +example of valid global code. + +\code +var colors = [ "red", "blue", "green", "orange", "purple" ]; +\endcode + +Global code that accesses QML objects will not run correctly. + +\code +// Invalid global code - the "rootObject" variable is undefined +var initialPosition = { rootObject.x, rootObject.y } +\endcode + +This restriction exists as the QML environment is not yet fully established. +To run code after the environment setup has completed, refer to +\l {Running Script at Startup}. + +\endlist + +*/ diff --git a/doc/src/declarative/propertybinding.qdoc b/doc/src/declarative/propertybinding.qdoc index 8d0ffa9..ad4f13e 100644 --- a/doc/src/declarative/propertybinding.qdoc +++ b/doc/src/declarative/propertybinding.qdoc @@ -44,11 +44,11 @@ \title Property Binding Property binding is a declarative way of specifying the value of a property. Binding allows -a property's value to be expressed as an ECMAScript expression that defines the value relative +a property's value to be expressed as an JavaScript expression that defines the value relative to other property values or data accessible in the application. The property value is automatically kept up to date if the other properties or data values change. -Property bindings are created implicitly in QML whenever a property is assigned an ECMAScript +Property bindings are created implicitly in QML whenever a property is assigned an JavaScript expression. The following QML uses two property bindings to connect the size of the rectangle to that of \c otherItem. @@ -59,10 +59,10 @@ Rectangle { } \endcode -QML extends a standards compliant ECMAScript engine, so any valid ECMAScript expression can be +QML extends a standards compliant JavaScript engine, so any valid JavaScript expression can be used as a property binding. Bindings can access object properties, make function calls and even -use builtin ECMAScript objects like \e {Date} and \e {Math}. Assigning a constant value to a -property can even be thought of as a binding - afterall, a constant is a valid ECMAScript +use builtin JavaScript objects like \e {Date} and \e {Math}. Assigning a constant value to a +property can even be thought of as a binding - afterall, a constant is a valid JavaScript expression! Here are some examples of more complex bindings: \code @@ -80,7 +80,7 @@ Rectangle { } \endcode -Being ECMAScript expressions, bindings are evaluated in a scope chain. The \l {QML Scope} +Being JavaScript expressions, bindings are evaluated in a scope chain. The \l {QML Scope} documentation covers the specifics of scoping in QML. \list diff --git a/doc/src/declarative/qmldocument.qdoc b/doc/src/declarative/qmldocument.qdoc index 453c023..deb6e1c 100644 --- a/doc/src/declarative/qmldocument.qdoc +++ b/doc/src/declarative/qmldocument.qdoc @@ -83,7 +83,7 @@ modifies the document prior to presentation to the QML runtime. \c import statem do not "include" code in the document, but instead instruct the QML runtime on how to resolve type references found in the document. Any type reference present in a QML document - such as \c Rectangle and \c ListView - including those made within an -\l {ECMAScript Block} or \l {Property Binding}s, are \e resolved based exclusively on the +\l {JavaScript Block} or \l {Property Binding}s, are \e resolved based exclusively on the import statements. QML does not import any modules by default, so at least one \c import statement must be present or no elements will be available! diff --git a/doc/src/declarative/qmlreference.qdoc b/doc/src/declarative/qmlreference.qdoc index 614bc18..a413c22 100644 --- a/doc/src/declarative/qmlreference.qdoc +++ b/doc/src/declarative/qmlreference.qdoc @@ -74,7 +74,7 @@ \list \o \l {QML Documents} \o \l {Property Binding} - \o \l {ECMAScript Blocks} + \o \l {JavaScript Blocks} \o \l {QML Scope} \o \l {Network Transparency} \o \l {qmlmodels}{Data Models} diff --git a/doc/src/declarative/qtbinding.qdoc b/doc/src/declarative/qtbinding.qdoc index 68723bf..2909f2e 100644 --- a/doc/src/declarative/qtbinding.qdoc +++ b/doc/src/declarative/qtbinding.qdoc @@ -91,7 +91,7 @@ the root context is available to all object instances. To expose data to a QML component instance, applications set \l {QmlContext::setContextProperty()} {context properties} which are then accessible by name from QML \l {Property Binding}s and -\l {ECMAScript Blocks}. The following example shows how to expose a background color to a QML +\l {JavaScript Blocks}. The following example shows how to expose a background color to a QML file. \table diff --git a/doc/src/declarative/scope.qdoc b/doc/src/declarative/scope.qdoc index ef30f94..defb217 100644 --- a/doc/src/declarative/scope.qdoc +++ b/doc/src/declarative/scope.qdoc @@ -45,16 +45,16 @@ \tableofcontents -\l {Property Binding}s and \l {ECMAScript Blocks} are executed in a scope chain automatically +\l {Property Binding}s and \l {JavaScript Blocks} are executed in a scope chain automatically established by QML when a component instance is constructed. QML is a \e {dynamically scoped} language. Different object instances instantiated from the same component can exist in different scope chains. \image qml-scope.png -\section1 ECMAScript Variable object +\section1 JavaScript Variable object -Each binding and script block has its own distinct ECMAScript variable object where local +Each binding and script block has its own distinct JavaScript variable object where local variables are stored. That is, local variables from different bindings and script blocks never conflict. @@ -375,6 +375,6 @@ Rectangle { \section1 QML Global Object -The \l {QML Global Object} contains all the properties of the ECMAScript global object, plus some +The \l {QML Global Object} contains all the properties of the JavaScript global object, plus some QML specific extensions. */ diff --git a/src/declarative/qml/qmlexpression.cpp b/src/declarative/qml/qmlexpression.cpp index 3e8d71a..ff1705b 100644 --- a/src/declarative/qml/qmlexpression.cpp +++ b/src/declarative/qml/qmlexpression.cpp @@ -184,7 +184,7 @@ QScriptValue QmlExpressionPrivate::evalInObjectScope(QmlContext *context, QObjec /*! \class QmlExpression - \brief The QmlExpression class evaluates ECMAScript in a QML context. + \brief The QmlExpression class evaluates JavaScript in a QML context. */ /*! @@ -212,7 +212,7 @@ QmlExpression::QmlExpression(QmlContext *ctxt, void *expr, /*! Create a QmlExpression object. - The \a expression ECMAScript will be executed in the \a ctxt QmlContext. + The \a expression JavaScript will be executed in the \a ctxt QmlContext. If specified, the \a scope object's properties will also be in scope during the expression's execution. */ diff --git a/src/declarative/qml/qmlscript.cpp b/src/declarative/qml/qmlscript.cpp index ba62898..10fc9a6 100644 --- a/src/declarative/qml/qmlscript.cpp +++ b/src/declarative/qml/qmlscript.cpp @@ -70,7 +70,7 @@ defining functions that are only executed later once the context is fully defined. - \sa {ECMAScript Blocks} + \sa {JavaScript Blocks} */ /*! -- cgit v0.12