chore: fix build warnings (#31616)

This commit is contained in:
Pavel Feldman 2024-07-11 05:12:59 -07:00 committed by GitHub
parent 89eef55dc7
commit 77e50635ee
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 2 deletions

View File

@ -301,7 +301,11 @@ export class ClockController {
if (typeof timer.func !== 'function') {
let error: Error | undefined;
try {
(() => { eval(timer.func); })();
// Using global this is not correct here,
// but it is already broken since the eval scope is different from the one
// on the original call site.
// eslint-disable-next-line no-restricted-globals
(() => { globalThis.eval(timer.func); })();
} catch (e) {
error = e;
}

View File

@ -3,7 +3,7 @@
"version": "0.0.1",
"private": true,
"scripts": {
"esbuild": "esbuild ./src/babelBundleImpl.ts --bundle --outdir=../../lib/transform --format=cjs --platform=node --target=ES2019",
"esbuild": "esbuild ./src/babelBundleImpl.ts --bundle --outdir=../../lib/transform --format=cjs --platform=node --target=ES2019 --external:playwright",
"build": "npm run esbuild -- --minify",
"watch": "npm run esbuild -- --watch --sourcemap",
"generate-license": "node ../../../../utils/generate_third_party_notice.js"