| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -87,6 +87,7 @@ | |||
| 87 | 87 | 'icu', | |
| 88 | 88 | 'js_stream', | |
| 89 | 89 | 'natives', | |
| 90 | + 'os', | ||
| 90 | 91 | 'pipe_wrap', | |
| 91 | 92 | 'process_wrap', | |
| 92 | 93 | 'signal_wrap', | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -44,7 +44,7 @@ const { | |||
| 44 | 44 | getUptime, | |
| 45 | 45 | isBigEndian, | |
| 46 | 46 | setPriority: _setPriority | |
| 47 | - } = process.binding('os'); | ||
| 47 | + } = internalBinding('os'); | ||
| 48 | 48 | ||
| 49 | 49 | function getCheckedFunction(fn) { | |
| 50 | 50 | return function checkError(...args) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -467,4 +467,4 @@ void Initialize(Local<Object> target, | |||
| 467 | 467 | } // namespace os | |
| 468 | 468 | } // namespace node | |
| 469 | 469 | ||
| 470 | - NODE_BUILTIN_MODULE_CONTEXT_AWARE(os, node::os::Initialize) | ||
| 470 | + NODE_MODULE_CONTEXT_AWARE_INTERNAL(os, node::os::Initialize) | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,7 +1,11 @@ | |||
| 1 | 1 | 'use strict'; | |
| 2 | + // Flags: --expose_internals | ||
| 3 | + | ||
| 4 | + const { internalBinding } = require('internal/test/binding'); | ||
| 5 | + | ||
| 2 | 6 | // Monkey patch the os binding before requiring any other modules, including | |
| 3 | 7 | // common, which requires the os module. | |
| 4 | - process.binding('os').getHomeDirectory = function(ctx) { | ||
| 8 | + internalBinding('os').getHomeDirectory = function(ctx) { | ||
| 5 | 9 | ctx.syscall = 'foo'; | |
| 6 | 10 | ctx.code = 'bar'; | |
| 7 | 11 | ctx.message = 'baz'; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -16,3 +16,4 @@ assert(process.binding('url')); | |||
| 16 | 16 | assert(process.binding('spawn_sync')); | |
| 17 | 17 | assert(process.binding('js_stream')); | |
| 18 | 18 | assert(process.binding('buffer')); | |
| 19 | + assert(process.binding('os')); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments