diff options
author | 2023-08-15 01:56:37 -0700 | |
---|---|---|
committer | 2023-08-15 01:56:37 -0700 | |
commit | 1a6a52314f88946e66ac0f36d00d624ec1a5296f (patch) | |
tree | c43b3eb518d51e97e21cfbfae4808941c4771df7 /test | |
parent | 47450ed12ccfe1d76ca527ea95f602e6ba089dce (diff) | |
download | bun-1a6a52314f88946e66ac0f36d00d624ec1a5296f.tar.gz bun-1a6a52314f88946e66ac0f36d00d624ec1a5296f.tar.zst bun-1a6a52314f88946e66ac0f36d00d624ec1a5296f.zip |
fix importing too long of strings (#4155)
Diffstat (limited to 'test')
-rw-r--r-- | test/js/bun/resolve/resolve.test.ts | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/js/bun/resolve/resolve.test.ts b/test/js/bun/resolve/resolve.test.ts index 1b66f711f..a9272fb3f 100644 --- a/test/js/bun/resolve/resolve.test.ts +++ b/test/js/bun/resolve/resolve.test.ts @@ -133,3 +133,24 @@ it("file url in require resolves", async () => { expect(exitCode).toBe(0); expect(stdout.toString("utf8")).toBe("1\n"); }); + +it("import long string should not segfault", async () => { + try { + await import("a".repeat(10000)); + } catch {} +}); +it("import long string should not segfault", async () => { + try { + import.meta.require("a".repeat(10000)); + } catch {} +}); +it("import long string should not segfault", async () => { + try { + await import.meta.resolve!("a".repeat(10000)); + } catch {} +}); +it("import long string should not segfault", async () => { + try { + await import.meta.require.resolve("a".repeat(10000)); + } catch {} +}); |