aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bun.js/api/JSBundler.zig5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/bun.js/api/JSBundler.zig b/src/bun.js/api/JSBundler.zig
index c95c359f1..741d956bf 100644
--- a/src/bun.js/api/JSBundler.zig
+++ b/src/bun.js/api/JSBundler.zig
@@ -494,6 +494,11 @@ pub const JSBundler = struct {
globalThis: *JSC.JSGlobalObject,
arguments: []const JSC.JSValue,
) JSC.JSValue {
+ if (arguments.len == 0 or !arguments[0].isObject()) {
+ globalThis.throwInvalidArguments("Expected a config object to be passed to Bun.build", .{});
+ return JSC.JSValue.jsUndefined();
+ }
+
var plugins: ?*Plugin = null;
const config = Config.fromJS(globalThis, arguments[0], &plugins, globalThis.allocator()) catch {
return JSC.JSValue.jsUndefined();