mirror of
https://github.com/oven-sh/bun
synced 2026-02-14 12:51:54 +00:00
more oops
This commit is contained in:
@@ -2542,10 +2542,13 @@ pub const Arguments = struct {
|
||||
|
||||
if (arguments.next()) |arg_position| {
|
||||
arguments.eat();
|
||||
const num: i64 = try JSC.Node.validators.validateIntegerOrBigInt(ctx, arg_position, "position", -1, 9007199254740991);
|
||||
|
||||
if (num >= 0)
|
||||
args.position = @as(ReadPosition, @intCast(num));
|
||||
if (!arg_position.isNull()) {
|
||||
const num: i64 = try JSC.Node.validators.validateIntegerOrBigInt(ctx, arg_position, "position", -1, 9007199254740991);
|
||||
|
||||
if (num >= 0)
|
||||
args.position = @as(ReadPosition, @intCast(num));
|
||||
}
|
||||
}
|
||||
} else if (current.isObject()) {
|
||||
if (try current.getTruthy(ctx, "offset")) |num| {
|
||||
|
||||
@@ -259,7 +259,7 @@ describe("fs.watch", () => {
|
||||
} catch (err: any) {
|
||||
expect(err).toBeInstanceOf(Error);
|
||||
expect(err.code).toBe("ENOENT");
|
||||
expect(err.syscall).toBe("open");
|
||||
expect(err.syscall).toBe("watch");
|
||||
done();
|
||||
}
|
||||
});
|
||||
@@ -447,10 +447,10 @@ describe("fs.watch", () => {
|
||||
watcher.close();
|
||||
expect.unreachable();
|
||||
} catch (err: any) {
|
||||
expect(err.message).toBe(`EACCES: permission denied, open '${filepath}'`);
|
||||
expect(err.message).toBe(`EACCES: permission denied, watch '${filepath}'`);
|
||||
expect(err.path).toBe(filepath);
|
||||
expect(err.code).toBe("EACCES");
|
||||
expect(err.syscall).toBe("open");
|
||||
expect(err.syscall).toBe("watch");
|
||||
}
|
||||
});
|
||||
|
||||
@@ -464,10 +464,10 @@ describe("fs.watch", () => {
|
||||
watcher.close();
|
||||
expect.unreachable();
|
||||
} catch (err: any) {
|
||||
expect(err.message).toBe(`EACCES: permission denied, open '${filepath}'`);
|
||||
expect(err.message).toBe(`EACCES: permission denied, watch '${filepath}'`);
|
||||
expect(err.path).toBe(filepath);
|
||||
expect(err.code).toBe("EACCES");
|
||||
expect(err.syscall).toBe("open");
|
||||
expect(err.syscall).toBe("watch");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user