Merge pull request #4247 from deepak1556/common_exports_patch

common: export hideInternalModules
This commit is contained in:
Cheng Zhao 2016-01-27 23:20:59 +08:00
commit e9d00b1fc0
3 changed files with 20 additions and 4 deletions

View file

@ -1,5 +1,5 @@
// Do not expose the internal modules to `require`.
exports.hideInternalModules = function() {
const hideInternalModules = function() {
var globalPaths = require('module').globalPaths;
if (globalPaths.length === 3) {
@ -11,6 +11,10 @@ exports.hideInternalModules = function() {
// Attaches properties to |exports|.
exports.defineProperties = function(exports) {
return Object.defineProperties(exports, {
hideInternalModules: {
enumerable: true,
value: hideInternalModules
},
// Common modules, please sort with alphabet order.
clipboard: {