Skip to content

Commit 2880b90

Browse files
[autofix.ci] apply automated fixes
1 parent 8f244fc commit 2880b90

File tree

2 files changed

+37
-11
lines changed

2 files changed

+37
-11
lines changed

src/bun.js/bindings/BunProcess.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1945,7 +1945,7 @@ static JSValue constructReportObjectComplete(VM& vm, Zig::GlobalObject* globalOb
19451945
// Windows version info
19461946
{
19471947
// Get Windows version using RtlGetVersion which is more reliable
1948-
typedef LONG(WINAPI *RtlGetVersionFunc)(PRTL_OSVERSIONINFOEXW);
1948+
typedef LONG(WINAPI * RtlGetVersionFunc)(PRTL_OSVERSIONINFOEXW);
19491949
HMODULE hNtDll = GetModuleHandleW(L"ntdll.dll");
19501950

19511951
if (hNtDll) {
@@ -2117,7 +2117,7 @@ static JSValue constructReportObjectComplete(VM& vm, Zig::GlobalObject* globalOb
21172117
if (GetProcessMemoryInfo(hProcess, (PROCESS_MEMORY_COUNTERS*)&pmc, sizeof(pmc))) {
21182118
heap->putDirect(vm, JSC::Identifier::fromString(vm, "totalMemory"_s), JSC::jsNumber(pmc.WorkingSetSize), 0);
21192119
heap->putDirect(vm, JSC::Identifier::fromString(vm, "usedMemory"_s), JSC::jsNumber(pmc.WorkingSetSize), 0);
2120-
heap->putDirect(vm, JSC::Identifier::fromString(vm, "mallocedMemory"_s), JSC::jsNumber(pmc.PagefileUsage), 0); // PagefileUsage is more compatible
2120+
heap->putDirect(vm, JSC::Identifier::fromString(vm, "mallocedMemory"_s), JSC::jsNumber(pmc.PagefileUsage), 0); // PagefileUsage is more compatible
21212121
heap->putDirect(vm, JSC::Identifier::fromString(vm, "peakMallocedMemory"_s), JSC::jsNumber(pmc.PeakWorkingSetSize), 0);
21222122
} else {
21232123
heap->putDirect(vm, JSC::Identifier::fromString(vm, "totalMemory"_s), JSC::jsNumber(0), 0);
@@ -2202,7 +2202,6 @@ static JSValue constructReportObjectComplete(VM& vm, Zig::GlobalObject* globalOb
22022202
return sharedObjects;
22032203
};
22042204

2205-
22062205
// Build the complete report object
22072206
{
22082207
JSC::JSObject* report = JSC::constructEmptyObject(globalObject, globalObject->objectPrototype(), 9);
@@ -2466,7 +2465,6 @@ static JSValue constructReportObjectComplete(VM& vm, Zig::GlobalObject* globalOb
24662465
return uvthreadResourceUsage;
24672466
};
24682467

2469-
24702468
auto constructSharedObjects = [&]() -> JSC::JSValue {
24712469
JSC::JSObject* sharedObjects = JSC::constructEmptyArray(globalObject, nullptr);
24722470
RETURN_IF_EXCEPTION(scope, {});
@@ -2476,7 +2474,6 @@ static JSValue constructReportObjectComplete(VM& vm, Zig::GlobalObject* globalOb
24762474
return sharedObjects;
24772475
};
24782476

2479-
24802477
auto constructCpus = [&]() -> JSC::JSValue {
24812478
JSC::JSObject* cpus = JSC::constructEmptyArray(globalObject, nullptr);
24822479
RETURN_IF_EXCEPTION(scope, {});
@@ -2495,7 +2492,6 @@ static JSValue constructReportObjectComplete(VM& vm, Zig::GlobalObject* globalOb
24952492
return networkInterfaces;
24962493
};
24972494

2498-
24992495
{
25002496
JSC::JSObject* report = JSC::constructEmptyObject(globalObject, globalObject->objectPrototype(), 19);
25012497
RETURN_IF_EXCEPTION(scope, {});

test/js/node/process/process.test.js

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -722,8 +722,30 @@ describe("process.report", () => {
722722

723723
// Check top-level keys (Windows doesn't have userLimits or uvthreadResourceUsage)
724724
const expectedKeys = isWindows
725-
? ["environmentVariables", "header", "javascriptHeap", "javascriptStack", "libuv", "nativeStack", "resourceUsage", "sharedObjects", "workers"]
726-
: ["environmentVariables", "header", "javascriptHeap", "javascriptStack", "libuv", "nativeStack", "resourceUsage", "sharedObjects", "userLimits", "uvthreadResourceUsage", "workers"];
725+
? [
726+
"environmentVariables",
727+
"header",
728+
"javascriptHeap",
729+
"javascriptStack",
730+
"libuv",
731+
"nativeStack",
732+
"resourceUsage",
733+
"sharedObjects",
734+
"workers",
735+
]
736+
: [
737+
"environmentVariables",
738+
"header",
739+
"javascriptHeap",
740+
"javascriptStack",
741+
"libuv",
742+
"nativeStack",
743+
"resourceUsage",
744+
"sharedObjects",
745+
"userLimits",
746+
"uvthreadResourceUsage",
747+
"workers",
748+
];
727749

728750
expect(Object.keys(report).sort()).toEqual(expectedKeys.sort());
729751
});
@@ -821,9 +843,17 @@ describe("process.report", () => {
821843
// Check heap spaces
822844
expect(heap.heapSpaces).toBeDefined();
823845
const expectedHeapSpaces = [
824-
"read_only_space", "new_space", "old_space", "code_space", "shared_space",
825-
"trusted_space", "new_large_object_space", "large_object_space",
826-
"code_large_object_space", "shared_large_object_space", "trusted_large_object_space"
846+
"read_only_space",
847+
"new_space",
848+
"old_space",
849+
"code_space",
850+
"shared_space",
851+
"trusted_space",
852+
"new_large_object_space",
853+
"large_object_space",
854+
"code_large_object_space",
855+
"shared_large_object_space",
856+
"trusted_large_object_space",
827857
];
828858
expect(Object.keys(heap.heapSpaces).sort()).toEqual(expectedHeapSpaces.sort());
829859
});

0 commit comments

Comments
 (0)