aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaximilian Goldstein <[email protected]>2021-11-25 12:41:44 +0100
committerMaximilian Goldstein <[email protected]>2021-11-26 21:23:08 +0100
commitd8e73b588a4d5a6f3ee38acd455fb8aa3f0cc190 (patch)
treec7fc03e373664a63597ea27d4714af21ce4798d9
parent3bb8ef28a73a1469c1bbc4384d134deb466a4030 (diff)
qmllint: Properly handle JavaScript functions with variable arguments
Previously calling a JavaScript function with variable arguments could cause the linting process to error out because of a lack of matching function arguments. This is now handled by defaulting to a JavaScript method if no matching function signature can be found. Fixes: QTBUG-98299 Change-Id: I748a60839106243a12bffd8d715b48cbc53d7f57 Reviewed-by: Fabian Kosmale <[email protected]>
-rw-r--r--src/imports/builtins/jsroot.qmltypes633
-rw-r--r--src/imports/tooling/Method.qml1
-rw-r--r--src/qmlcompiler/qqmljsimportvisitor.cpp1
-rw-r--r--src/qmlcompiler/qqmljsmetatypes_p.h7
-rw-r--r--src/qmlcompiler/qqmljstypedescriptionreader.cpp7
-rw-r--r--src/qmlcompiler/qqmljstypepropagator.cpp7
-rw-r--r--src/qmltyperegistrar/qmltypescreator.cpp3
-rw-r--r--tests/auto/qml/qmllint/data/javascriptVariableArgs.qml9
-rw-r--r--tests/auto/qml/qmllint/tst_qmllint.cpp6
-rw-r--r--tools/qmljsrootgen/main.cpp1
10 files changed, 492 insertions, 183 deletions
diff --git a/src/imports/builtins/jsroot.qmltypes b/src/imports/builtins/jsroot.qmltypes
index 15bf813fba..9876fa5986 100644
--- a/src/imports/builtins/jsroot.qmltypes
+++ b/src/imports/builtins/jsroot.qmltypes
@@ -26,14 +26,16 @@ Module {
name: "constructor"
type: "ArrayBuffer"
isConstructor: true
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "slice"
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
}
- Method { name: "toString" }
+ Method { name: "toString"; isJavaScriptFunction: true }
}
Component {
name: "ArrayPrototype"
@@ -44,103 +46,125 @@ Module {
name: "constructor"
type: "Array"
isConstructor: true
+ isJavaScriptFunction: true
Parameter {}
}
- Method { name: "toString" }
- Method { name: "toLocaleString" }
+ Method { name: "toString"; isJavaScriptFunction: true }
+ Method { name: "toLocaleString"; isJavaScriptFunction: true }
Method {
name: "concat"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "copyWithin"
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
}
- Method { name: "entries" }
+ Method { name: "entries"; isJavaScriptFunction: true }
Method {
name: "fill"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "find"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "findIndex"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "includes"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "join"
+ isJavaScriptFunction: true
Parameter {}
}
- Method { name: "keys" }
- Method { name: "pop" }
+ Method { name: "keys"; isJavaScriptFunction: true }
+ Method { name: "pop"; isJavaScriptFunction: true }
Method {
name: "push"
+ isJavaScriptFunction: true
Parameter {}
}
- Method { name: "reverse" }
- Method { name: "shift" }
+ Method { name: "reverse"; isJavaScriptFunction: true }
+ Method { name: "shift"; isJavaScriptFunction: true }
Method {
name: "slice"
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
}
Method {
name: "sort"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "splice"
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
}
Method {
name: "unshift"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "indexOf"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "lastIndexOf"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "every"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "some"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "forEach"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "map"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "filter"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "reduce"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "reduceRight"
+ isJavaScriptFunction: true
Parameter {}
}
- Method { name: "values" }
+ Method { name: "values"; isJavaScriptFunction: true }
}
Component {
name: "Atomics"
@@ -148,18 +172,21 @@ Module {
prototype: "ObjectPrototype"
Method {
name: "add"
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
Parameter {}
}
Method {
name: "and"
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
Parameter {}
}
Method {
name: "compareExchange"
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
Parameter {}
@@ -167,39 +194,46 @@ Module {
}
Method {
name: "exchange"
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
Parameter {}
}
Method {
name: "isLockFree"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "load"
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
}
Method {
name: "or"
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
Parameter {}
}
Method {
name: "store"
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
Parameter {}
}
Method {
name: "sub"
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
Parameter {}
}
Method {
name: "wait"
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
Parameter {}
@@ -207,12 +241,14 @@ Module {
}
Method {
name: "wake"
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
Parameter {}
}
Method {
name: "xor"
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
Parameter {}
@@ -227,28 +263,29 @@ Module {
name: "constructor"
type: "Boolean"
isConstructor: true
+ isJavaScriptFunction: true
Parameter {}
}
- Method { name: "toString" }
- Method { name: "valueOf" }
+ Method { name: "toString"; isJavaScriptFunction: true }
+ Method { name: "valueOf"; isJavaScriptFunction: true }
}
Component {
name: "Console"
accessSemantics: "reference"
prototype: "ObjectPrototype"
- Method { name: "debug" }
- Method { name: "log" }
- Method { name: "info" }
- Method { name: "warn" }
- Method { name: "error" }
- Method { name: "assert" }
- Method { name: "count" }
- Method { name: "profile" }
- Method { name: "profileEnd" }
- Method { name: "time" }
- Method { name: "timeEnd" }
- Method { name: "trace" }
- Method { name: "exception" }
+ Method { name: "debug"; isJavaScriptFunction: true }
+ Method { name: "log"; isJavaScriptFunction: true }
+ Method { name: "info"; isJavaScriptFunction: true }
+ Method { name: "warn"; isJavaScriptFunction: true }
+ Method { name: "error"; isJavaScriptFunction: true }
+ Method { name: "assert"; isJavaScriptFunction: true }
+ Method { name: "count"; isJavaScriptFunction: true }
+ Method { name: "profile"; isJavaScriptFunction: true }
+ Method { name: "profileEnd"; isJavaScriptFunction: true }
+ Method { name: "time"; isJavaScriptFunction: true }
+ Method { name: "timeEnd"; isJavaScriptFunction: true }
+ Method { name: "trace"; isJavaScriptFunction: true }
+ Method { name: "exception"; isJavaScriptFunction: true }
}
Component { name: "DataView"; accessSemantics: "reference"; prototype: "DataViewPrototype" }
Component {
@@ -262,102 +299,125 @@ Module {
name: "constructor"
type: "DataView"
isConstructor: true
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "getInt8"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "getUint8"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "getInt16"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "getUint16"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "getInt32"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "getUint32"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "getFloat32"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "getFloat64"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "setInt8"
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
}
Method {
name: "setUint8"
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
}
Method {
name: "setInt16"
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
}
Method {
name: "setUint16"
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
}
Method {
name: "setInt32"
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
}
Method {
name: "setUint32"
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
}
Method {
name: "setFloat32"
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
}
Method {
name: "setFloat64"
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
}
Method {
name: "getUInt8"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "getUInt16"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "getUInt32"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "setUInt8"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "setUInt16"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "setUInt32"
+ isJavaScriptFunction: true
Parameter {}
}
}
@@ -375,6 +435,7 @@ Module {
name: "constructor"
type: "Date"
isConstructor: true
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
Parameter {}
@@ -383,68 +444,76 @@ Module {
Parameter {}
Parameter {}
}
- Method { name: "toString" }
- Method { name: "toDateString" }
- Method { name: "toTimeString" }
- Method { name: "toLocaleString" }
- Method { name: "toLocaleDateString" }
- Method { name: "toLocaleTimeString" }
- Method { name: "valueOf" }
- Method { name: "getTime" }
- Method { name: "getYear" }
- Method { name: "getFullYear" }
- Method { name: "getUTCFullYear" }
- Method { name: "getMonth" }
- Method { name: "getUTCMonth" }
- Method { name: "getDate" }
- Method { name: "getUTCDate" }
- Method { name: "getDay" }
- Method { name: "getUTCDay" }
- Method { name: "getHours" }
- Method { name: "getUTCHours" }
- Method { name: "getMinutes" }
- Method { name: "getUTCMinutes" }
- Method { name: "getSeconds" }
- Method { name: "getUTCSeconds" }
- Method { name: "getMilliseconds" }
- Method { name: "getUTCMilliseconds" }
- Method { name: "getTimezoneOffset" }
+ Method { name: "toString"; isJavaScriptFunction: true }
+ Method { name: "toDateString"; isJavaScriptFunction: true }
+ Method { name: "toTimeString"; isJavaScriptFunction: true }
+ Method { name: "toLocaleString"; isJavaScriptFunction: true }
+ Method { name: "toLocaleDateString"; isJavaScriptFunction: true }
+ Method { name: "toLocaleTimeString"; isJavaScriptFunction: true }
+ Method { name: "valueOf"; isJavaScriptFunction: true }
+ Method { name: "getTime"; isJavaScriptFunction: true }
+ Method { name: "getYear"; isJavaScriptFunction: true }
+ Method { name: "getFullYear"; isJavaScriptFunction: true }
+ Method { name: "getUTCFullYear"; isJavaScriptFunction: true }
+ Method { name: "getMonth"; isJavaScriptFunction: true }
+ Method { name: "getUTCMonth"; isJavaScriptFunction: true }
+ Method { name: "getDate"; isJavaScriptFunction: true }
+ Method { name: "getUTCDate"; isJavaScriptFunction: true }
+ Method { name: "getDay"; isJavaScriptFunction: true }
+ Method { name: "getUTCDay"; isJavaScriptFunction: true }
+ Method { name: "getHours"; isJavaScriptFunction: true }
+ Method { name: "getUTCHours"; isJavaScriptFunction: true }
+ Method { name: "getMinutes"; isJavaScriptFunction: true }
+ Method { name: "getUTCMinutes"; isJavaScriptFunction: true }
+ Method { name: "getSeconds"; isJavaScriptFunction: true }
+ Method { name: "getUTCSeconds"; isJavaScriptFunction: true }
+ Method { name: "getMilliseconds"; isJavaScriptFunction: true }
+ Method { name: "getUTCMilliseconds"; isJavaScriptFunction: true }
+ Method { name: "getTimezoneOffset"; isJavaScriptFunction: true }
Method {
name: "setTime"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "setMilliseconds"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "setUTCMilliseconds"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "setSeconds"
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
}
Method {
name: "setUTCSeconds"
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
}
Method {
name: "setMinutes"
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
Parameter {}
}
Method {
name: "setUTCMinutes"
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
Parameter {}
}
Method {
name: "setHours"
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
Parameter {}
@@ -452,6 +521,7 @@ Module {
}
Method {
name: "setUTCHours"
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
Parameter {}
@@ -459,43 +529,51 @@ Module {
}
Method {
name: "setDate"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "setUTCDate"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "setMonth"
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
}
Method {
name: "setUTCMonth"
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
}
Method {
name: "setYear"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "setFullYear"
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
Parameter {}
}
Method {
name: "setUTCFullYear"
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
Parameter {}
}
- Method { name: "toUTCString" }
- Method { name: "toGMTString" }
- Method { name: "toISOString" }
+ Method { name: "toUTCString"; isJavaScriptFunction: true }
+ Method { name: "toGMTString"; isJavaScriptFunction: true }
+ Method { name: "toISOString"; isJavaScriptFunction: true }
Method {
name: "toJSON"
+ isJavaScriptFunction: true
Parameter {}
}
}
@@ -517,9 +595,10 @@ Module {
name: "constructor"
type: "Error"
isConstructor: true
+ isJavaScriptFunction: true
Parameter {}
}
- Method { name: "toString" }
+ Method { name: "toString"; isJavaScriptFunction: true }
}
Component {
name: "EvalError"
@@ -539,9 +618,10 @@ Module {
name: "constructor"
type: "EvalError"
isConstructor: true
+ isJavaScriptFunction: true
Parameter {}
}
- Method { name: "toString" }
+ Method { name: "toString"; isJavaScriptFunction: true }
}
Component {
name: "Float32Array"
@@ -557,6 +637,7 @@ Module {
name: "constructor"
type: "Float32Array"
isConstructor: true
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
Parameter {}
@@ -576,6 +657,7 @@ Module {
name: "constructor"
type: "Float64Array"
isConstructor: true
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
Parameter {}
@@ -601,24 +683,28 @@ Module {
name: "constructor"
type: "Function"
isConstructor: true
+ isJavaScriptFunction: true
Parameter {}
}
- Method { name: "toString" }
+ Method { name: "toString"; isJavaScriptFunction: true }
Method {
name: "apply"
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
}
Method {
name: "call"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "bind"
+ isJavaScriptFunction: true
Parameter {}
}
- Method { name: "connect" }
- Method { name: "disconnect" }
+ Method { name: "connect"; isJavaScriptFunction: true }
+ Method { name: "disconnect"; isJavaScriptFunction: true }
}
Component {
name: "GlobalObject"
@@ -637,43 +723,50 @@ Module {
name: "Object"
type: "Object"
isConstructor: true
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "String"
type: "String"
isConstructor: true
+ isJavaScriptFunction: true
Parameter {}
}
- Method { name: "Symbol"; type: "undefined"; isConstructor: true }
+ Method { name: "Symbol"; type: "undefined"; isConstructor: true; isJavaScriptFunction: true }
Method {
name: "Number"
type: "Number"
isConstructor: true
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "Boolean"
type: "Boolean"
isConstructor: true
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "Array"
type: "Array"
isConstructor: true
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "Function"
type: "Function"
isConstructor: true
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "Date"
type: "Date"
isConstructor: true
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
Parameter {}
@@ -686,6 +779,7 @@ Module {
name: "RegExp"
type: "RegExp"
isConstructor: true
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
}
@@ -693,78 +787,95 @@ Module {
name: "Error"
type: "Error"
isConstructor: true
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "EvalError"
type: "EvalError"
isConstructor: true
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "RangeError"
type: "RangeError"
isConstructor: true
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "ReferenceError"
type: "ReferenceError"
isConstructor: true
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "SyntaxError"
type: "SyntaxError"
isConstructor: true
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "TypeError"
type: "TypeError"
isConstructor: true
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "URIError"
type: "URIError"
isConstructor: true
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "Promise"
type: "Promise"
isConstructor: true
+ isJavaScriptFunction: true
Parameter {}
}
- Method { name: "URL"; type: "URL"; isConstructor: true }
- Method { name: "URLSearchParams"; type: "URLSearchParams"; isConstructor: true }
+ Method { name: "URL"; type: "URL"; isConstructor: true; isJavaScriptFunction: true }
+ Method {
+ name: "URLSearchParams"
+ type: "URLSearchParams"
+ isConstructor: true
+ isJavaScriptFunction: true
+ }
Method {
name: "SharedArrayBuffer"
type: "SharedArrayBuffer"
isConstructor: true
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "ArrayBuffer"
type: "ArrayBuffer"
isConstructor: true
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "DataView"
type: "DataView"
isConstructor: true
+ isJavaScriptFunction: true
Parameter {}
}
- Method { name: "WeakSet"; type: "WeakSet"; isConstructor: true }
- Method { name: "Set"; type: "Set"; isConstructor: true }
- Method { name: "WeakMap"; type: "WeakMap"; isConstructor: true }
- Method { name: "Map"; type: "Map"; isConstructor: true }
+ Method { name: "WeakSet"; type: "WeakSet"; isConstructor: true; isJavaScriptFunction: true }
+ Method { name: "Set"; type: "Set"; isConstructor: true; isJavaScriptFunction: true }
+ Method { name: "WeakMap"; type: "WeakMap"; isConstructor: true; isJavaScriptFunction: true }
+ Method { name: "Map"; type: "Map"; isConstructor: true; isJavaScriptFunction: true }
Method {
name: "Int8Array"
type: "Int8Array"
isConstructor: true
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
Parameter {}
@@ -773,6 +884,7 @@ Module {
name: "Uint8Array"
type: "Uint8Array"
isConstructor: true
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
Parameter {}
@@ -781,6 +893,7 @@ Module {
name: "Int16Array"
type: "Int16Array"
isConstructor: true
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
Parameter {}
@@ -789,6 +902,7 @@ Module {
name: "Uint16Array"
type: "Uint16Array"
isConstructor: true
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
Parameter {}
@@ -797,6 +911,7 @@ Module {
name: "Int32Array"
type: "Int32Array"
isConstructor: true
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
Parameter {}
@@ -805,6 +920,7 @@ Module {
name: "Uint32Array"
type: "Uint32Array"
isConstructor: true
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
Parameter {}
@@ -813,6 +929,7 @@ Module {
name: "Uint8ClampedArray"
type: "Uint8ClampedArray"
isConstructor: true
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
Parameter {}
@@ -821,6 +938,7 @@ Module {
name: "Float32Array"
type: "Float32Array"
isConstructor: true
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
Parameter {}
@@ -829,6 +947,7 @@ Module {
name: "Float64Array"
type: "Float64Array"
isConstructor: true
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
Parameter {}
@@ -837,62 +956,74 @@ Module {
name: "Proxy"
type: "Proxy"
isConstructor: true
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
}
Method {
name: "eval"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "parseInt"
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
}
Method {
name: "parseFloat"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "isNaN"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "isFinite"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "decodeURI"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "decodeURIComponent"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "encodeURI"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "encodeURIComponent"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "escape"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "unescape"
+ isJavaScriptFunction: true
Parameter {}
}
- Method { name: "qsTranslate" }
- Method { name: "QT_TRANSLATE_NOOP" }
- Method { name: "qsTr" }
- Method { name: "QT_TR_NOOP" }
- Method { name: "qsTrId" }
- Method { name: "QT_TRID_NOOP" }
- Method { name: "print" }
- Method { name: "gc" }
+ Method { name: "qsTranslate"; isJavaScriptFunction: true }
+ Method { name: "QT_TRANSLATE_NOOP"; isJavaScriptFunction: true }
+ Method { name: "qsTr"; isJavaScriptFunction: true }
+ Method { name: "QT_TR_NOOP"; isJavaScriptFunction: true }
+ Method { name: "qsTrId"; isJavaScriptFunction: true }
+ Method { name: "QT_TRID_NOOP"; isJavaScriptFunction: true }
+ Method { name: "print"; isJavaScriptFunction: true }
+ Method { name: "gc"; isJavaScriptFunction: true }
}
Component { name: "Int16Array"; accessSemantics: "reference"; prototype: "Int16ArrayPrototype" }
Component {
@@ -904,6 +1035,7 @@ Module {
name: "constructor"
type: "Int16Array"
isConstructor: true
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
Parameter {}
@@ -919,6 +1051,7 @@ Module {
name: "constructor"
type: "Int32Array"
isConstructor: true
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
Parameter {}
@@ -934,6 +1067,7 @@ Module {
name: "constructor"
type: "Int8Array"
isConstructor: true
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
Parameter {}
@@ -949,85 +1083,103 @@ Module {
Property { name: "length" }
Method {
name: "copyWithin"
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
}
- Method { name: "entries" }
+ Method { name: "entries"; isJavaScriptFunction: true }
Method {
name: "every"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "fill"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "filter"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "find"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "findIndex"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "forEach"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "includes"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "indexOf"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "join"
+ isJavaScriptFunction: true
Parameter {}
}
- Method { name: "keys" }
+ Method { name: "keys"; isJavaScriptFunction: true }
Method {
name: "lastIndexOf"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "map"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "reduce"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "reduceRight"
+ isJavaScriptFunction: true
Parameter {}
}
- Method { name: "reverse" }
+ Method { name: "reverse"; isJavaScriptFunction: true }
Method {
name: "some"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "set"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "slice"
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
}
Method {
name: "subarray"
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
}
- Method { name: "toLocaleString" }
- Method { name: "toString" }
- Method { name: "values" }
+ Method { name: "toLocaleString"; isJavaScriptFunction: true }
+ Method { name: "toString"; isJavaScriptFunction: true }
+ Method { name: "values"; isJavaScriptFunction: true }
}
Component {
name: "JSON"
@@ -1035,11 +1187,13 @@ Module {
prototype: "ObjectPrototype"
Method {
name: "parse"
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
}
Method {
name: "stringify"
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
Parameter {}
@@ -1051,32 +1205,37 @@ Module {
accessSemantics: "reference"
prototype: "ObjectPrototype"
Property { name: "size"; type: "number" }
- Method { name: "constructor"; type: "Map"; isConstructor: true }
- Method { name: "clear" }
+ Method { name: "constructor"; type: "Map"; isConstructor: true; isJavaScriptFunction: true }
+ Method { name: "clear"; isJavaScriptFunction: true }
Method {
name: "delete"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "forEach"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "get"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "has"
+ isJavaScriptFunction: true
Parameter {}
}
- Method { name: "keys" }
+ Method { name: "keys"; isJavaScriptFunction: true }
Method {
name: "set"
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
}
- Method { name: "values" }
- Method { name: "entries" }
+ Method { name: "values"; isJavaScriptFunction: true }
+ Method { name: "entries"; isJavaScriptFunction: true }
}
Component {
name: "Math"
@@ -1097,6 +1256,7 @@ Module {
}
Method {
name: "abs"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
@@ -1106,6 +1266,7 @@ Module {
}
Method {
name: "acos"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
@@ -1115,6 +1276,7 @@ Module {
}
Method {
name: "acosh"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
@@ -1124,6 +1286,7 @@ Module {
}
Method {
name: "asin"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
@@ -1133,6 +1296,7 @@ Module {
}
Method {
name: "asinh"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
@@ -1142,6 +1306,7 @@ Module {
}
Method {
name: "atan"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
@@ -1151,6 +1316,7 @@ Module {
}
Method {
name: "atanh"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
@@ -1161,6 +1327,7 @@ Module {
}
Method {
name: "atan2"
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
}
@@ -1171,6 +1338,7 @@ Module {
}
Method {
name: "cbrt"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
@@ -1180,6 +1348,7 @@ Module {
}
Method {
name: "ceil"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
@@ -1189,6 +1358,7 @@ Module {
}
Method {
name: "clz32"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
@@ -1198,6 +1368,7 @@ Module {
}
Method {
name: "cos"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
@@ -1207,6 +1378,7 @@ Module {
}
Method {
name: "cosh"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
@@ -1216,6 +1388,7 @@ Module {
}
Method {
name: "exp"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
@@ -1225,6 +1398,7 @@ Module {
}
Method {
name: "expm1"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
@@ -1234,6 +1408,7 @@ Module {
}
Method {
name: "floor"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
@@ -1243,6 +1418,7 @@ Module {
}
Method {
name: "fround"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
@@ -1253,6 +1429,7 @@ Module {
}
Method {
name: "hypot"
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
}
@@ -1264,6 +1441,7 @@ Module {
}
Method {
name: "imul"
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
}
@@ -1274,6 +1452,7 @@ Module {
}
Method {
name: "log"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
@@ -1283,6 +1462,7 @@ Module {
}
Method {
name: "log10"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
@@ -1292,6 +1472,7 @@ Module {
}
Method {
name: "log1p"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
@@ -1301,6 +1482,7 @@ Module {
}
Method {
name: "log2"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
@@ -1311,6 +1493,7 @@ Module {
}
Method {
name: "max"
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
}
@@ -1322,6 +1505,7 @@ Module {
}
Method {
name: "min"
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
}
@@ -1333,6 +1517,7 @@ Module {
}
Method {
name: "pow"
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
}
@@ -1344,6 +1529,7 @@ Module {
}
Method {
name: "round"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
@@ -1353,6 +1539,7 @@ Module {
}
Method {
name: "sign"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
@@ -1362,6 +1549,7 @@ Module {
}
Method {
name: "sin"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
@@ -1371,6 +1559,7 @@ Module {
}
Method {
name: "sinh"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
@@ -1380,6 +1569,7 @@ Module {
}
Method {
name: "sqrt"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
@@ -1389,6 +1579,7 @@ Module {
}
Method {
name: "tan"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
@@ -1398,6 +1589,7 @@ Module {
}
Method {
name: "tanh"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
@@ -1407,6 +1599,7 @@ Module {
}
Method {
name: "trunc"
+ isJavaScriptFunction: true
Parameter {}
}
}
@@ -1419,24 +1612,29 @@ Module {
name: "constructor"
type: "Number"
isConstructor: true
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "toString"
+ isJavaScriptFunction: true
Parameter {}
}
- Method { name: "toLocaleString" }
- Method { name: "valueOf" }
+ Method { name: "toLocaleString"; isJavaScriptFunction: true }
+ Method { name: "valueOf"; isJavaScriptFunction: true }
Method {
name: "toFixed"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "toExponential"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "toPrecision"
+ isJavaScriptFunction: true
Parameter {}
}
}
@@ -1449,30 +1647,36 @@ Module {
name: "constructor"
type: "Object"
isConstructor: true
+ isJavaScriptFunction: true
Parameter {}
}
- Method { name: "toString" }
- Method { name: "toLocaleString" }
- Method { name: "valueOf" }
+ Method { name: "toString"; isJavaScriptFunction: true }
+ Method { name: "toLocaleString"; isJavaScriptFunction: true }
+ Method { name: "valueOf"; isJavaScriptFunction: true }
Method {
name: "hasOwnProperty"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "isPrototypeOf"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "propertyIsEnumerable"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "__defineGetter__"
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
}
Method {
name: "__defineSetter__"
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
}
@@ -1486,15 +1690,18 @@ Module {
name: "constructor"
type: "Promise"
isConstructor: true
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "then"
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
}
Method {
name: "catch"
+ isJavaScriptFunction: true
Parameter {}
}
}
@@ -1511,45 +1718,46 @@ Module {
Property { name: "uiLanguage"; type: "string" }
Method {
name: "callLater"
- Parameter {}
- }
- Method { name: "objectNameChanged" }
- Method { name: "include" }
- Method { name: "isQtObject" }
- Method { name: "color" }
- Method { name: "rgba" }
- Method { name: "hsla" }
- Method { name: "hsva" }
- Method { name: "colorEqual" }
- Method { name: "rect" }
- Method { name: "point" }
- Method { name: "size" }
- Method { name: "vector2d" }
- Method { name: "vector3d" }
- Method { name: "vector4d" }
- Method { name: "quaternion" }
- Method { name: "matrix4x4" }
- Method { name: "lighter" }
- Method { name: "darker" }
- Method { name: "alpha" }
- Method { name: "tint" }
- Method { name: "formatDate" }
- Method { name: "formatTime" }
- Method { name: "formatDateTime" }
- Method { name: "locale" }
- Method { name: "url" }
- Method { name: "resolvedUrl" }
- Method { name: "openUrlExternally" }
- Method { name: "font" }
- Method { name: "fontFamilies" }
- Method { name: "md5" }
- Method { name: "btoa" }
- Method { name: "atob" }
- Method { name: "quit" }
- Method { name: "exit" }
- Method { name: "createQmlObject" }
- Method { name: "createComponent" }
- Method { name: "binding" }
+ isJavaScriptFunction: true
+ Parameter {}
+ }
+ Method { name: "objectNameChanged"; isJavaScriptFunction: true }
+ Method { name: "include"; isJavaScriptFunction: true }
+ Method { name: "isQtObject"; isJavaScriptFunction: true }
+ Method { name: "color"; isJavaScriptFunction: true }
+ Method { name: "rgba"; isJavaScriptFunction: true }
+ Method { name: "hsla"; isJavaScriptFunction: true }
+ Method { name: "hsva"; isJavaScriptFunction: true }
+ Method { name: "colorEqual"; isJavaScriptFunction: true }
+ Method { name: "rect"; isJavaScriptFunction: true }
+ Method { name: "point"; isJavaScriptFunction: true }
+ Method { name: "size"; isJavaScriptFunction: true }
+ Method { name: "vector2d"; isJavaScriptFunction: true }
+ Method { name: "vector3d"; isJavaScriptFunction: true }
+ Method { name: "vector4d"; isJavaScriptFunction: true }
+ Method { name: "quaternion"; isJavaScriptFunction: true }
+ Method { name: "matrix4x4"; isJavaScriptFunction: true }
+ Method { name: "lighter"; isJavaScriptFunction: true }
+ Method { name: "darker"; isJavaScriptFunction: true }
+ Method { name: "alpha"; isJavaScriptFunction: true }
+ Method { name: "tint"; isJavaScriptFunction: true }
+ Method { name: "formatDate"; isJavaScriptFunction: true }
+ Method { name: "formatTime"; isJavaScriptFunction: true }
+ Method { name: "formatDateTime"; isJavaScriptFunction: true }
+ Method { name: "locale"; isJavaScriptFunction: true }
+ Method { name: "url"; isJavaScriptFunction: true }
+ Method { name: "resolvedUrl"; isJavaScriptFunction: true }
+ Method { name: "openUrlExternally"; isJavaScriptFunction: true }
+ Method { name: "font"; isJavaScriptFunction: true }
+ Method { name: "fontFamilies"; isJavaScriptFunction: true }
+ Method { name: "md5"; isJavaScriptFunction: true }
+ Method { name: "btoa"; isJavaScriptFunction: true }
+ Method { name: "atob"; isJavaScriptFunction: true }
+ Method { name: "quit"; isJavaScriptFunction: true }
+ Method { name: "exit"; isJavaScriptFunction: true }
+ Method { name: "createQmlObject"; isJavaScriptFunction: true }
+ Method { name: "createComponent"; isJavaScriptFunction: true }
+ Method { name: "binding"; isJavaScriptFunction: true }
}
Component {
name: "QtApplication"
@@ -1561,16 +1769,16 @@ Module {
Property { name: "version"; type: "string" }
Property { name: "organization"; type: "string" }
Property { name: "domain"; type: "string" }
- Method { name: "objectNameChanged" }
- Method { name: "aboutToQuit" }
- Method { name: "nameChanged" }
- Method { name: "versionChanged" }
- Method { name: "organizationChanged" }
- Method { name: "domainChanged" }
- Method { name: "setName" }
- Method { name: "setVersion" }
- Method { name: "setOrganization" }
- Method { name: "setDomain" }
+ Method { name: "objectNameChanged"; isJavaScriptFunction: true }
+ Method { name: "aboutToQuit"; isJavaScriptFunction: true }
+ Method { name: "nameChanged"; isJavaScriptFunction: true }
+ Method { name: "versionChanged"; isJavaScriptFunction: true }
+ Method { name: "organizationChanged"; isJavaScriptFunction: true }
+ Method { name: "domainChanged"; isJavaScriptFunction: true }
+ Method { name: "setName"; isJavaScriptFunction: true }
+ Method { name: "setVersion"; isJavaScriptFunction: true }
+ Method { name: "setOrganization"; isJavaScriptFunction: true }
+ Method { name: "setDomain"; isJavaScriptFunction: true }
}
Component {
name: "QtApplicationArguments"
@@ -1585,7 +1793,7 @@ Module {
accessSemantics: "reference"
prototype: "ObjectPrototype"
Property { name: "objectName"; type: "string" }
- Method { name: "objectNameChanged" }
+ Method { name: "objectNameChanged"; isJavaScriptFunction: true }
}
Component {
name: "QtPlatform"
@@ -1594,14 +1802,14 @@ Module {
Property { name: "objectName"; type: "string" }
Property { name: "os"; type: "string" }
Property { name: "pluginName"; type: "string" }
- Method { name: "objectNameChanged" }
+ Method { name: "objectNameChanged"; isJavaScriptFunction: true }
}
Component {
name: "QtStyleHints"
accessSemantics: "reference"
prototype: "ObjectPrototype"
Property { name: "objectName"; type: "string" }
- Method { name: "objectNameChanged" }
+ Method { name: "objectNameChanged"; isJavaScriptFunction: true }
}
Component {
name: "RangeError"
@@ -1621,9 +1829,10 @@ Module {
name: "constructor"
type: "RangeError"
isConstructor: true
+ isJavaScriptFunction: true
Parameter {}
}
- Method { name: "toString" }
+ Method { name: "toString"; isJavaScriptFunction: true }
}
Component {
name: "ReferenceError"
@@ -1643,9 +1852,10 @@ Module {
name: "constructor"
type: "ReferenceError"
isConstructor: true
+ isJavaScriptFunction: true
Parameter {}
}
- Method { name: "toString" }
+ Method { name: "toString"; isJavaScriptFunction: true }
}
Component {
name: "Reflect"
@@ -1653,65 +1863,78 @@ Module {
prototype: "ObjectPrototype"
Method {
name: "apply"
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
Parameter {}
}
Method {
name: "construct"
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
}
Method {
name: "defineProperty"
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
Parameter {}
}
Method {
name: "deleteProperty"
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
}
Method {
name: "get"
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
}
Method {
name: "getOwnPropertyDescriptor"
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
}
Method {
name: "getPrototypeOf"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "has"
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
}
Method {
name: "isExtensible"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "ownKeys"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "preventExtensions"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "set"
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
Parameter {}
}
Method {
name: "setPrototypeOf"
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
}
@@ -1737,20 +1960,24 @@ Module {
name: "constructor"
type: "RegExp"
isConstructor: true
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
}
Method {
name: "exec"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "test"
+ isJavaScriptFunction: true
Parameter {}
}
- Method { name: "toString" }
+ Method { name: "toString"; isJavaScriptFunction: true }
Method {
name: "compile"
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
}
@@ -1761,27 +1988,31 @@ Module {
accessSemantics: "reference"
prototype: "ObjectPrototype"
Property { name: "size"; type: "number" }
- Method { name: "constructor"; type: "Set"; isConstructor: true }
+ Method { name: "constructor"; type: "Set"; isConstructor: true; isJavaScriptFunction: true }
Method {
name: "add"
+ isJavaScriptFunction: true
Parameter {}
}
- Method { name: "clear" }
+ Method { name: "clear"; isJavaScriptFunction: true }
Method {
name: "delete"
+ isJavaScriptFunction: true
Parameter {}
}
- Method { name: "entries" }
+ Method { name: "entries"; isJavaScriptFunction: true }
Method {
name: "forEach"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "has"
+ isJavaScriptFunction: true
Parameter {}
}
- Method { name: "keys" }
- Method { name: "values" }
+ Method { name: "keys"; isJavaScriptFunction: true }
+ Method { name: "values"; isJavaScriptFunction: true }
}
Component {
name: "SharedArrayBuffer"
@@ -1797,10 +2028,12 @@ Module {
name: "constructor"
type: "SharedArrayBuffer"
isConstructor: true
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "slice"
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
}
@@ -1820,110 +2053,136 @@ Module {
name: "constructor"
type: "String"
isConstructor: true
+ isJavaScriptFunction: true
Parameter {}
}
- Method { name: "toString" }
- Method { name: "valueOf" }
+ Method { name: "toString"; isJavaScriptFunction: true }
+ Method { name: "valueOf"; isJavaScriptFunction: true }
Method {
name: "charAt"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "charCodeAt"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "codePointAt"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "concat"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "endsWith"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "indexOf"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "includes"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "lastIndexOf"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "localeCompare"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "match"
+ isJavaScriptFunction: true
Parameter {}
}
- Method { name: "normalize" }
+ Method { name: "normalize"; isJavaScriptFunction: true }
Method {
name: "padEnd"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "padStart"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "repeat"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "replace"
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
}
Method {
name: "search"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "slice"
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
}
Method {
name: "split"
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
}
Method {
name: "startsWith"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "substr"
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
}
Method {
name: "substring"
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
}
- Method { name: "toLowerCase" }
- Method { name: "toLocaleLowerCase" }
- Method { name: "toUpperCase" }
- Method { name: "toLocaleUpperCase" }
- Method { name: "trim" }
- Method { name: "arg" }
+ Method { name: "toLowerCase"; isJavaScriptFunction: true }
+ Method { name: "toLocaleLowerCase"; isJavaScriptFunction: true }
+ Method { name: "toUpperCase"; isJavaScriptFunction: true }
+ Method { name: "toLocaleUpperCase"; isJavaScriptFunction: true }
+ Method { name: "trim"; isJavaScriptFunction: true }
+ Method { name: "arg"; isJavaScriptFunction: true }
}
Component {
name: "SymbolPrototype"
accessSemantics: "reference"
prototype: "ObjectPrototype"
- Method { name: "constructor"; type: "undefined"; isConstructor: true }
- Method { name: "toString" }
- Method { name: "valueOf" }
+ Method {
+ name: "constructor"
+ type: "undefined"
+ isConstructor: true
+ isJavaScriptFunction: true
+ }
+ Method { name: "toString"; isJavaScriptFunction: true }
+ Method { name: "valueOf"; isJavaScriptFunction: true }
}
Component {
name: "SyntaxError"
@@ -1943,9 +2202,10 @@ Module {
name: "constructor"
type: "SyntaxError"
isConstructor: true
+ isJavaScriptFunction: true
Parameter {}
}
- Method { name: "toString" }
+ Method { name: "toString"; isJavaScriptFunction: true }
}
Component {
name: "TypeError"
@@ -1965,9 +2225,10 @@ Module {
name: "constructor"
type: "TypeError"
isConstructor: true
+ isJavaScriptFunction: true
Parameter {}
}
- Method { name: "toString" }
+ Method { name: "toString"; isJavaScriptFunction: true }
}
Component {
name: "URIError"
@@ -1987,9 +2248,10 @@ Module {
name: "constructor"
type: "URIError"
isConstructor: true
+ isJavaScriptFunction: true
Parameter {}
}
- Method { name: "toString" }
+ Method { name: "toString"; isJavaScriptFunction: true }
}
Component { name: "URL"; accessSemantics: "reference"; prototype: "URLPrototype" }
Component {
@@ -2008,8 +2270,8 @@ Module {
Property { name: "search" }
Property { name: "searchParams" }
Property { name: "username" }
- Method { name: "toString" }
- Method { name: "toJSON" }
+ Method { name: "toString"; isJavaScriptFunction: true }
+ Method { name: "toJSON"; isJavaScriptFunction: true }
}
Component {
name: "URLSearchParams"
@@ -2020,18 +2282,18 @@ Module {
name: "URLSearchParamsPrototype"
accessSemantics: "reference"
prototype: "ObjectPrototype"
- Method { name: "toString" }
- Method { name: "sort" }
- Method { name: "append" }
- Method { name: "delete" }
- Method { name: "has" }
- Method { name: "set" }
- Method { name: "get" }
- Method { name: "getAll" }
- Method { name: "forEach" }
- Method { name: "entries" }
- Method { name: "keys" }
- Method { name: "values" }
+ Method { name: "toString"; isJavaScriptFunction: true }
+ Method { name: "sort"; isJavaScriptFunction: true }
+ Method { name: "append"; isJavaScriptFunction: true }
+ Method { name: "delete"; isJavaScriptFunction: true }
+ Method { name: "has"; isJavaScriptFunction: true }
+ Method { name: "set"; isJavaScriptFunction: true }
+ Method { name: "get"; isJavaScriptFunction: true }
+ Method { name: "getAll"; isJavaScriptFunction: true }
+ Method { name: "forEach"; isJavaScriptFunction: true }
+ Method { name: "entries"; isJavaScriptFunction: true }
+ Method { name: "keys"; isJavaScriptFunction: true }
+ Method { name: "values"; isJavaScriptFunction: true }
}
Component {
name: "Uint16Array"
@@ -2047,6 +2309,7 @@ Module {
name: "constructor"
type: "Uint16Array"
isConstructor: true
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
Parameter {}
@@ -2066,6 +2329,7 @@ Module {
name: "constructor"
type: "Uint32Array"
isConstructor: true
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
Parameter {}
@@ -2081,6 +2345,7 @@ Module {
name: "constructor"
type: "Uint8Array"
isConstructor: true
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
Parameter {}
@@ -2100,6 +2365,7 @@ Module {
name: "constructor"
type: "Uint8ClampedArray"
isConstructor: true
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
Parameter {}
@@ -2110,21 +2376,25 @@ Module {
name: "WeakMapPrototype"
accessSemantics: "reference"
prototype: "ObjectPrototype"
- Method { name: "constructor"; type: "WeakMap"; isConstructor: true }
+ Method { name: "constructor"; type: "WeakMap"; isConstructor: true; isJavaScriptFunction: true }
Method {
name: "delete"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "get"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "has"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "set"
+ isJavaScriptFunction: true
Parameter {}
Parameter {}
}
@@ -2134,17 +2404,20 @@ Module {
name: "WeakSetPrototype"
accessSemantics: "reference"
prototype: "ObjectPrototype"
- Method { name: "constructor"; type: "WeakSet"; isConstructor: true }
+ Method { name: "constructor"; type: "WeakSet"; isConstructor: true; isJavaScriptFunction: true }
Method {
name: "add"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "delete"
+ isJavaScriptFunction: true
Parameter {}
}
Method {
name: "has"
+ isJavaScriptFunction: true
Parameter {}
}
}
diff --git a/src/imports/tooling/Method.qml b/src/imports/tooling/Method.qml
index b43aaf6912..f3cfedd96a 100644
--- a/src/imports/tooling/Method.qml
+++ b/src/imports/tooling/Method.qml
@@ -46,4 +46,5 @@ Member {
property bool isConstructor: false
property bool isList: false
property bool isPointer: false
+ property bool isJavaScriptFunction: false
}
diff --git a/src/qmlcompiler/qqmljsimportvisitor.cpp b/src/qmlcompiler/qqmljsimportvisitor.cpp
index cc79148e90..fc16f10e13 100644
--- a/src/qmlcompiler/qqmljsimportvisitor.cpp
+++ b/src/qmlcompiler/qqmljsimportvisitor.cpp
@@ -1228,6 +1228,7 @@ void QQmlJSImportVisitor::visitFunctionExpressionHelper(QQmlJS::AST::FunctionExp
if (!name.isEmpty()) {
QQmlJSMetaMethod method(name);
method.setMethodType(QQmlJSMetaMethod::Method);
+ method.setIsJavaScriptFunction(true);
if (!m_pendingMethodAnnotations.isEmpty()) {
method.setAnnotations(m_pendingMethodAnnotations);
diff --git a/src/qmlcompiler/qqmljsmetatypes_p.h b/src/qmlcompiler/qqmljsmetatypes_p.h
index 7dae555f38..319be5c631 100644
--- a/src/qmlcompiler/qqmljsmetatypes_p.h
+++ b/src/qmlcompiler/qqmljsmetatypes_p.h
@@ -187,6 +187,12 @@ public:
bool isConstructor() const { return m_isConstructor; }
void setIsConstructor(bool isConstructor) { m_isConstructor = isConstructor; }
+ bool isJavaScriptFunction() const { return m_isJavaScriptFunction; }
+ void setIsJavaScriptFunction(bool isJavaScriptFunction)
+ {
+ m_isJavaScriptFunction = isJavaScriptFunction;
+ }
+
bool isValid() const { return !m_name.isEmpty(); }
const QVector<QQmlJSAnnotation>& annotations() const { return m_annotations; }
@@ -247,6 +253,7 @@ private:
Access m_methodAccess = Private;
int m_revision = 0;
bool m_isConstructor = false;
+ bool m_isJavaScriptFunction = false;
};
class QQmlJSMetaProperty
diff --git a/src/qmlcompiler/qqmljstypedescriptionreader.cpp b/src/qmlcompiler/qqmljstypedescriptionreader.cpp
index d009ee9323..6a7682ba46 100644
--- a/src/qmlcompiler/qqmljstypedescriptionreader.cpp
+++ b/src/qmlcompiler/qqmljstypedescriptionreader.cpp
@@ -312,6 +312,8 @@ void QQmlJSTypeDescriptionReader::readSignalOrMethod(UiObjectDefinition *ast, bo
metaMethod.setRevision(readIntBinding(script));
} else if (name == QLatin1String("isConstructor")) {
metaMethod.setIsConstructor(true);
+ } else if (name == QLatin1String("isJavaScriptFunction")) {
+ metaMethod.setIsJavaScriptFunction(true);
} else if (name == QLatin1String("isList")) {
// TODO: Theoretically this can happen. QQmlJSMetaMethod should store it.
} else if (name == QLatin1String("isPointer")) {
@@ -320,8 +322,9 @@ void QQmlJSTypeDescriptionReader::readSignalOrMethod(UiObjectDefinition *ast, bo
// description of the type being referenced has access semantics after all.
} else {
addWarning(script->firstSourceLocation(),
- tr("Expected only name, type, revision, isPointer, isList, and "
- "isConstructor in script bindings."));
+ tr("Expected only name, type, revision, isPointer, isList, "
+ "isConstructor, and "
+ "isJavaScriptFunction in script bindings."));
}
} else {
addWarning(member->firstSourceLocation(),
diff --git a/src/qmlcompiler/qqmljstypepropagator.cpp b/src/qmlcompiler/qqmljstypepropagator.cpp
index 4946270205..ebdebdf75d 100644
--- a/src/qmlcompiler/qqmljstypepropagator.cpp
+++ b/src/qmlcompiler/qqmljstypepropagator.cpp
@@ -793,6 +793,7 @@ void QQmlJSTypePropagator::generate_CallProperty(int nameIndex, int base, int ar
QQmlJSMetaMethod QQmlJSTypePropagator::bestMatchForCall(const QList<QQmlJSMetaMethod> &methods,
int argc, int argv, QStringList *errors)
{
+ QQmlJSMetaMethod javascriptFunction;
for (const auto &method : methods) {
const auto argumentTypes = method.parameterTypes();
if (argumentTypes.size() == 1
@@ -802,6 +803,10 @@ QQmlJSMetaMethod QQmlJSTypePropagator::bestMatchForCall(const QList<QQmlJSMetaMe
continue;
}
+ // If we encounter a JavaScript function, use this as a fallback if no other method matches
+ if (method.isJavaScriptFunction())
+ javascriptFunction = method;
+
if (argc != argumentTypes.size()) {
errors->append(u"Function expects %1 arguments, but %2 were provided"_qs
.arg(argumentTypes.size())
@@ -835,7 +840,7 @@ QQmlJSMetaMethod QQmlJSTypePropagator::bestMatchForCall(const QList<QQmlJSMetaMe
if (matches)
return method;
}
- return QQmlJSMetaMethod();
+ return javascriptFunction;
}
void QQmlJSTypePropagator::propagateCall(const QList<QQmlJSMetaMethod> &methods, int argc, int argv)
diff --git a/src/qmltyperegistrar/qmltypescreator.cpp b/src/qmltyperegistrar/qmltypescreator.cpp
index 81dc13e0d0..3c2534e4e7 100644
--- a/src/qmltyperegistrar/qmltypescreator.cpp
+++ b/src/qmltyperegistrar/qmltypescreator.cpp
@@ -262,6 +262,9 @@ void QmlTypesCreator::writeMethods(const QJsonArray &methods, const QString &typ
const auto isConstructor = obj.find(QLatin1String("isConstructor"));
if (isConstructor != obj.constEnd() && isConstructor->toBool())
m_qml.writeScriptBinding(QLatin1String("isConstructor"), QLatin1String("true"));
+ const auto isJavaScriptFunction = obj.find(QLatin1String("isJavaScriptFunction"));
+ if (isJavaScriptFunction != obj.constEnd() && isJavaScriptFunction->toBool())
+ m_qml.writeScriptBinding(QLatin1String("isJavaScriptFunction"), QLatin1String("true"));
for (const QJsonValue argument : arguments) {
const QJsonObject obj = argument.toObject();
m_qml.writeStartObject(QLatin1String("Parameter"));
diff --git a/tests/auto/qml/qmllint/data/javascriptVariableArgs.qml b/tests/auto/qml/qmllint/data/javascriptVariableArgs.qml
new file mode 100644
index 0000000000..a9dc79dbba
--- /dev/null
+++ b/tests/auto/qml/qmllint/data/javascriptVariableArgs.qml
@@ -0,0 +1,9 @@
+import QtQml
+
+QtObject {
+ function varArgs() {}
+ Component.onCompleted: {
+ console.log("It works!");
+ varArgs("This works", 2);
+ }
+}
diff --git a/tests/auto/qml/qmllint/tst_qmllint.cpp b/tests/auto/qml/qmllint/tst_qmllint.cpp
index e1814df648..75060cda2f 100644
--- a/tests/auto/qml/qmllint/tst_qmllint.cpp
+++ b/tests/auto/qml/qmllint/tst_qmllint.cpp
@@ -89,6 +89,7 @@ private Q_SLOTS:
void missingBuiltinsNoCrash();
void absolutePath();
void multiGrouped();
+ void javascriptVariableArgs();
private:
QString runQmllint(const QString &fileToLint, std::function<void(QProcess &)> handleResult,
@@ -1169,5 +1170,10 @@ void TestQmllint::multiGrouped()
QVERIFY(runQmllint("multiGrouped.qml", true, {"--compiler=warning"}).isEmpty());
}
+void TestQmllint::javascriptVariableArgs()
+{
+ QVERIFY(runQmllint("javascriptVariableArgs.qml", true, { "--compiler", "warning" }).isEmpty());
+}
+
QTEST_MAIN(TestQmllint)
#include "tst_qmllint.moc"
diff --git a/tools/qmljsrootgen/main.cpp b/tools/qmljsrootgen/main.cpp
index e151d89f8c..a84ca0015b 100644
--- a/tools/qmljsrootgen/main.cpp
+++ b/tools/qmljsrootgen/main.cpp
@@ -250,6 +250,7 @@ static QString buildClass(const QJSManagedValue &value, QJsonArray *classes,
methodObject.insert(QStringLiteral("access"), QStringLiteral("public"));
methodObject.insert(QStringLiteral("name"), info.name);
+ methodObject.insert(QStringLiteral("isJavaScriptFunction"), true);
const int formalParams = propFunction->getLength();
if (propFunction->isConstructor()) {