From 6efc0b6950cef0dbed0a59c23c656a3f2cfb6403 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Wed, 10 Jun 2020 17:55:19 -0700 Subject: [PATCH] Fix/supress ts-check errors in js Fixes #99226 --- src/vs/workbench/contrib/webview/browser/pre/host.js | 2 +- src/vs/workbench/contrib/webview/browser/pre/main.js | 4 ++-- .../workbench/contrib/webview/browser/pre/service-worker.js | 4 +++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/vs/workbench/contrib/webview/browser/pre/host.js b/src/vs/workbench/contrib/webview/browser/pre/host.js index 99b4ecbb3a89d..4015cadcc3edc 100644 --- a/src/vs/workbench/contrib/webview/browser/pre/host.js +++ b/src/vs/workbench/contrib/webview/browser/pre/host.js @@ -90,7 +90,7 @@ } } - window.createWebviewManager({ + (/** @type {any} */ (window)).createWebviewManager({ postMessage: hostMessaging.postMessage.bind(hostMessaging), onMessage: hostMessaging.onMessage.bind(hostMessaging), ready: workerReady, diff --git a/src/vs/workbench/contrib/webview/browser/pre/main.js b/src/vs/workbench/contrib/webview/browser/pre/main.js index e42932ecf9f13..3b683f5ea4770 100644 --- a/src/vs/workbench/contrib/webview/browser/pre/main.js +++ b/src/vs/workbench/contrib/webview/browser/pre/main.js @@ -11,7 +11,7 @@ * focusIframeOnCreate?: boolean, * ready?: Promise, * onIframeLoaded?: (iframe: HTMLIFrameElement) => void, - * fakeLoad: boolean, + * fakeLoad?: boolean, * rewriteCSP: (existingCSP: string, endpoint?: string) => string, * }} WebviewHost */ @@ -605,6 +605,6 @@ if (typeof module !== 'undefined') { module.exports = createWebviewManager; } else { - window.createWebviewManager = createWebviewManager; + (/** @type {any} */ (window)).createWebviewManager = createWebviewManager; } }()); diff --git a/src/vs/workbench/contrib/webview/browser/pre/service-worker.js b/src/vs/workbench/contrib/webview/browser/pre/service-worker.js index 8d26680d73ab4..5d043d56ff0c4 100644 --- a/src/vs/workbench/contrib/webview/browser/pre/service-worker.js +++ b/src/vs/workbench/contrib/webview/browser/pre/service-worker.js @@ -2,6 +2,8 @@ * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ +/// + const VERSION = 1; const rootPath = self.location.pathname.replace(/\/service-worker.js$/, ''); @@ -273,4 +275,4 @@ async function getOuterIframeClient(webviewId) { const clientUrl = new URL(client.url); return (clientUrl.pathname === `${rootPath}/` || clientUrl.pathname === `${rootPath}/index.html`) && clientUrl.search.match(new RegExp('\\bid=' + webviewId)); }); -} \ No newline at end of file +}