notebooks: expose scriptUrl global to renderers and kernels

Fixes https://github.com/microsoft/vscode/issues/109932
This commit is contained in:
Connor Peet 2020-11-04 12:00:32 -08:00
parent 4286c603d6
commit 73eb361f29
No known key found for this signature in database
GPG key ID: CF8FD2EA0DBC61BD

View file

@ -108,6 +108,8 @@ function webviewPreloads() {
throw new Error(`Unexpected ${res.status} requesting ${originalUri}: ${text || res.statusText}`);
}
globals.scriptUrl = url;
const args = Object.entries(globals);
new Function(...args.map(([k]) => k), text)(...args.map(([, v]) => v));
return undefined;