Skip to content

Commit

Permalink
" -> ' (#14776)
Browse files Browse the repository at this point in the history
      Co-authored-by: Jarred Sumner <[email protected]>
  • Loading branch information
nektro authored Oct 24, 2024
1 parent 2de2e9f commit 6f60523
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions src/bun.js/ResolveMessage.zig
Original file line number Diff line number Diff line change
Expand Up @@ -69,22 +69,22 @@ pub const ResolveMessage = struct {
switch (err) {
error.ModuleNotFound => {
if (strings.eqlComptime(referrer, "bun:main")) {
return try std.fmt.allocPrint(allocator, "Module not found \"{s}\"", .{specifier});
return try std.fmt.allocPrint(allocator, "Module not found '{s}'", .{specifier});
}
if (Resolver.isPackagePath(specifier) and !strings.containsChar(specifier, '/')) {
return try std.fmt.allocPrint(allocator, "Cannot find package \"{s}\" from \"{s}\"", .{ specifier, referrer });
return try std.fmt.allocPrint(allocator, "Cannot find package '{s}' from '{s}'", .{ specifier, referrer });
} else {
return try std.fmt.allocPrint(allocator, "Cannot find module \"{s}\" from \"{s}\"", .{ specifier, referrer });
return try std.fmt.allocPrint(allocator, "Cannot find module '{s}' from '{s}'", .{ specifier, referrer });
}
},
error.InvalidDataURL => {
return try std.fmt.allocPrint(allocator, "Cannot resolve invalid data URL \"{s}\" from \"{s}\"", .{ specifier, referrer });
return try std.fmt.allocPrint(allocator, "Cannot resolve invalid data URL '{s}' from '{s}'", .{ specifier, referrer });
},
else => {
if (Resolver.isPackagePath(specifier)) {
return try std.fmt.allocPrint(allocator, "{s} while resolving package \"{s}\" from \"{s}\"", .{ @errorName(err), specifier, referrer });
return try std.fmt.allocPrint(allocator, "{s} while resolving package '{s}' from '{s}'", .{ @errorName(err), specifier, referrer });
} else {
return try std.fmt.allocPrint(allocator, "{s} while resolving \"{s}\" from \"{s}\"", .{ @errorName(err), specifier, referrer });
return try std.fmt.allocPrint(allocator, "{s} while resolving '{s}' from '{s}'", .{ @errorName(err), specifier, referrer });
}
},
}
Expand Down
4 changes: 2 additions & 2 deletions test/js/bun/resolve/import-meta.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ it("Module.createRequire does not use file url as the referrer (err message chec
} catch (e) {
expect(e.name).not.toBe("UnreachableError");
expect(e.message).not.toInclude("file:///");
expect(e.message).toInclude('"whaaat"');
expect(e.message).toInclude('"' + import.meta.path + '"');
expect(e.message).toInclude(`'whaaat'`);
expect(e.message).toInclude(`'` + import.meta.path + `'`);
}
});

Expand Down
4 changes: 2 additions & 2 deletions test/js/node/missing-module.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ import { expect, test } from "bun:test";

test("not implemented yet module throws an error", () => {
const missingModule = "node:missing" + "";
expect(() => require(missingModule)).toThrow(/^Cannot find package "node:missing" from "/);
expect(() => import(missingModule)).toThrow(/^Cannot find package "node:missing" from "/);
expect(() => require(missingModule)).toThrow(/^Cannot find package 'node:missing' from '/);
expect(() => import(missingModule)).toThrow(/^Cannot find package 'node:missing' from '/);
});
2 changes: 1 addition & 1 deletion test/js/node/worker_threads/worker_threads.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ test("support require in eval for a file that doesnt exist", async () => {
worker.on("message", resolve);
worker.on("error", resolve);
});
expect(result.toString()).toInclude(`error: Cannot find module "./fixture-invalid.js" from "blob:`);
expect(result.toString()).toInclude(`error: Cannot find module './fixture-invalid.js' from 'blob:`);
await worker.terminate();
});

Expand Down

0 comments on commit 6f60523

Please sign in to comment.