mirror of
https://github.com/Microsoft/vscode
synced 2024-09-13 13:46:13 +00:00
This commit is contained in:
parent
8fcdf4e417
commit
eb99a782ff
|
@ -43,11 +43,20 @@ export function getWorkerBootstrapUrl(scriptPath: string, label: string): string
|
||||||
return URL.createObjectURL(blob);
|
return URL.createObjectURL(blob);
|
||||||
}
|
}
|
||||||
|
|
||||||
const result = new URL(scriptPath);
|
const start = scriptPath.lastIndexOf('?');
|
||||||
COI.addSearchParam(result.searchParams, true, true);
|
const end = scriptPath.lastIndexOf('#', start);
|
||||||
result.hash = label;
|
const params = start > 0
|
||||||
return result.href;
|
? new URLSearchParams(scriptPath.substring(start + 1, ~end ? end : undefined))
|
||||||
|
: new URLSearchParams();
|
||||||
|
|
||||||
|
COI.addSearchParam(params, true, true);
|
||||||
|
const search = params.toString();
|
||||||
|
|
||||||
|
if (!search) {
|
||||||
|
return `${scriptPath}#${label}`;
|
||||||
|
} else {
|
||||||
|
return `${scriptPath}?${params.toString()}#${label}`;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// ESM-comment-end
|
// ESM-comment-end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue