GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — os: move process.binding('os') to internalBinding · nodejs/node@d197105

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib
    • internal/bootstrap
      • loaders.js
    • os.js
  • src
    • node_os.cc
  • test/parallel
    • test-os-checked-function.js
    • test-process-binding-internalbinding-whitelist.js
Expand file treeCollapse file tree
Open diff view settings
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
@@ -93,6 +93,7 @@ const internalBindingWhitelist = [
9393
'inspector',
9494
'js_stream',
9595
'natives',
96+
'os',
9697
'pipe_wrap',
9798
'process_wrap',
9899
'signal_wrap',
Collapse file

‎lib/os.js‎

Copy file name to clipboardExpand all lines: lib/os.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ const {
4444
getUptime,
4545
isBigEndian,
4646
setPriority: _setPriority
47-
} = process.binding('os');
47+
} = internalBinding('os');
4848

4949
function getCheckedFunction(fn) {
5050
return function checkError(...args) {
Collapse file

‎src/node_os.cc‎

Copy file name to clipboardExpand all lines: src/node_os.cc
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,4 +467,4 @@ void Initialize(Local<Object> target,
467467
} // namespace os
468468
} // namespace node
469469

470-
NODE_BUILTIN_MODULE_CONTEXT_AWARE(os, node::os::Initialize)
470+
NODE_MODULE_CONTEXT_AWARE_INTERNAL(os, node::os::Initialize)
Collapse file

‎test/parallel/test-os-checked-function.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-os-checked-function.js
+5-1Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
'use strict';
2+
// Flags: --expose_internals
3+
4+
const { internalBinding } = require('internal/test/binding');
5+
26
// Monkey patch the os binding before requiring any other modules, including
37
// common, which requires the os module.
4-
process.binding('os').getHomeDirectory = function(ctx) {
8+
internalBinding('os').getHomeDirectory = function(ctx) {
59
ctx.syscall = 'foo';
610
ctx.code = 'bar';
711
ctx.message = 'baz';
Collapse file

‎test/parallel/test-process-binding-internalbinding-whitelist.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-process-binding-internalbinding-whitelist.js
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ assert(process.binding('js_stream'));
1818
assert(process.binding('buffer'));
1919
assert(process.binding('fs'));
2020
assert(process.binding('inspector'));
21+
assert(process.binding('os'));

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.