Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit dd0381f

Browse filesBrowse files
Masashi Hiranoaddaleax
authored andcommitted
fs: make process.binding('fs') internal
Refs: #22160 PR-URL: #22478 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Denys Otrishko <shishugi@gmail.com> Backport-PR-URL: #25446
1 parent d7d772b commit dd0381f
Copy full SHA for dd0381f

File tree

Expand file treeCollapse file tree

16 files changed

+32
-19
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

16 files changed

+32
-19
lines changed
Open diff view settings
Collapse file

‎lib/fs.js‎

Copy file name to clipboardExpand all lines: lib/fs.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const {
4141

4242
const pathModule = require('path');
4343
const { isArrayBufferView } = require('internal/util/types');
44-
const binding = process.binding('fs');
44+
const binding = internalBinding('fs');
4545
const { Buffer, kMaxLength } = require('buffer');
4646
const errors = require('internal/errors');
4747
const {
Collapse file

‎lib/internal/bootstrap/loaders.js‎

Copy file name to clipboardExpand all lines: lib/internal/bootstrap/loaders.js
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181
'constants',
8282
'contextify',
8383
'crypto',
84+
'fs',
8485
'fs_event_wrap',
8586
'http_parser',
8687
'icu',
Collapse file

‎lib/internal/fs/promises.js‎

Copy file name to clipboardExpand all lines: lib/internal/fs/promises.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const {
77
S_IFMT,
88
S_IFREG
99
} = internalBinding('constants').fs;
10-
const binding = process.binding('fs');
10+
const binding = internalBinding('fs');
1111
const { Buffer, kMaxLength } = require('buffer');
1212
const {
1313
ERR_FS_FILE_TOO_LARGE,
Collapse file

‎lib/internal/fs/read_file_context.js‎

Copy file name to clipboardExpand all lines: lib/internal/fs/read_file_context.js
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
'use strict';
22

33
const { Buffer } = require('buffer');
4-
const { FSReqCallback, close, read } = process.binding('fs');
4+
5+
const { FSReqCallback, close, read } = internalBinding('fs');
56

67
const kReadFileBufferLength = 8 * 1024;
78

Collapse file

‎lib/internal/fs/streams.js‎

Copy file name to clipboardExpand all lines: lib/internal/fs/streams.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
const {
44
FSReqCallback,
55
writeBuffers
6-
} = process.binding('fs');
6+
} = internalBinding('fs');
77
const {
88
ERR_INVALID_ARG_TYPE,
99
ERR_OUT_OF_RANGE
Collapse file

‎lib/internal/fs/watchers.js‎

Copy file name to clipboardExpand all lines: lib/internal/fs/watchers.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const errors = require('internal/errors');
44
const {
55
kFsStatsFieldsNumber,
66
StatWatcher: _StatWatcher
7-
} = process.binding('fs');
7+
} = internalBinding('fs');
88
const { FSEvent } = internalBinding('fs_event_wrap');
99
const { UV_ENOSPC } = internalBinding('uv');
1010
const { EventEmitter } = require('events');
Collapse file

‎lib/internal/http2/core.js‎

Copy file name to clipboardExpand all lines: lib/internal/http2/core.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ const {
119119
} = require('internal/timers');
120120
const { isArrayBufferView } = require('internal/util/types');
121121

122-
const { FileHandle } = process.binding('fs');
122+
const { FileHandle } = internalBinding('fs');
123123
const binding = internalBinding('http2');
124124
const {
125125
ShutdownWrap,
Collapse file

‎lib/internal/modules/cjs/loader.js‎

Copy file name to clipboardExpand all lines: lib/internal/modules/cjs/loader.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const { URL } = require('url');
3333
const {
3434
internalModuleReadJSON,
3535
internalModuleStat
36-
} = process.binding('fs');
36+
} = internalBinding('fs');
3737
const { safeGetenv } = internalBinding('util');
3838
const {
3939
makeRequireFunction,
Collapse file

‎lib/internal/net.js‎

Copy file name to clipboardExpand all lines: lib/internal/net.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22

33
const Buffer = require('buffer').Buffer;
4-
const { writeBuffer } = process.binding('fs');
4+
const { writeBuffer } = internalBinding('fs');
55
const errors = require('internal/errors');
66

77
// IPv4 Segment
Collapse file

‎src/node_file.cc‎

Copy file name to clipboardExpand all lines: src/node_file.cc
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2236,4 +2236,4 @@ void Initialize(Local<Object> target,
22362236

22372237
} // end namespace node
22382238

2239-
NODE_BUILTIN_MODULE_CONTEXT_AWARE(fs, node::fs::Initialize)
2239+
NODE_MODULE_CONTEXT_AWARE_INTERNAL(fs, node::fs::Initialize)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.