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

zig: make JSValue.toBunString use JSError #15295

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open

Conversation

nektro
Copy link
Member

@nektro nektro commented Nov 20, 2024

progress towards #15141

@robobun
Copy link

robobun commented Nov 20, 2024

@nektro, your commit 720e4aa has 16 failures in #6871:

  • test/regression/issue/09041.test.ts - 1 failing on 🐧 3.20 x64
  • test/js/node/test/parallel/worker-nested-uncaught.test.js - segmentation fault on 🐧 3.20 x64-baseline
  • test/js/node/test/parallel/worker-nested-uncaught.test.js - segmentation fault on 🐧 3.20 x64
  • test/js/web/timers/setTimeout.test.js - 1 failing on 🐧 22.04 x64-baseline
  • test/integration/next-pages/test/dev-server.test.ts - 1 failing on 🐧 3.20 x64-baseline
  • test/integration/next-pages/test/dev-server.test.ts - 1 failing on 🐧 3.20 x64
  • test/v8/v8.test.ts - 22 failing on 🐧 3.20 aarch64
  • test/v8/v8.test.ts - 22 failing on 🐧 3.20 x64-baseline
  • test/v8/v8.test.ts - 22 failing on 🐧 3.20 x64
  • test/js/node/child_process/child_process.test.ts - 1 failing on 🐧 3.20 aarch64
  • test/js/node/child_process/child_process.test.ts - 1 failing on 🐧 3.20 x64-baseline
  • test/js/node/child_process/child_process.test.ts - 1 failing on 🐧 3.20 x64
  • test/js/node/test/parallel/fs-watch-recursive-linux-parallel-remove.test.js - 1 failing on 🐧 20.04 x64-baseline
  • test/js/node/test/parallel/fs-watch-recursive-linux-parallel-remove.test.js - 1 failing on 🐧 22.04 x64-baseline
  • test/js/node/test/parallel/fs-watch-recursive-linux-parallel-remove.test.js - 1 failing on 🐧 12 x64
  • test/js/node/test/parallel/fs-watch-recursive-linux-parallel-remove.test.js - 1 failing on 🐧 11 x64
  • test/js/node/test/parallel/fs-watch-recursive-linux-parallel-remove.test.js - 1 failing on 🐧 22.04 x64
  • test/js/node/test/parallel/fs-watch-recursive-linux-parallel-remove.test.js - 1 failing on 🐧 3.20 aarch64
  • test/js/node/test/parallel/fs-watch-recursive-linux-parallel-remove.test.js - 1 failing on 🐧 3.20 x64-baseline
  • test/js/node/test/parallel/fs-watch-recursive-linux-parallel-remove.test.js - 1 failing on 🐧 3.20 x64
  • test/cli/hot/hot.test.ts - timeout on 🐧 12 x64-baseline
  • test/integration/next-pages/test/next-build.test.ts - 1 failing on 🐧 22.04 aarch64
  • test/integration/next-pages/test/next-build.test.ts - 1 failing on 🐧 22.04 x64
  • test/js/node/watch/fs.watch.test.ts - 3 failing on 🍎 14 aarch64
  • test/js/node/test/parallel/fs-watch-recursive-sync-write.test.js - 1 failing on 🍎 14 aarch64
  • test/js/node/test/parallel/fs-watch-encoding.test.js - 2 failing on 🍎 14 aarch64
  • test/js/bun/http/serve.test.ts - 1 failing on 🍎 13 aarch64
  • test/js/bun/http/serve.test.ts - 1 failing on 🍎 14 x64
  • test/js/bun/http/serve.test.ts - 1 failing on 🍎 13 x64
  • test/js/bun/http/serve.test.ts - segmentation fault on 🐧 3.20 aarch64
  • test/js/bun/http/serve.test.ts - segmentation fault on 🐧 3.20 x64-baseline
  • test/js/bun/http/serve.test.ts - segmentation fault on 🐧 3.20 x64
  • test/js/web/websocket/websocket-client.test.ts - 1 failing on 🪟 2019 x64
  • test/js/bun/test/test-test.test.ts - 1 failing on 🪟 2019 x64
  • test/cli/install/registry/bun-install-registry.test.ts - 1 failing on 🍎 14 aarch64
  • @nektro nektro marked this pull request as ready for review November 21, 2024 03:25
    @nektro nektro requested a review from dylan-conway November 21, 2024 21:02
    Copy link
    Collaborator

    @Jarred-Sumner Jarred-Sumner left a comment

    Choose a reason for hiding this comment

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

    We cannot merge this without tests that verify these bindings work.

    @@ -1106,7 +1106,7 @@ pub const JestPrettyFormat = struct {
    defer message_string.deref();

    if (value.fastGet(this.globalThis, .message)) |message_prop| {
    message_string = message_prop.toBunString(this.globalThis);
    message_string = message_prop.toBunString(this.globalThis) catch bun.String.static("(threw exception creating message)");
    Copy link
    Member

    Choose a reason for hiding this comment

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

    should this exception be cleared?

    @@ -328,7 +326,7 @@ pub const WebWorker = struct {
    var vm = this.vm orelse return;
    if (vm.log.msgs.items.len == 0) return;
    const err = vm.log.toJS(vm.global, bun.default_allocator, "Error in worker");
    const str = err.toBunString(vm.global);
    const str = err.toBunString(vm.global) catch bun.String.static("(threw exception creating message)");
    Copy link
    Member

    Choose a reason for hiding this comment

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

    should this exception be cleared?


    var preloads = std.ArrayList([]const u8).initCapacity(bun.default_allocator, preload_modules_len) catch bun.outOfMemory();
    for (preload_modules) |module| {
    const utf8_slice = module.toUTF8(bun.default_allocator);
    defer utf8_slice.deinit();
    if (resolveEntryPointSpecifier(parent, utf8_slice.slice(), error_message, &temp_log)) |preload| {
    if (resolveEntryPointSpecifier(parent, utf8_slice.slice(), error_message, &temp_log) catch return null) |preload| {
    Copy link
    Member

    Choose a reason for hiding this comment

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

    caller cannot differentiate error.OutOfMemory and error.JSError

    const path = resolveEntryPointSpecifier(parent, spec_slice.slice(), error_message, &temp_log) orelse {
    return null;
    };
    const path = (resolveEntryPointSpecifier(parent, spec_slice.slice(), error_message, &temp_log) catch return null) orelse return null;

    var preloads = std.ArrayList([]const u8).initCapacity(bun.default_allocator, preload_modules_len) catch bun.outOfMemory();
    Copy link
    Member

    Choose a reason for hiding this comment

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

    memory leak if line 206 returns.

    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.

    4 participants