From eeae481e471570cec2d47b17fc3d2372fa05aecd Mon Sep 17 00:00:00 2001 From: Johannes Date: Fri, 30 Jun 2023 11:43:19 +0200 Subject: [PATCH] set emit-target and libs to ES2022, avoid static-blocks, fix `Error#cause` conflict https://github.com/microsoft/vscode/issues/185991 --- build/lib/tsb/transpiler.js | 2 +- build/lib/tsb/transpiler.ts | 2 +- src/tsconfig.base.json | 25 +++---------------- src/tsconfig.json | 1 - src/vs/base/node/zip.ts | 1 - .../workbench/api/common/extensionHostMain.ts | 5 ++-- 6 files changed, 7 insertions(+), 29 deletions(-) diff --git a/build/lib/tsb/transpiler.js b/build/lib/tsb/transpiler.js index 701db315b94..0c704b66341 100644 --- a/build/lib/tsb/transpiler.js +++ b/build/lib/tsb/transpiler.js @@ -293,7 +293,7 @@ class SwcTranspiler { tsx: false, decorators: true }, - target: 'es2020', + target: 'es2022', loose: false, minify: { compress: false, diff --git a/build/lib/tsb/transpiler.ts b/build/lib/tsb/transpiler.ts index 312028fd1fa..a546ea63316 100644 --- a/build/lib/tsb/transpiler.ts +++ b/build/lib/tsb/transpiler.ts @@ -376,7 +376,7 @@ export class SwcTranspiler implements ITranspiler { tsx: false, decorators: true }, - target: 'es2020', + target: 'es2022', loose: false, minify: { compress: false, diff --git a/src/tsconfig.base.json b/src/tsconfig.base.json index a309a50adaa..c0a2e174591 100644 --- a/src/tsconfig.base.json +++ b/src/tsconfig.base.json @@ -17,29 +17,10 @@ "./vs/*" ] }, + "target": "es2022", + "useDefineForClassFields": false, "lib": [ - "ES2016", - "ES2017.Object", - "ES2017.String", - "ES2017.Intl", - "ES2017.TypedArrays", - "ES2018.AsyncIterable", - "ES2018.AsyncGenerator", - "ES2018.Promise", - "ES2018.Regexp", - "ES2018.Intl", - "ES2019.Array", - "ES2019.Object", - "ES2019.String", - "ES2019.Symbol", - "ES2020.BigInt", - "ES2020.Promise", - "ES2020.String", - "ES2020.Symbol.WellKnown", - "ES2020.Intl", - "ES2021.Promise", - "ES2021.String", - "ES2021.WeakRef", + "ES2022", "DOM", "DOM.Iterable", "WebWorker.ImportScripts" diff --git a/src/tsconfig.json b/src/tsconfig.json index 5587571ab70..df96ed71247 100644 --- a/src/tsconfig.json +++ b/src/tsconfig.json @@ -7,7 +7,6 @@ "allowJs": true, "resolveJsonModule": true, "outDir": "../out/vs", - "target": "es2021", "types": [ "keytar", "mocha", diff --git a/src/vs/base/node/zip.ts b/src/vs/base/node/zip.ts index 171b9e45bbc..767d0a5aec6 100644 --- a/src/vs/base/node/zip.ts +++ b/src/vs/base/node/zip.ts @@ -36,7 +36,6 @@ export type ExtractErrorType = 'CorruptZip' | 'Incomplete'; export class ExtractError extends Error { readonly type?: ExtractErrorType; - readonly cause: Error; constructor(type: ExtractErrorType | undefined, cause: Error) { let message = cause.message; diff --git a/src/vs/workbench/api/common/extensionHostMain.ts b/src/vs/workbench/api/common/extensionHostMain.ts index ee87ff55b64..a06c4e93d8f 100644 --- a/src/vs/workbench/api/common/extensionHostMain.ts +++ b/src/vs/workbench/api/common/extensionHostMain.ts @@ -34,12 +34,11 @@ export interface IConsolePatchFn { export abstract class ErrorHandler { - static { + static async installEarlyHandler(accessor: ServicesAccessor): Promise { + // increase number of stack frames (from 10, https://github.com/v8/v8/wiki/Stack-Trace-API) Error.stackTraceLimit = 100; - } - static async installEarlyHandler(accessor: ServicesAccessor): Promise { // does NOT dependent of extension information, can be installed immediately, and simply forwards // to the log service and main thread errors const logService = accessor.get(ILogService);