Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
617bfe4
lib: remove internalBinding('config').pendingDeprecation
joyeecheung Dec 11, 2018
c168672
inspector: move process.binding to internalBinding
BeniCheni Dec 10, 2018
dc4e5c5
util: inspect ArrayBuffers contents as well
BridgeAR Dec 13, 2018
0c67a51
lib: remove internal `util._extends()` usage
BridgeAR Dec 18, 2018
e97acf7
lib: expose all type checks from the internal types module
BridgeAR Dec 20, 2018
95fa3c7
buffer: inspect extra properties
BridgeAR Dec 20, 2018
7ff4402
lib: move lib/console.js to lib/internal/console/constructor.js
joyeecheung Nov 28, 2018
2f1f009
console: split console into global.js and constructor.js
joyeecheung Nov 28, 2018
6280cda
console: move the inspector console wrapping in a separate file
joyeecheung Nov 28, 2018
6bf7511
console: add `inspectOptions` option
BridgeAR Dec 12, 2018
049b24d
console: improve inspectOptions validation
cjihrig Dec 17, 2018
8d166c9
process: provide dummy stdio for non-console Windows apps
addaleax May 9, 2018
c219b8f
Revert "lib: expose all type checks from the internal types module"
joyeecheung Jan 11, 2019
f4dbe57
Revert "inspector: move process.binding to internalBinding"
joyeecheung Jan 11, 2019
7aeec97
Revert "lib: remove internalBinding('config').pendingDeprecation"
joyeecheung Jan 11, 2019
48dfda7
Revert "os: move process.binding('os') to internalBinding"
joyeecheung Jan 11, 2019
abfde34
Revert "lib: remove unused NativeModule/NativeModule wraps"
joyeecheung Jan 11, 2019
c5b2c31
Revert "src,lib: make process.binding('config') internal"
joyeecheung Jan 11, 2019
fb6f2f2
Revert "lib: remove duplicated noop function"
joyeecheung Jan 11, 2019
106b299
fs: make process.binding('fs') internal
Aug 23, 2018
9a5984d
src: use NativeModuleLoader to compile all the bootstrappers
joyeecheung Nov 26, 2018
373bbe7
lib: remove duplicated noop function
ZYSzys Dec 1, 2018
b6afa46
src,lib: make process.binding('config') internal
Oct 8, 2018
5bc4592
lib: remove unused NativeModule/NativeModule wraps
joyeecheung Dec 8, 2018
e05e5b3
inspector: move process.binding to internalBinding
BeniCheni Dec 10, 2018
181d03a
os: move process.binding('os') to internalBinding
briete Dec 17, 2018
4cb9036
lib: remove internalBinding('config').pendingDeprecation
joyeecheung Dec 11, 2018
7d90f03
lib: expose all type checks from the internal types module
BridgeAR Dec 20, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
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>
  • Loading branch information
