Adding new expression tests.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Adsooi 2024-10-26 01:06:24 +02:00
parent a01b7a17ef
commit 2594fd6844
Signed by: Ad5001
GPG key ID: EF45F9C6AFE20160
9 changed files with 274 additions and 62 deletions

View file

@ -40,6 +40,17 @@ function QT_TRANSLATE_NOOP(category, string) {
return string
}
/**
* Polyfilling Qt arg function.
* @param {string} argument
*/
String.prototype.arg = function(argument) {
for(let i = 0; i < 10; i++)
if(this.includes("%"+i))
return this.replaceAll("%" + i, argument)
throw new Error("Too many arguments used.")
}
function setup() {
globalThis.Qt = {
rect
@ -47,8 +58,6 @@ function setup() {
globalThis.QT_TRANSLATE_NOOP = QT_TRANSLATE_NOOP
globalThis.qsTranslate = QT_TRANSLATE_NOOP
String.prototype.arg = function() { return this; } // No need to reimplement it for now.
}
setup()