Adding new expression tests.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
a01b7a17ef
commit
2594fd6844
9 changed files with 274 additions and 62 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue