From 8678ead99f9cda3e32bd13d917afc421a37ed7f9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Wed, 11 May 2022 10:18:04 +0200 Subject: [PATCH] Target es2019 in tsconfig.json Resolves #4595 --- tsconfig.json | 4 ++-- .../WoltLabSuite/Core/Acp/Ui/Package/QuickInstallation.js | 2 +- wcfsetup/install/files/js/WoltLabSuite/Core/I18n/Plural.js | 6 ++++-- .../install/files/js/WoltLabSuite/Core/Ui/Color/Picker.js | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/tsconfig.json b/tsconfig.json index 1972ef3e25..cccdd4eedd 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,13 +5,13 @@ ], "compilerOptions": { "allowJs": true, - "target": "es2017", + "target": "es2019", "module": "amd", "rootDir": "ts/", "outDir": "wcfsetup/install/files/js/", "lib": [ "dom", - "es2017" + "es2019" ], "strictNullChecks": true, "moduleResolution": "node", diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Acp/Ui/Package/QuickInstallation.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Acp/Ui/Package/QuickInstallation.js index e29ab61147..34eb51a8e5 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Acp/Ui/Package/QuickInstallation.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Acp/Ui/Package/QuickInstallation.js @@ -23,7 +23,7 @@ define(["require", "exports", "tslib", "../../../Ajax", "../../../Core", "../../ try { maybeJson = JSON.parse(decodedValue); } - catch (_a) { + catch { // Skip invalid values. } if ((0, Core_1.isPlainObject)(maybeJson)) { diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/I18n/Plural.js b/wcfsetup/install/files/js/WoltLabSuite/Core/I18n/Plural.js index f52ac4e716..80bebb5331 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/I18n/Plural.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/I18n/Plural.js @@ -559,7 +559,7 @@ define(["require", "exports", "tslib", "../StringUtil"], function (require, expo return undefined; }, }; - const Plural = Object.assign({ + const Plural = { /** * Returns the plural category for the given value. */ @@ -626,6 +626,8 @@ define(["require", "exports", "tslib", "../StringUtil"], function (require, expo */ getV(n) { return n.toString().replace(/^[^.]*\.?/, "").length; - } }, Languages); + }, + ...Languages, + }; return Plural; }); diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Color/Picker.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Color/Picker.js index e2642d3c18..08abd62ce3 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Color/Picker.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Color/Picker.js @@ -156,7 +156,7 @@ define(["require", "exports", "tslib", "../../Core", "../Dialog", "../../Dom/Uti getColor() { const color = this.colorInput.value; const alpha = this.alphaInput.value; - return Object.assign(Object.assign({}, ColorUtil.hexToRgb(color)), { a: +alpha }); + return { ...ColorUtil.hexToRgb(color), a: +alpha }; } /** * Opens the color picker after clicking on the picker button. -- 2.20.1