-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(lexer): do not treat '#bun' in a url as a pragma (#15888)
Co-authored-by: Don Isaac <don@bun.sh> Co-authored-by: DonIsaac <DonIsaac@users.noreply.github.com>
- Loading branch information
1 parent
a8893dc
commit 1d9fbe7
Showing
4 changed files
with
68 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import path from "path"; | ||
import { bunExe, bunEnv } from "harness"; | ||
|
||
const fixturePath = (name: string): string => path.join(import.meta.dirname, "fixtures", name); | ||
|
||
describe("@bun pragma", () => { | ||
it("is not detected when embedded in a URL", async () => { | ||
const res = Bun.spawn({ | ||
cmd: [bunExe(), "run", fixturePath("bun-in-url.ts")], | ||
stdio: ["ignore", "ignore", "ignore"], | ||
}); | ||
await res.exited; | ||
expect(res.exitCode).toBe(0); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// https://bun.sh/docs/api/http#bun-serve | ||
const a: string = "hello"; | ||
console.log(a); | ||
|
||
// '#bun' spotted in first comment but it's not a valid bun pragma |