diff options
author | 2023-05-19 19:36:27 -0700 | |
---|---|---|
committer | 2023-05-19 19:36:27 -0700 | |
commit | 0b6a32269f3e54a3fbce08a351b6577e384ae3b8 (patch) | |
tree | 9659fd615dbf7d305cfc2c4cfde6fc01e3e31aec | |
parent | a3841a7de94a881a8a783aa414ffefb7f65aaea7 (diff) | |
download | bun-0b6a32269f3e54a3fbce08a351b6577e384ae3b8.tar.gz bun-0b6a32269f3e54a3fbce08a351b6577e384ae3b8.tar.zst bun-0b6a32269f3e54a3fbce08a351b6577e384ae3b8.zip |
ensure unused variable is not eliminated
-rw-r--r-- | test/js/node/vm/vm.test.ts | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/test/js/node/vm/vm.test.ts b/test/js/node/vm/vm.test.ts index 6cf187112..1aba597c7 100644 --- a/test/js/node/vm/vm.test.ts +++ b/test/js/node/vm/vm.test.ts @@ -1,6 +1,7 @@ import { describe, test, expect } from "bun:test"; import { createContext, runInContext, runInNewContext, runInThisContext, Script } from "node:vm"; +function capture(_: any, _1?: any) {} describe("runInContext()", () => { testRunInContext(runInContext, { isIsolated: true }); }); @@ -133,6 +134,7 @@ function testRunInContext( }); test("cannot access local scope", () => { var foo = "bar"; // intentionally unused + capture(foo, foo); const context = createContext({}); const result = fn("typeof foo;", context); expect(result).toBe("undefined"); |