Skip to content
Permalink
Browse files

Revert "os: move process.binding('os') to internalBinding"

This reverts commit 55d185f.

PR-URL: #25446
Reviewed-By: Anna Henningsen <anna@addaleax.net>
  • Loading branch information...
joyeecheung authored and addaleax committed Jan 11, 2019
1 parent 8cc9757 commit f64e5ec1482873d286a5f474f995763e041ee614
@@ -87,7 +87,6 @@
'icu',
'js_stream',
'natives',
'os',
'pipe_wrap',
'process_wrap',
'signal_wrap',
@@ -44,7 +44,7 @@ const {
getUptime,
isBigEndian,
setPriority: _setPriority
} = internalBinding('os');
} = process.binding('os');

function getCheckedFunction(fn) {
return function checkError(...args) {
@@ -467,4 +467,4 @@ void Initialize(Local<Object> target,
} // namespace os
} // namespace node

NODE_MODULE_CONTEXT_AWARE_INTERNAL(os, node::os::Initialize)
NODE_BUILTIN_MODULE_CONTEXT_AWARE(os, node::os::Initialize)
@@ -1,11 +1,7 @@
'use strict';
// Flags: --expose_internals

const { internalBinding } = require('internal/test/binding');

// Monkey patch the os binding before requiring any other modules, including
// common, which requires the os module.
internalBinding('os').getHomeDirectory = function(ctx) {
process.binding('os').getHomeDirectory = function(ctx) {
ctx.syscall = 'foo';
ctx.code = 'bar';
ctx.message = 'baz';
@@ -16,4 +16,3 @@ assert(process.binding('url'));
assert(process.binding('spawn_sync'));
assert(process.binding('js_stream'));
assert(process.binding('buffer'));
assert(process.binding('os'));

0 comments on commit f64e5ec

Please sign in to comment.
You can’t perform that action at this time.