aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-11-15 00:13:09 -0800
committerGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-11-15 00:13:09 -0800
commitc7e3b4aaa6d0ffdcaca3cadd79fe9ef3d96d3ef6 (patch)
tree95c18a00a89ac0df66bccd9e0559d9eb7205fb08
parent44babb9ce5a4e26fc43b002dedbf194c31331a0e (diff)
downloadbun-c7e3b4aaa6d0ffdcaca3cadd79fe9ef3d96d3ef6.tar.gz
bun-c7e3b4aaa6d0ffdcaca3cadd79fe9ef3d96d3ef6.tar.zst
bun-c7e3b4aaa6d0ffdcaca3cadd79fe9ef3d96d3ef6.zip
-rw-r--r--.vscode/c_cpp_properties.json2
-rw-r--r--.vscode/launch.json17
-rw-r--r--packages/bun-crash-report-symbolizer/index.ts42
-rw-r--r--src/bun.js/bindings/ImportMetaObject.cpp5
-rw-r--r--src/bun.js/builtins/cpp/ProcessObjectBuiltins.cpp12
-rw-r--r--src/bun.js/builtins/cpp/ProcessObjectBuiltins.h9
-rw-r--r--src/bun.js/builtins/js/ProcessObject.js5
-rw-r--r--src/bun.js/javascript.zig4
-rw-r--r--src/bun.js/streams.exports.js3
-rw-r--r--src/bun.js/webcore/streams.zig31
-rw-r--r--src/bun_js.zig6
-rw-r--r--src/bunfig.zig15
-rw-r--r--src/cli.zig5
-rw-r--r--src/http/zlib.zig6
-rw-r--r--src/js_lexer.zig39
-rw-r--r--src/linker.zig21
-rw-r--r--src/resolver/resolver.zig11
-rw-r--r--src/runtime.js1
-rw-r--r--test/bun.js/esbuild-child_process.test.ts14
-rw-r--r--test/bun.js/import-meta.test.js6
-rwxr-xr-xtest/fixtures/bun-link-to-pkg-fixture/bun.lockbbin1655 -> 1679 bytes
21 files changed, 189 insertions, 65 deletions
diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json
index 56cde0394..b337823a8 100644
--- a/.vscode/c_cpp_properties.json
+++ b/.vscode/c_cpp_properties.json
@@ -4,7 +4,6 @@
"name": "Mac",
"forcedInclude": ["${workspaceFolder}/src/bun.js/bindings/root.h"],
"includePath": [
- "${workspaceFolder}/../webkit-build/include/",
"${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Release/",
"${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Release/ICU/Headers/",
"${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Release/JavaScriptCore/PrivateHeaders/",
@@ -23,7 +22,6 @@
],
"browse": {
"path": [
- "${workspaceFolder}/../webkit-build/include/",
"${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Release/",
"${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Release/ICU/Headers/",
"${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Release/JavaScriptCore/PrivateHeaders/**",
diff --git a/.vscode/launch.json b/.vscode/launch.json
index 3d5f4b58b..cca0a2e61 100644
--- a/.vscode/launch.json
+++ b/.vscode/launch.json
@@ -7,7 +7,7 @@
"name": "bun test",
"program": "bun-debug",
"args": ["wiptest", "${file}"],
- "cwd": "${workspaceFolder}/test",
+ "cwd": "${workspaceFolder}/test/bun.js",
"env": {
"FORCE_COLOR": "1"
},
@@ -19,7 +19,7 @@
"name": "bun test (all)",
"program": "bun-debug",
"args": ["wiptest"],
- "cwd": "${workspaceFolder}/test",
+ "cwd": "${workspaceFolder}/test/bun.js",
"env": {
"FORCE_COLOR": "1"
},
@@ -30,8 +30,8 @@
"request": "launch",
"name": "bun run current file",
"program": "bun-debug",
- "args": ["${file}"],
- "cwd": "${file}/../../",
+ "args": ["-i", "${file}"],
+ "cwd": "${file}/../",
"env": {
"FORCE_COLOR": "1"
},
@@ -104,6 +104,15 @@
"args": ["https://example.com", "--verbose"],
"cwd": "${workspaceFolder}",
"console": "internalConsole"
+ },
+ {
+ "type": "lldb",
+ "request": "launch",
+ "name": "bun link test",
+ "program": "bun-debug",
+ "args": ["install"],
+ "cwd": "${workspaceFolder}/test/fixtures/bun-link-to-pkg-fixture",
+ "console": "internalConsole"
}
]
}
diff --git a/packages/bun-crash-report-symbolizer/index.ts b/packages/bun-crash-report-symbolizer/index.ts
new file mode 100644
index 000000000..671322547
--- /dev/null
+++ b/packages/bun-crash-report-symbolizer/index.ts
@@ -0,0 +1,42 @@
+import { which } from "bun";
+
+const symbolizerPath = ["llvm-symbolizer-13", "llvm-symbolizer"].find((a) =>
+ which(a),
+);
+
+if (!symbolizerPath) {
+ throw new Error("llvm-symbolizer not found in $PATH");
+}
+
+export const symbolizer = symbolizerPath;
+
+function readCrashReport(text: string) {
+ const lines = text
+ .split("\n")
+ .map((a) => a.trim())
+ .filter((a) => a.length > 0);
+
+ const metaOffset = lines.findIndex((a) => a.includes(" bun meta "));
+ let lastMetaLine = metaOffset + 1;
+ for (; lastMetaLine < lines.length; lastMetaLine++) {
+ const line = lines[lastMetaLine];
+ if (line.includes(" bun meta ")) break;
+ }
+
+ const meta = lines.slice(metaOffset, lastMetaLine);
+ console.log(metaOffset, lastMetaLine);
+ const version = /v(\d+\.\d+\.\d+)/.exec(meta[0])?.[1];
+ var stack = lines
+ .slice(lastMetaLine + 1)
+ .filter((a) => a.length > 0 && !a.includes("ask for"));
+
+ return { version, stack };
+}
+
+console.log(
+ readCrashReport(
+ await Bun.file(
+ "/Users/jarred/.bun/.bun-crash/v0.2.3-1668157348119.crash",
+ ).text(),
+ ),
+);
diff --git a/src/bun.js/bindings/ImportMetaObject.cpp b/src/bun.js/bindings/ImportMetaObject.cpp
index cdd00ced2..09a77d57d 100644
--- a/src/bun.js/bindings/ImportMetaObject.cpp
+++ b/src/bun.js/bindings/ImportMetaObject.cpp
@@ -155,6 +155,11 @@ JSObject* Zig::ImportMetaObject::createRequireFunction(VM& vm, JSGlobalObject* g
auto clientData = WebCore::clientData(vm);
requireFunction->putDirectCustomAccessor(vm, clientData->builtinNames().resolvePublicName(), JSC::CustomGetterSetter::create(vm, functionRequireResolveLazyGetter, functionRequireResolveLazySetter), 0);
requireFunction->putDirect(vm, clientData->builtinNames().pathPrivateName(), jsOwnedString(vm, pathString), JSC::PropertyAttribute::DontEnum | 0);
+
+ // TODO: use a polyfill with @requireMap to Proxy it so it works for real
+ // This is just a temporary workaround
+ requireFunction->putDirect(vm, JSC::Identifier::fromString(vm, "cache"_s), JSC::constructEmptyObject(globalObject), 0);
+
return requireFunction;
}
diff --git a/src/bun.js/builtins/cpp/ProcessObjectBuiltins.cpp b/src/bun.js/builtins/cpp/ProcessObjectBuiltins.cpp
index 0a0389ca3..953c8b730 100644
--- a/src/bun.js/builtins/cpp/ProcessObjectBuiltins.cpp
+++ b/src/bun.js/builtins/cpp/ProcessObjectBuiltins.cpp
@@ -49,6 +49,18 @@
namespace WebCore {
+const JSC::ConstructAbility s_processObjectEmitWarningCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_processObjectEmitWarningCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_processObjectEmitWarningCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_processObjectEmitWarningCodeLength = 83;
+static const JSC::Intrinsic s_processObjectEmitWarningCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_processObjectEmitWarningCode =
+ "(function (warning) {\n" \
+ " \"use strict\";\n" \
+ " console.warn.apply(console, arguments);\n" \
+ "})\n" \
+;
+
#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
diff --git a/src/bun.js/builtins/cpp/ProcessObjectBuiltins.h b/src/bun.js/builtins/cpp/ProcessObjectBuiltins.h
index b48359479..1a598b911 100644
--- a/src/bun.js/builtins/cpp/ProcessObjectBuiltins.h
+++ b/src/bun.js/builtins/cpp/ProcessObjectBuiltins.h
@@ -48,13 +48,22 @@ class FunctionExecutable;
namespace WebCore {
/* ProcessObject */
+extern const char* const s_processObjectEmitWarningCode;
+extern const int s_processObjectEmitWarningCodeLength;
+extern const JSC::ConstructAbility s_processObjectEmitWarningCodeConstructAbility;
+extern const JSC::ConstructorKind s_processObjectEmitWarningCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_processObjectEmitWarningCodeImplementationVisibility;
#define WEBCORE_FOREACH_PROCESSOBJECT_BUILTIN_DATA(macro) \
+ macro(emitWarning, processObjectEmitWarning, 1) \
+#define WEBCORE_BUILTIN_PROCESSOBJECT_EMITWARNING 1
#define WEBCORE_FOREACH_PROCESSOBJECT_BUILTIN_CODE(macro) \
+ macro(processObjectEmitWarningCode, emitWarning, ASCIILiteral(), s_processObjectEmitWarningCodeLength) \
#define WEBCORE_FOREACH_PROCESSOBJECT_BUILTIN_FUNCTION_NAME(macro) \
+ macro(emitWarning) \
#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
JSC::FunctionExecutable* codeName##Generator(JSC::VM&);
diff --git a/src/bun.js/builtins/js/ProcessObject.js b/src/bun.js/builtins/js/ProcessObject.js
index beaa4aa7a..a61b020b1 100644
--- a/src/bun.js/builtins/js/ProcessObject.js
+++ b/src/bun.js/builtins/js/ProcessObject.js
@@ -22,3 +22,8 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+
+function emitWarning(warning) {
+ "use strict";
+ console.warn.apply(console, arguments);
+}
diff --git a/src/bun.js/javascript.zig b/src/bun.js/javascript.zig
index 260aca28e..fd4a510db 100644
--- a/src/bun.js/javascript.zig
+++ b/src/bun.js/javascript.zig
@@ -1047,6 +1047,10 @@ pub const VirtualMachine = struct {
return;
};
+ if (log.msgs.items.len > 0) {
+ log.appendToWithRecycled(old_log, true) catch {};
+ }
+
res.* = ErrorableZigString.ok(ZigString.init(result.path));
}
diff --git a/src/bun.js/streams.exports.js b/src/bun.js/streams.exports.js
index 4e812437e..c6c2a5a00 100644
--- a/src/bun.js/streams.exports.js
+++ b/src/bun.js/streams.exports.js
@@ -2039,7 +2039,7 @@ var require_destroy = __commonJS({
r.destroyed = true;
}
if (!s.constructed) {
- this.once(kDestroy, function (er) {
+ this.once(kDestroy, (er) => {
_destroy(this, aggregateTwoErrors(er, err), cb);
});
} else {
@@ -5825,6 +5825,7 @@ function createNativeStream(nativeType, Readable) {
}
_construct(cb) {
+ // TODO: why do we need to set this flag here?
this._readableState.constructed = true;
cb();
}
diff --git a/src/bun.js/webcore/streams.zig b/src/bun.js/webcore/streams.zig
index dcbe12ce2..a0a7091f5 100644
--- a/src/bun.js/webcore/streams.zig
+++ b/src/bun.js/webcore/streams.zig
@@ -3767,22 +3767,25 @@ pub const FileReader = struct {
.pending = &this.pending,
};
}
- }
-
- // const rc: JSC.Node.Maybe(usize) = if (comptime Environment.isLinux) brk: {
- // if (len == 65536 and this.has_adjusted_pipe_size_on_linux and buf_to_use.len > len) {
- // var iovecs = [_]std.os.iovec{.{ .iov_base = @intToPtr([*]u8, @ptrToInt(buf_to_use.ptr)), .iov_len = @intCast(usize, buf_to_use.len) }};
- // const rc = bun.C.linux.vmsplice(fd, &iovecs, 1, 0);
- // Output.debug("vmsplice({d}, {d}) = {d}", .{ fd, buf_to_use.len, rc });
- // if (JSC.Node.Maybe(usize).errnoSys(rc, .read)) |err| {
- // break :brk err;
- // }
+ } else if (this.isFIFO() and this.poll_ref == null and available_to_read == null) {
+ // we don't know if it's readable or not
+ if (!bun.isReadable(fd)) {
+ if (free_buffer_on_error) {
+ bun.default_allocator.free(buf_to_use);
+ buf_to_use = read_buf;
+ }
- // break :brk JSC.Node.Maybe(usize){ .result = @intCast(usize, rc) };
- // }
+ if (view != .zero) {
+ this.view.set(this.globalThis(), view);
+ this.buf = read_buf;
+ }
- // break :brk Syscall.read(fd, buf_to_use);
- // } else Syscall.read(fd, buf_to_use);
+ this.watch(fd);
+ return .{
+ .pending = &this.pending,
+ };
+ }
+ }
switch (Syscall.read(fd, buf_to_use)) {
.err => |err| {
diff --git a/src/bun_js.zig b/src/bun_js.zig
index d406033a1..d448afe05 100644
--- a/src/bun_js.zig
+++ b/src/bun_js.zig
@@ -60,6 +60,12 @@ pub const Run = struct {
run.vm.argv = ctx.passthrough;
run.vm.arena = &run.arena;
+ if (ctx.debug.log_level) |level| {
+ run.vm.bundler.options.log.level = level;
+ run.vm.bundler.resolver.log.level = level;
+ run.vm.log.level = level;
+ }
+
run.vm.bundler.options.install = ctx.install;
run.vm.bundler.resolver.opts.install = ctx.install;
run.vm.bundler.resolver.opts.global_cache = ctx.debug.global_cache;
diff --git a/src/bunfig.zig b/src/bunfig.zig
index d2ca86380..63d673cdc 100644
--- a/src/bunfig.zig
+++ b/src/bunfig.zig
@@ -104,18 +104,11 @@ pub const Bunfig = struct {
fn loadLogLevel(this: *Parser, expr: js_ast.Expr) !void {
try this.expect(expr, .e_string);
- const Matcher = strings.ExactSizeMatcher(8);
-
- this.bunfig.log_level = switch (Matcher.match(expr.asString(this.allocator).?)) {
- Matcher.case("debug") => Api.MessageLevel.debug,
- Matcher.case("error") => Api.MessageLevel.err,
- Matcher.case("warn") => Api.MessageLevel.warn,
- Matcher.case("info") => Api.MessageLevel.info,
- else => {
- try this.addError(expr.loc, "Invalid log level, must be one of debug, error, or warn");
- unreachable;
- },
+ this.ctx.debug.log_level = logger.Log.Level.Map.get(expr.asString(this.allocator).?) orelse {
+ try this.addError(expr.loc, "Invalid log level, must be one of \"debug\", \"error\", \"warn\", \"info\", \"verbose\"");
+ unreachable;
};
+ logger.Log.default_log_level = this.ctx.debug.log_level.?;
}
pub fn parse(this: *Parser, comptime cmd: Command.Tag) !void {
diff --git a/src/cli.zig b/src/cli.zig
index 0e79b1e21..8345051f0 100644
--- a/src/cli.zig
+++ b/src/cli.zig
@@ -671,6 +671,9 @@ pub const Arguments = struct {
else => logger.Log.Level.err,
};
ctx.log.level = logger.Log.default_log_level;
+ } else if (ctx.debug.log_level) |level| {
+ logger.Log.default_log_level = level;
+ ctx.log.level = logger.Log.default_log_level;
}
opts.output_dir = output_dir;
@@ -816,6 +819,8 @@ pub const Command = struct {
global_cache: options.GlobalCache = .auto,
offline_mode_setting: ?Bunfig.OfflineMode = null,
+ log_level: ?logger.Log.Level = null,
+
// technical debt
macros: ?MacroMap = null,
editor: string = "",
diff --git a/src/http/zlib.zig b/src/http/zlib.zig
index 4a2e88bec..5651cc327 100644
--- a/src/http/zlib.zig
+++ b/src/http/zlib.zig
@@ -23,7 +23,11 @@ pub fn put(mutable: *MutableString) void {
}
pub fn decompress(compressed_data: []const u8, output: *MutableString) Zlib.ZlibError!void {
- var reader = try Zlib.ZlibReaderArrayList.init(compressed_data, &output.list, output.allocator);
+ var reader = try Zlib.ZlibReaderArrayList.init(
+ compressed_data,
+ &output.list,
+ output.allocator,
+ );
try reader.readAll();
reader.deinit();
}
diff --git a/src/js_lexer.zig b/src/js_lexer.zig
index 134497421..9a4795fa8 100644
--- a/src/js_lexer.zig
+++ b/src/js_lexer.zig
@@ -2437,9 +2437,7 @@ fn NewLexer_(
else => {},
}
- if (strings.indexOfChar(text, '\r') == null) {
- return text;
- }
+ var i = strings.indexOfChar(text, '\r') orelse return text;
// From the specification:
//
@@ -2450,28 +2448,27 @@ fn NewLexer_(
// <LF> for both TV and TRV. An explicit EscapeSequence is needed to
// include a <CR> or <CR><LF> sequence.
var bytes = MutableString.init(lexer.allocator, text.len) catch unreachable;
- var end: usize = 0;
- var i: usize = 0;
- var c: u8 = '0';
- while (i < bytes.list.items.len) {
- c = bytes.list.items[i];
- i += 1;
-
- if (c == '\r') {
- // Convert '\r\n' into '\n'
- if (i < bytes.list.items.len and bytes.list.items[i] == '\n') {
- i += 1;
- }
+ bytes.appendAssumeCapacity(text[0..i]) catch unreachable;
+ var remain = text[i..];
+ if (remain[0] == '\n') {
+ bytes.appendChar('\n');
+ remain = remain[1..];
+ }
- // Convert '\r' into '\n'
- c = '\n';
+ while (strings.indexofChar(remain, '\r')) |j| {
+ bytes.appendAssumeCapacity(remain[0..j]) catch unreachable;
+ remain = remain[j..];
+ if (remain[0] == '\n') {
+ bytes.appendCharAssumeCapacity('\n');
+ remain = remain[1..];
+ } else {
+ bytes.appendCharAssumeCapacity('\r');
}
-
- bytes.list.items[end] = c;
- end += 1;
}
- return bytes.toOwnedSliceLength(end + 1);
+ bytes.appendAssumeCapacity(remain) catch unreachable;
+
+ return bytes.toOwnedSlice();
}
fn parseNumericLiteralOrDot(lexer: *LexerType) !void {
diff --git a/src/linker.zig b/src/linker.zig
index 9855dc82c..a539c249a 100644
--- a/src/linker.zig
+++ b/src/linker.zig
@@ -803,6 +803,7 @@ pub const Linker = struct {
result.ast.runtime_import_record_id = @truncate(u32, new_import_records.len - 1);
import_records = new_import_records;
}
+ // if (comptime !is_bun) {
// We _assume_ you're importing ESM.
// But, that assumption can be wrong without parsing code of the imports.
@@ -833,6 +834,26 @@ pub const Linker = struct {
result.ast.prepend_part = js_ast.Part{ .stmts = std.mem.span(&require_part_stmts) };
}
+ // } else {
+ // if (needs_require and !result.ast.uses_require_ref) {
+ // result.ast.uses_require_ref = true;
+ // var decls = try linker.allocator.alloc(js_ast.G.Decl, 1);
+ // decls[0] = .{
+ // .binding = js_ast.Binding.alloc(linker.allocator, js_ast.B.Identifier{ .ref = result.ast.require_ref }),
+ // };
+ // var require_local_statement = js_ast.Stmt.alloc(js_ast.S.Local, js_ast.S.Local{
+ // .kind = .k_var,
+ // .decls = decls,
+ // });
+
+ // require_part_stmts[0] = js_ast.Stmt{
+ // .data = .{ .s_import = &require_part_import_statement },
+ // .loc = logger.Loc.Empty,
+ // };
+
+ // result.ast.prepend_part = js_ast.Part{ .stmts = std.mem.span(&require_part_stmts) };
+ // }
+ // }
}
const ImportPathsList = allocators.BSSStringList(512, 128);
diff --git a/src/resolver/resolver.zig b/src/resolver/resolver.zig
index 9fad998cb..765fc6b77 100644
--- a/src/resolver/resolver.zig
+++ b/src/resolver/resolver.zig
@@ -541,11 +541,14 @@ pub const Resolver = struct {
pub fn flushDebugLogs(r: *ThisResolver, flush_mode: DebugLogs.FlushMode) !void {
if (r.debug_logs) |*debug| {
- if (flush_mode == DebugLogs.FlushMode.fail) {
- try r.log.addRangeDebugWithNotes(null, logger.Range{ .loc = logger.Loc{} }, debug.what, debug.notes.toOwnedSlice());
- } else if (@enumToInt(r.log.level) <= @enumToInt(logger.Log.Level.verbose)) {
- try r.log.addVerboseWithNotes(null, logger.Loc.Empty, debug.what, debug.notes.toOwnedSlice());
+ if (debug.notes.items.len > 0) {
+ if (flush_mode == DebugLogs.FlushMode.fail) {
+ try r.log.addRangeDebugWithNotes(null, logger.Range{ .loc = logger.Loc{} }, debug.what, debug.notes.toOwnedSlice());
+ } else if (@enumToInt(r.log.level) <= @enumToInt(logger.Log.Level.verbose)) {
+ try r.log.addVerboseWithNotes(null, logger.Loc.Empty, debug.what, debug.notes.toOwnedSlice());
+ }
}
+ r.debug_logs = null;
}
}
var tracing_start: i128 = if (FeatureFlags.tracing) 0 else undefined;
diff --git a/src/runtime.js b/src/runtime.js
index b39eaed9d..7d78cc82a 100644
--- a/src/runtime.js
+++ b/src/runtime.js
@@ -155,6 +155,7 @@ export var __require = (namespace) => {
__require.d = (namespace) => {
return namespace;
};
+__require.cache = {};
export var $$m = __commonJS;
diff --git a/test/bun.js/esbuild-child_process.test.ts b/test/bun.js/esbuild-child_process.test.ts
index a7eb4f079..37713def2 100644
--- a/test/bun.js/esbuild-child_process.test.ts
+++ b/test/bun.js/esbuild-child_process.test.ts
@@ -2,13 +2,13 @@ import { transform, transformSync } from "esbuild";
import { describe, it, expect } from "bun:test";
describe("child_process.spawn - esbuild", () => {
- it("should transform successfully", async () => {
- const result = await transform("console.log('hello world')", {
- loader: "js",
- target: "node12",
- });
- expect(result.code).toBe('console.log("hello world");\n');
- });
+ // it("should transform successfully", async () => {
+ // const result = await transform("console.log('hello world')", {
+ // loader: "js",
+ // target: "node12",
+ // });
+ // expect(result.code).toBe('console.log("hello world");\n');
+ // });
it("works for input exceeding the pipe capacity", async () => {
const hugeString = `console.log(${JSON.stringify("a".repeat(1000000))});`;
diff --git a/test/bun.js/import-meta.test.js b/test/bun.js/import-meta.test.js
index a6d663061..26adea139 100644
--- a/test/bun.js/import-meta.test.js
+++ b/test/bun.js/import-meta.test.js
@@ -22,6 +22,12 @@ it("import.meta.resolveSync", () => {
).toBe(import.meta.path);
});
+it("require.cache", () => {
+ expect(require.cache).toBe(import.meta.require.cache);
+ expect(typeof require.cache).toBe("object");
+ expect(require.cache !== null).toBe(true);
+});
+
it("import.meta.require (json)", () => {
expect(import.meta.require("./require-json.json").hello).toBe(sync.hello);
const require = Module.createRequire(import.meta.path);
diff --git a/test/fixtures/bun-link-to-pkg-fixture/bun.lockb b/test/fixtures/bun-link-to-pkg-fixture/bun.lockb
index d148ae18a..3af281479 100755
--- a/test/fixtures/bun-link-to-pkg-fixture/bun.lockb
+++ b/test/fixtures/bun-link-to-pkg-fixture/bun.lockb
Binary files differ