Skip to content

Commit 0ec9974

Browse files
committed
Ensure regexes are correct
1 parent 5ec7399 commit 0ec9974

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/vs/base/worker/defaultWorkerFactory.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ function getWorker(workerId: string, label: string): Worker | Promise<Worker> {
2929

3030
// ESM-comment-begin
3131
export function getWorkerBootstrapUrl(scriptPath: string, label: string, forceDataUri: boolean = false): string {
32-
if (forceDataUri || /^(http:)|(https:)|(file:)/.test(scriptPath)) {
32+
if (forceDataUri || /^((http:)|(https:)|(file:))/.test(scriptPath)) {
3333
const currentUrl = String(window.location);
3434
const currentOrigin = currentUrl.substr(0, currentUrl.length - window.location.hash.length - window.location.search.length - window.location.pathname.length);
3535
if (forceDataUri || scriptPath.substring(0, currentOrigin.length) !== currentOrigin) {

src/vs/workbench/services/extensions/browser/webWorkerExtensionHost.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export class WebWorkerExtensionHost extends Disposable implements IExtensionHost
9494

9595
const vscodeWebWorkerExtHostId = generateUuid();
9696
const workerUrl = require.toUrl('../worker/extensionHostWorkerMain.js');
97-
const sourcesOrigin = /^(http:)|(https:)|(file:)/.test(workerUrl) ? new URL(workerUrl).origin : location.origin;
97+
const sourcesOrigin = /^((http:)|(https:)|(file:))/.test(workerUrl) ? new URL(workerUrl).origin : location.origin;
9898
const workerSrc = getWorkerBootstrapUrl(workerUrl, 'WorkerExtensionHost', true);
9999
const escapeAttribute = (value: string): string => {
100100
return value.replace(/"/g, '&quot;');

0 commit comments

Comments
 (0)