Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Probably wrong value for os.EOL #1473

Closed
dhbaird opened this issue Nov 8, 2022 · 0 comments
Closed

Probably wrong value for os.EOL #1473

dhbaird opened this issue Nov 8, 2022 · 0 comments
Labels
bug Something isn't working needs repro Needs an example to reproduce

Comments

@dhbaird
Copy link

dhbaird commented Nov 8, 2022

What version of Bun is running?

0.2.2

What platform is your computer?

Linux

What steps can reproduce the bug?

echo 'console.log(JSON.stringify(require("os").EOL));' > oseol.cjs ; node oseol.cjs ; bun oseol.cjs
# >>>
# "\n"  <-- what node prints (expected)
# "\\n"  <-- what bun prints (not expected)

How often does it reproduce? Is there a required condition?

100% reproducible.

What is the expected behavior?

See above.

What do you see instead?

See above.

Additional information

Probably caused by this line here having too many backslashes:

pub const EOL = if (Environment.isWindows) "\\r\\n" else "\\n";

I originally noticed this because it triggered an issue in typescript.transpileModule used by svelte-preprocess, reported here:
sveltejs/svelte-preprocess#555

@dhbaird dhbaird added bug Something isn't working needs repro Needs an example to reproduce labels Nov 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs repro Needs an example to reproduce
Projects
None yet
Development

No branches or pull requests

1 participant