Remove hideInternalModules API

This commit is contained in:
Kevin Sawicki 2016-04-28 09:54:22 -07:00
parent dafa14fe42
commit 2ce4237083
4 changed files with 0 additions and 27 deletions

View file

@ -18,10 +18,6 @@ require('../common/init')
var globalPaths = Module.globalPaths var globalPaths = Module.globalPaths
if (!process.env.ELECTRON_HIDE_INTERNAL_MODULES) {
globalPaths.push(path.join(__dirname, 'api'))
}
// Expose public APIs. // Expose public APIs.
globalPaths.push(path.join(__dirname, 'api', 'exports')) globalPaths.push(path.join(__dirname, 'api', 'exports'))

View file

@ -1,20 +1,6 @@
// Do not expose the internal modules to `require`.
const hideInternalModules = function () {
var globalPaths = require('module').globalPaths
if (globalPaths.length === 3) {
// Remove the "common/api/lib" and "browser-or-renderer/api/lib".
return globalPaths.splice(0, 2)
}
}
// Attaches properties to |exports|. // Attaches properties to |exports|.
exports.defineProperties = function (exports) { exports.defineProperties = function (exports) {
return Object.defineProperties(exports, { return Object.defineProperties(exports, {
hideInternalModules: {
enumerable: true,
value: hideInternalModules
},
// Common modules, please sort with alphabet order. // Common modules, please sort with alphabet order.
clipboard: { clipboard: {
// Must be enumerable, otherwise it woulde be invisible to remote module. // Must be enumerable, otherwise it woulde be invisible to remote module.

View file

@ -12,11 +12,6 @@ process.atomBinding = function (name) {
} }
} }
if (!process.env.ELECTRON_HIDE_INTERNAL_MODULES) {
// Add common/api/lib to module search paths.
Module.globalPaths.push(path.join(__dirname, 'api'))
}
// setImmediate and process.nextTick makes use of uv_check and uv_prepare to // setImmediate and process.nextTick makes use of uv_check and uv_prepare to
// run the callbacks, however since we only run uv loop on requests, the // run the callbacks, however since we only run uv loop on requests, the
// callbacks wouldn't be called until something else activated the uv loop, // callbacks wouldn't be called until something else activated the uv loop,

View file

@ -16,10 +16,6 @@ require('../common/init')
var globalPaths = Module.globalPaths var globalPaths = Module.globalPaths
if (!process.env.ELECTRON_HIDE_INTERNAL_MODULES) {
globalPaths.push(path.join(__dirname, 'api'))
}
// Expose public APIs. // Expose public APIs.
globalPaths.push(path.join(__dirname, 'api', 'exports')) globalPaths.push(path.join(__dirname, 'api', 'exports'))