From ddbd09d04415af3ac4dcf64fbb06a007c409fd9e Mon Sep 17 00:00:00 2001 From: Jake Bailey <5341706+jakebailey@users.noreply.github.com> Date: Tue, 11 Oct 2022 11:02:24 -0700 Subject: [PATCH] Also remove 'this' regex --- build/importTypescript.ts | 9 --------- src/language/typescript/lib/typescriptServices.js | 12 ++++++------ 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/build/importTypescript.ts b/build/importTypescript.ts index 1a757c5b..7e519c39 100644 --- a/build/importTypescript.ts +++ b/build/importTypescript.ts @@ -63,15 +63,6 @@ define("vs/language/typescript/lib/typescriptServices", [], function() { return stripSourceMaps(tsServices_amd) ); - // Remove pattern that creates warnings with esbuild - // e.g. - // > /src/typescript/lib/typescriptServices.js:20:21: warning: Top-level "this" will be replaced with undefined since this file is an ECMAScript module - // 20 │ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { - // ╵ ~~~~ - // - - tsServices = tsServices.replace(/\nvar ([^ ]+) = \(this && this\.([^)]+)\) \|\|/gm, '\nvar $1 ='); - const tsServices_esm = generatedNote + tsServices + diff --git a/src/language/typescript/lib/typescriptServices.js b/src/language/typescript/lib/typescriptServices.js index b85d7bb4..0f01ec34 100644 --- a/src/language/typescript/lib/typescriptServices.js +++ b/src/language/typescript/lib/typescriptServices.js @@ -22,7 +22,7 @@ and limitations under the License. ***************************************************************************** */ "use strict"; -var __spreadArray = function (to, from, pack) { +var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { if (ar || !(i in from)) { if (!ar) ar = Array.prototype.slice.call(from, 0, i); @@ -31,7 +31,7 @@ var __spreadArray = function (to, from, pack) { } return to.concat(ar || Array.prototype.slice.call(from)); }; -var __assign = function () { +var __assign = (this && this.__assign) || function () { __assign = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; @@ -42,11 +42,11 @@ var __assign = function () { }; return __assign.apply(this, arguments); }; -var __makeTemplateObject = function (cooked, raw) { +var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) { if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } return cooked; }; -var __generator = function (thisArg, body) { +var __generator = (this && this.__generator) || function (thisArg, body) { var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; function verb(n) { return function (v) { return step([n, v]); }; } @@ -73,7 +73,7 @@ var __generator = function (thisArg, body) { if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; } }; -var __rest = function (s, e) { +var __rest = (this && this.__rest) || function (s, e) { var t = {}; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p]; @@ -84,7 +84,7 @@ var __rest = function (s, e) { } return t; }; -var __extends = (function () { +var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||