| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 445ba9f commit d197105
5 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -93,6 +93,7 @@ const internalBindingWhitelist = [ | |||
| 93 | 93 | 'inspector', | |
| 94 | 94 | 'js_stream', | |
| 95 | 95 | 'natives', | |
| 96 | + 'os', | ||
| 96 | 97 | 'pipe_wrap', | |
| 97 | 98 | 'process_wrap', | |
| 98 | 99 | '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 | |
|---|---|---|---|
@@ -18,3 +18,4 @@ assert(process.binding('js_stream')); | |||
| 18 | 18 | assert(process.binding('buffer')); | |
| 19 | 19 | assert(process.binding('fs')); | |
| 20 | 20 | assert(process.binding('inspector')); | |
| 21 | + assert(process.binding('os')); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments