diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2019-02-25 16:01:03 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2019-03-19 09:40:17 +0000 |
commit | f4649ebfe5be81c24a384c0806fd015e756a4dca (patch) | |
tree | 2855e83a161c06e7d78c4067c90eb80e62e44d8f /src | |
parent | df2d75b6aa13d770e891910ffcef21968db423a4 (diff) |
Update JavaScript documentation
Update function list and refer to the 7th edition of the ECMAScript
standard.
Fixes: QTBUG-73837
Change-Id: I4332de3ded0373393107b6d5bab95363a0b9ebb9
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/qml/doc/src/javascript/functionlist.qdoc | 61 | ||||
-rw-r--r-- | src/qml/doc/src/javascript/hostenvironment.qdoc | 5 |
2 files changed, 63 insertions, 3 deletions
diff --git a/src/qml/doc/src/javascript/functionlist.qdoc b/src/qml/doc/src/javascript/functionlist.qdoc index 24ff640284..7a6a922480 100644 --- a/src/qml/doc/src/javascript/functionlist.qdoc +++ b/src/qml/doc/src/javascript/functionlist.qdoc @@ -55,6 +55,8 @@ \li decodeURIComponent(encodedURIComponent) \li encodeURI(uri) \li encodeURIComponent(uriComponent) + \li escape(string) + \li unescape(string) \endlist \section2 Constructor Properties @@ -63,11 +65,20 @@ \li Object \li Function \li Array + \li ArrayBuffer \li String \li Boolean \li Number + \li DataView \li Date + \li Promise \li RegExp + \li Map + \li WeakMap + \li Set + \li WeakSet + \li SharedArrayBuffer + \li Symbol \li Error \li EvalError \li RangeError @@ -80,8 +91,11 @@ \section2 Other Properties \list + \li Atomics \li Math \li JSON + \li Reflect + \li Proxy \endlist \section1 The Object Object @@ -92,12 +106,19 @@ \list \li getPrototypeOf(O) + \li setPrototypeOf(O, P) \li getOwnPropertyDescriptor(O, P) + \li getOwnPropertyDescriptors(O) \li getOwnPropertyNames(O) + \li getOwnPropertySymbols(O) + \li assign(O [, Properties]) \li create(O [, Properties]) \li defineProperty(O, P, Attributes) \li defineProperties(O, Properties) + \li entries(O) + \li is(V1, V2) \li keys(O) + \li values(O) \li seal(O) \li isSealed(O) \li freeze(O) @@ -117,6 +138,8 @@ \li hasOwnProperty(V) \li isPrototypeOf(V) \li propertyIsEnumerable(V) + \li __defineGetter__(P, F) + \li __defineSetter__(P, F) \endlist \section1 Function Objects @@ -130,6 +153,7 @@ \li apply(thisArg, argArray) \li call(thisArg [, arg1 [, arg2, ...]]) \li bind((thisArg [, arg1 [, arg2, …]]) + \li [Symbol.hasInstance](O) \endlist \section1 Array Objects @@ -142,9 +166,14 @@ \li toString() \li toLocaleString() \li concat([item1 [, item2 [, ...]]]) + \li copyWithin([item1 [, item2 [, ...]]]) + \li entries() + \li fill(item [, index1 [, index2]]) \li join(separator) \li find(callbackfn [, thisArg]) // ECMAScript 6: Added in Qt 5.9 \li findIndex(callbackfn [, thisArg]) // ECMAScript 6: Added in Qt 5.9 + \li includes(item) + \li keys() \li pop() \li push([item1 [, item2 [, ...]]]) \li reverse() @@ -162,6 +191,8 @@ \li filter(callbackfn [, thisArg]) \li reduce(callbackfn [, initialValue]) \li reduceRight(callbackfn [, initialValue]) + \li values() + \li [Symbol.iterator]() \endlist \section1 String Objects @@ -175,6 +206,7 @@ \li valueOf() \li charAt(pos) \li charCodeAt(pos) + \li codePointAt(pos) \li concat([string1 [, string2 [, ...]]]) \li endsWith(searchString [, endPosition ]) // ECMAScript 6: Added in Qt 5.8 \li includes(searchString [, position ]) // ECMAScript 6: Added in 5.8 @@ -182,18 +214,23 @@ \li lastIndexOf(searchString, position) \li localeCompare(that) \li match(regexp) + \li normalize() + \li padEnd(length [, string]) + \li padStart(length [, string]) \li repeat(count) // ECMAScript 6: Added in Qt 5.9 \li replace(searchValue, replaceValue) \li search(regexp) \li slice(start, end) \li split(separator, limit) \li startsWith(searchString [, position ]) // ECMAScript 6: Added in Qt 5.8 + \li substr(start, length) \li substring(start, end) \li toLowerCase() \li toLocaleLowerCase() \li toUpperCase() \li toLocaleUpperCase() \li trim() + \li [Symbol.iterator]() \endlist Additionally, the QML engine adds the following functions to the \l String prototype: @@ -222,6 +259,7 @@ \list \li toString(radix) \li toLocaleString() + \li valueOf() \li toFixed(fractionDigits) \li toExponential(fractionDigits) \li toPrecision(precision) @@ -245,12 +283,16 @@ \li MAX_VALUE \li MIN_VALUE \li EPSILON // ECMAScript 6: Added in Qt 5.8 + \li MAX_SAFE_INTEGER + \li MIN_SAFE_INTEGER \endlist \section3 Function Properties \list \li isFinite(x) // ECMAScript 6: Added in Qt 5.8 + \li isInteger(x) + \li isSafeInteger(x) \li isNaN(x) // ECMAScript 6: Added in Qt 5.8 \endlist @@ -274,14 +316,27 @@ \list \li abs(x) \li acos(x) + \li acosh(x) \li asin(x) + \li asinh(x) \li atan(x) + \li atanh(x) \li atan2(y, x) + \li cbrt(x) \li ceil(x) + \li clz32(x) \li cos(x) + \li cosh(x) \li exp(x) + \li expm1(x) \li floor(x) + \li fround(x) + \li hypot(x, y) + \li imul(x, y) \li log(x) + \li log10(x) + \li log1p(x) + \li log2(x) \li max([value1 [, value2 [, ...]]]) \li min([value1 [, value2 [, ...]]]) \li pow(x, y) @@ -289,8 +344,11 @@ \li round(x) \li sign(x) // ECMAScript 6: Added in Qt 5.8 \li sin(x) + \li sinh(x) \li sqrt(x) \li tan(x) + \li tanh(x) + \li trunc(x) \endlist \section1 Date Objects @@ -338,11 +396,14 @@ \li setUTCDate(date) \li setMonth(month [, date]) \li setUTCMonth(month [, date]) + \li setYear(year) \li setFullYear(year [, month [, date]]) \li setUTCFullYear(year [, month [, date]]) \li toUTCString() + \li toGMTString() \li toISOString() \li toJSON() + \li [Symbol.toPrimitive](hint) \endlist Additionally, the QML engine adds the following functions to the \l Date prototype: diff --git a/src/qml/doc/src/javascript/hostenvironment.qdoc b/src/qml/doc/src/javascript/hostenvironment.qdoc index eb40f10065..c22c392b80 100644 --- a/src/qml/doc/src/javascript/hostenvironment.qdoc +++ b/src/qml/doc/src/javascript/hostenvironment.qdoc @@ -40,11 +40,10 @@ not provide a \c window object or \c{DOM API} as commonly found in a browser env Like a browser or server-side JavaScript environment, the QML runtime implements the \l{ECMA-262}{ECMAScript Language Specification} standard. This provides access to all of the built-in types and functions defined by the standard, such as Object, Array, and Math. -The QML runtime implements the 5th edition of the standard, which is the same edition commonly -implemented by browsers. +The QML runtime implements the 7th edition of the standard. The standard ECMAScript built-ins are not explicitly documented in the QML documentation. For more -information on their use, please refer to the ECMA-262 5th edition standard or one of the many online +information on their use, please refer to the ECMA-262 7th edition standard or one of the many online JavaScript reference and tutorial sites, such as the \l{W3Schools JavaScript Reference} (JavaScript Objects Reference section). Many sites focus on JavaScript in the browser, so in some cases you may need to double check the specification to determine whether a given function or object is part of standard ECMAScript or |