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

feat: bun --print #9358

Merged
merged 13 commits into from Mar 13, 2024
Merged

feat: bun --print #9358

merged 13 commits into from Mar 13, 2024

Conversation

dylan-conway
Copy link
Collaborator

What does this PR do?

Adds --print to runtime flags. This flag is the same as node --print <script>, printing the result of the script, and also works with esm.

fixes #5698

How did you verify your code works?

new and existing tests

Copy link

github-actions bot commented Mar 11, 2024

Copy link

github-actions bot commented Mar 11, 2024

Copy link

github-actions bot commented Mar 11, 2024

❌🪟 @dylan-conway, there are 14 test regressions on Windows x86_64

  • test\cli\install\migration\migrate.test.ts
  • test\cli\run\env.test.ts
  • test\cli\run\run-process-env.test.ts
  • test\cli\run\transpiler-cache.test.ts
  • test\js\bun\http\bun-server.test.ts
  • test\js\bun\http\fetch-file-upload.test.ts
  • test\js\bun\sqlite\sqlite.test.js
  • test\js\node\dns\node-dns.test.js
  • test\js\third_party\es-module-lexer\es-module-lexer.test.ts
  • test\js\third_party\esbuild\esbuild-child_process.test.ts
  • test\js\third_party\jsonwebtoken\claim-aud.test.js
  • test\js\web\fetch\body-stream.test.ts
  • test\js\web\websocket\websocket.test.js
  • test\js\web\workers\worker.test.ts

Full Test Output

@Jarred-Sumner
Copy link
Collaborator

Instead of making GlobalObjectMethodTable non-const, couldn't we make Zig::GlobalObject a non-final class and then have Zig::EvalGlobalObject which would have the slightly different code path?

@@ -537,7 +538,13 @@ pub const Arguments = struct {
}

if (args.option("--port")) |port_str| {
opts.port = std.fmt.parseInt(u16, port_str, 10) catch return error.InvalidPort;
if (comptime cmd == .RunAsNodeCommand) {
// TODO: prevent `node --port <script>` from working
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

heh nice. i will keep this in mind for the CLI rewrite

@dylan-conway dylan-conway merged commit 3765032 into main Mar 13, 2024
26 of 31 checks passed
@dylan-conway dylan-conway deleted the dylan/print branch March 13, 2024 01:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

crash with Invalid Port
3 participants