From 6e942e73536232a71a47b81565ecf27be24958f4 Mon Sep 17 00:00:00 2001 From: cjihrig Date: Thu, 23 Aug 2018 11:18:08 -0400 Subject: [PATCH] fs: make fs_event_wrap binding internal MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/22480 Refs: https://github.com/nodejs/node/issues/22160 Reviewed-By: Anna Henningsen Reviewed-By: Luigi Pinca Reviewed-By: Michaƫl Zasso Reviewed-By: James M Snell --- lib/internal/bootstrap/node.js | 1 + lib/internal/fs/watchers.js | 3 ++- src/fs_event_wrap.cc | 2 +- test/sequential/test-async-wrap-getasyncid.js | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/internal/bootstrap/node.js b/lib/internal/bootstrap/node.js index 3e3eaa5b60e17a..96b620d057c5ca 100644 --- a/lib/internal/bootstrap/node.js +++ b/lib/internal/bootstrap/node.js @@ -348,6 +348,7 @@ // internalBinding. const internalBindingWhitelist = new SafeSet([ + 'fs_event_wrap', 'uv', 'http_parser', 'process_wrap', diff --git a/lib/internal/fs/watchers.js b/lib/internal/fs/watchers.js index 90ea3971aae6f5..8f8cb5249b1ba6 100644 --- a/lib/internal/fs/watchers.js +++ b/lib/internal/fs/watchers.js @@ -1,11 +1,12 @@ 'use strict'; const errors = require('internal/errors'); +const { internalBinding } = require('internal/bootstrap/loaders'); const { kFsStatsFieldsLength, StatWatcher: _StatWatcher } = process.binding('fs'); -const { FSEvent } = process.binding('fs_event_wrap'); +const { FSEvent } = internalBinding('fs_event_wrap'); const { EventEmitter } = require('events'); const { getStatsFromBinding, diff --git a/src/fs_event_wrap.cc b/src/fs_event_wrap.cc index e0cdab4d3e20f1..11a1036d605cc3 100644 --- a/src/fs_event_wrap.cc +++ b/src/fs_event_wrap.cc @@ -235,4 +235,4 @@ void FSEventWrap::OnEvent(uv_fs_event_t* handle, const char* filename, } // anonymous namespace } // namespace node -NODE_BUILTIN_MODULE_CONTEXT_AWARE(fs_event_wrap, node::FSEventWrap::Initialize) +NODE_MODULE_CONTEXT_AWARE_INTERNAL(fs_event_wrap, node::FSEventWrap::Initialize) diff --git a/test/sequential/test-async-wrap-getasyncid.js b/test/sequential/test-async-wrap-getasyncid.js index 65fe2015a0acd2..eb4b5aef25507a 100644 --- a/test/sequential/test-async-wrap-getasyncid.js +++ b/test/sequential/test-async-wrap-getasyncid.js @@ -88,7 +88,7 @@ function testInitialized(req, ctor_name) { { - const FSEvent = process.binding('fs_event_wrap').FSEvent; + const FSEvent = internalBinding('fs_event_wrap').FSEvent; testInitialized(new FSEvent(), 'FSEvent'); }