Masashi Hirano authored and joyeecheung committed Jan 11, 2019
commit 106b2993a01a1c7d7ea1963967de225b16483e6d
2 changes: 1 addition & 1 deletion lib/fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const {

const pathModule = require('path');
const { isArrayBufferView } = require('internal/util/types');
const binding = process.binding('fs');
const binding = internalBinding('fs');
const { Buffer, kMaxLength } = require('buffer');
const errors = require('internal/errors');
const {
Expand Down
1 change: 1 addition & 0 deletions lib/internal/bootstrap/loaders.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
'constants',
'contextify',
'crypto',
'fs',
'fs_event_wrap',
'http_parser',
'icu',
Expand Down
2 changes: 1 addition & 1 deletion lib/internal/fs/promises.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const {
S_IFMT,
S_IFREG
} = internalBinding('constants').fs;
const binding = process.binding('fs');
const binding = internalBinding('fs');
const { Buffer, kMaxLength } = require('buffer');
const {
ERR_FS_FILE_TOO_LARGE,
Expand Down
3 changes: 2 additions & 1 deletion lib/internal/fs/read_file_context.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
'use strict';

const { Buffer } = require('buffer');
const { FSReqCallback, close, read } = process.binding('fs');

const { FSReqCallback, close, read } = internalBinding('fs');

const kReadFileBufferLength = 8 * 1024;

Expand Down
2 changes: 1 addition & 1 deletion lib/internal/fs/streams.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
const {
FSReqCallback,
writeBuffers
} = process.binding('fs');
} = internalBinding('fs');
const {
ERR_INVALID_ARG_TYPE,
ERR_OUT_OF_RANGE
Expand Down
2 changes: 1 addition & 1 deletion lib/internal/fs/watchers.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const errors = require('internal/errors');
const {
kFsStatsFieldsNumber,
StatWatcher: _StatWatcher
} = process.binding('fs');
} = internalBinding('fs');
const { FSEvent } = internalBinding('fs_event_wrap');
const { UV_ENOSPC } = internalBinding('uv');
const { EventEmitter } = require('events');
Expand Down
2 changes: 1 addition & 1 deletion lib/internal/http2/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ const {
} = require('internal/timers');
const { isArrayBufferView } = require('internal/util/types');

const { FileHandle } = process.binding('fs');
const { FileHandle } = internalBinding('fs');
const binding = internalBinding('http2');
const {
ShutdownWrap,
Expand Down
2 changes: 1 addition & 1 deletion lib/internal/modules/cjs/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const { URL } = require('url');
const {
internalModuleReadJSON,
internalModuleStat
} = process.binding('fs');
} = internalBinding('fs');
const { safeGetenv } = internalBinding('util');
const {
makeRequireFunction,
Expand Down
2 changes: 1 addition & 1 deletion lib/internal/net.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

const Buffer = require('buffer').Buffer;
const { writeBuffer } = process.binding('fs');
const { writeBuffer } = internalBinding('fs');
const errors = require('internal/errors');

// IPv4 Segment
Expand Down
2 changes: 1 addition & 1 deletion src/node_file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2236,4 +2236,4 @@ void Initialize(Local<Object> target,

} // end namespace node

NODE_BUILTIN_MODULE_CONTEXT_AWARE(fs, node::fs::Initialize)
NODE_MODULE_CONTEXT_AWARE_INTERNAL(fs, node::fs::Initialize)
4 changes: 3 additions & 1 deletion test/parallel/test-assert.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Flags: --expose-internals
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
Expand All @@ -24,6 +25,7 @@
const common = require('../common');
const assert = require('assert');
const { inspect } = require('util');
const { internalBinding } = require('internal/test/binding');
const a = assert;

// Disable colored output to prevent color codes from breaking assertion
Expand Down Expand Up @@ -656,7 +658,7 @@ common.expectsError(

{
// Test caching.
const fs = process.binding('fs');
const fs = internalBinding('fs');
const tmp = fs.close;
fs.close = common.mustCall(tmp, 1);
function throwErr() {
Expand Down
18 changes: 12 additions & 6 deletions test/parallel/test-fs-filehandle.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
const common = require('../common');
const assert = require('assert');
const path = require('path');
const fs = process.binding('fs');
const { internalBinding } = require('internal/test/binding');
const fs = internalBinding('fs');
const { stringToFlags } = require('internal/fs/utils');

// Verifies that the FileHandle object is garbage collected and that a
Expand All @@ -18,11 +19,16 @@ let fdnum;
assert.strictEqual(ctx.errno, undefined);
}

common.expectWarning(
'Warning',
`Closing file descriptor ${fdnum} on garbage collection`,
common.noWarnCode
);
common.expectWarning({
'internal/test/binding': [
'These APIs are for internal testing only. Do not use them.',
common.noWarnCode
],
'Warning': [
`Closing file descriptor ${fdnum} on garbage collection`,
common.noWarnCode
]
});

global.gc();

Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-fs-sync-fd-leak.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ fs.writeSync = function() {
throw new Error('BAM');
};

process.binding('fs').fstat = function(fd, bigint, _, ctx) {
internalBinding('fs').fstat = function(fd, bigint, _, ctx) {
ctx.errno = UV_EBADF;
ctx.syscall = 'fstat';
};
Expand Down
4 changes: 3 additions & 1 deletion test/parallel/test-module-binding.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
// Flags: --expose-internals
'use strict';
require('../common');
const fixtures = require('../common/fixtures');
const { internalModuleReadJSON } = process.binding('fs');
const { internalBinding } = require('internal/test/binding');
const { internalModuleReadJSON } = internalBinding('fs');
const { readFileSync } = require('fs');
const { strictEqual } = require('assert');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ assert(process.binding('url'));
assert(process.binding('spawn_sync'));
assert(process.binding('js_stream'));
assert(process.binding('buffer'));
assert(process.binding('fs'));
2 changes: 1 addition & 1 deletion test/sequential/test-async-wrap-getasyncid.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ if (common.hasCrypto) { // eslint-disable-line node-core/crypto-check


{
const binding = process.binding('fs');
const binding = internalBinding('fs');
const path = require('path');

const FSReqCallback = binding.FSReqCallback;
Expand Down