Merge pull request #8539 from electron/require-wrapper

Update require wrapper to allow redefinition of process and global
This commit is contained in:
Kevin Sawicki 2017-01-30 10:36:15 -08:00 committed by GitHub
commit 37eebb1dd0
4 changed files with 19 additions and 1 deletions

View file

@ -0,0 +1,2 @@
const global = 'declared global'
module.exports = global

View file

@ -0,0 +1,2 @@
const process = 'declared process'
module.exports = process

View file

@ -47,6 +47,20 @@ describe('third-party module', function () {
})
})
})
describe('global variables', function () {
describe('process', function () {
it('can be declared in a module', function () {
assert.strictEqual(require('./fixtures/module/declare-process'), 'declared process')
})
})
describe('global', function () {
it('can be declared in a module', function () {
assert.strictEqual(require('./fixtures/module/declare-global'), 'declared global')
})
})
})
})
describe('Module._nodeModulePaths', function () {

2
vendor/node vendored

@ -1 +1 @@
Subproject commit 494083b740949caa93aca64ce75fe75c31e2034e
Subproject commit 0bf9958c91e7aed26d5d474b4ca59d3dce3e5e05