Skip to content

Commit

Permalink
Clean up node:fs utimes, futimes , and lutimes (#16634)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarred-Sumner authored Jan 23, 2025
1 parent 8882615 commit b54f3f3
Show file tree
Hide file tree
Showing 16 changed files with 741 additions and 230 deletions.
7 changes: 7 additions & 0 deletions cmake/targets/BuildBun.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ set(BUN_ZIG_GENERATED_CLASSES_OUTPUTS
${CODEGEN_PATH}/ZigGeneratedClasses+DOMIsoSubspaces.h
${CODEGEN_PATH}/ZigGeneratedClasses+lazyStructureImpl.h
${CODEGEN_PATH}/ZigGeneratedClasses.zig
${CODEGEN_PATH}/ZigGeneratedClasses.lut.txt
)

register_command(
Expand Down Expand Up @@ -406,6 +407,7 @@ set(BUN_OBJECT_LUT_SOURCES
${CWD}/src/bun.js/bindings/ProcessBindingConstants.cpp
${CWD}/src/bun.js/bindings/ProcessBindingNatives.cpp
${CWD}/src/bun.js/modules/NodeModuleModule.cpp
${CODEGEN_PATH}/ZigGeneratedClasses.lut.txt
)

set(BUN_OBJECT_LUT_OUTPUTS
Expand All @@ -416,6 +418,7 @@ set(BUN_OBJECT_LUT_OUTPUTS
${CODEGEN_PATH}/ProcessBindingConstants.lut.h
${CODEGEN_PATH}/ProcessBindingNatives.lut.h
${CODEGEN_PATH}/NodeModuleModule.lut.h
${CODEGEN_PATH}/ZigGeneratedClasses.lut.h
)

macro(WEBKIT_ADD_SOURCE_DEPENDENCIES _source _deps)
Expand Down Expand Up @@ -447,6 +450,8 @@ foreach(i RANGE 0 ${BUN_OBJECT_LUT_SOURCES_MAX_INDEX})
bun-codegen-lut-${filename}
COMMENT
"Generating ${filename}.lut.h"
DEPENDS
${BUN_OBJECT_LUT_SOURCE}
COMMAND
${BUN_EXECUTABLE}
run
Expand Down Expand Up @@ -478,6 +483,8 @@ WEBKIT_ADD_SOURCE_DEPENDENCIES(
${CODEGEN_PATH}/ZigGlobalObject.lut.h
)



WEBKIT_ADD_SOURCE_DEPENDENCIES(
${CWD}/src/bun.js/bindings/InternalModuleRegistry.cpp
${CODEGEN_PATH}/InternalModuleRegistryConstants.h
Expand Down
2 changes: 1 addition & 1 deletion src/bun.js/api/Timer.zig
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ pub const All = struct {
else
timespec{ .nsec = 0, .sec = 0 };

this.uv_timer.start(wait.ms(), 0, &onUVTimer);
this.uv_timer.start(wait.msUnsigned(), 0, &onUVTimer);

if (this.active_timer_count > 0) {
this.uv_timer.ref();
Expand Down
172 changes: 44 additions & 128 deletions src/bun.js/node/node.classes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,63 +244,26 @@ export default [
pure: true,
},
},
dev: {
getter: "dev",
},
ino: {
getter: "ino",
},
mode: {
getter: "mode",
},
nlink: {
getter: "nlink",
},
uid: {
getter: "uid",
},
gid: {
getter: "gid",
},
rdev: {
getter: "rdev",
},
size: {
getter: "size",
},
blksize: {
getter: "blksize",
},
blocks: {
getter: "blocks",
},
atime: {
getter: "atime",
cache: true,
},
mtime: {
getter: "mtime",
cache: true,
},
ctime: {
getter: "ctime",
cache: true,
},
birthtime: {
getter: "birthtime",
},
atimeMs: {
getter: "atimeMs",
},
mtimeMs: {
getter: "mtimeMs",
},
ctimeMs: {
getter: "ctimeMs",
},
birthtimeMs: {
getter: "birthtimeMs",
},
},
own: {
dev: "dev",
ino: "ino",
mode: "mode",
nlink: "nlink",
uid: "uid",
gid: "gid",
rdev: "rdev",
size: "size",
blksize: "blksize",
blocks: "blocks",
atimeMs: "atimeMs",
mtimeMs: "mtimeMs",
ctimeMs: "ctimeMs",
birthtimeMs: "birthtimeMs",
atime: "atime",
mtime: "mtime",
ctime: "ctime",
birthtime: "birthtime",
},
}),
define({
Expand Down Expand Up @@ -386,76 +349,30 @@ export default [
pure: true,
},
},
dev: {
getter: "dev",
},
ino: {
getter: "ino",
},
mode: {
getter: "mode",
},
nlink: {
getter: "nlink",
},
uid: {
getter: "uid",
},
gid: {
getter: "gid",
},
rdev: {
getter: "rdev",
},
size: {
getter: "size",
},
blksize: {
getter: "blksize",
},
blocks: {
getter: "blocks",
},
atime: {
getter: "atime",
cache: true,
},
mtime: {
getter: "mtime",
cache: true,
},
ctime: {
getter: "ctime",
cache: true,
},
birthtime: {
getter: "birthtime",
cache: true,
},
atimeMs: {
getter: "atimeMs",
},
mtimeMs: {
getter: "mtimeMs",
},
ctimeMs: {
getter: "ctimeMs",
},
birthtimeMs: {
getter: "birthtimeMs",
},
atimeNs: {
getter: "atimeNs",
},
mtimeNs: {
getter: "mtimeNs",
},
ctimeNs: {
getter: "ctimeNs",
},
birthtimeNs: {
getter: "birthtimeNs",
},
},
own: {
atime: "atime",
atimeMs: "atimeMs",
atimeNs: "atimeNs",
birthtime: "birthtime",
birthtimeMs: "birthtimeMs",
birthtimeNs: "birthtimeNs",
blksize: "blksize",
blocks: "blocks",
ctime: "ctime",
ctimeMs: "ctimeMs",
ctimeNs: "ctimeNs",
dev: "dev",
gid: "gid",
ino: "ino",
mode: "mode",
mtime: "mtime",
mtimeMs: "mtimeMs",
mtimeNs: "mtimeNs",
nlink: "nlink",
rdev: "rdev",
size: "size",
uid: "uid",
},
}),
define({
Expand Down Expand Up @@ -685,4 +602,3 @@ export default [
},
}),
];

Loading

0 comments on commit b54f3f3

Please sign in to comment.