-
Notifications
You must be signed in to change notification settings - Fork 29.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
process: global.process, global.Buffer getters
PR-URL: #26882 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Сковорода Никита Андреевич <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
- Loading branch information
1 parent
2d5387e
commit 53ebd33
Showing
2 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* eslint-disable strict */ | ||
require('../common'); | ||
const assert = require('assert'); | ||
const _process = require('process'); | ||
const { Buffer: _Buffer } = require('buffer'); | ||
|
||
assert.strictEqual(process, _process); | ||
// eslint-disable-next-line no-global-assign | ||
process = 'asdf'; | ||
assert.strictEqual(process, 'asdf'); | ||
assert.strictEqual(global.process, 'asdf'); | ||
global.process = _process; | ||
assert.strictEqual(process, _process); | ||
assert.strictEqual( | ||
typeof Object.getOwnPropertyDescriptor(global, 'process').get, | ||
'function'); | ||
|
||
assert.strictEqual(Buffer, _Buffer); | ||
// eslint-disable-next-line no-global-assign | ||
Buffer = 'asdf'; | ||
assert.strictEqual(Buffer, 'asdf'); | ||
assert.strictEqual(global.Buffer, 'asdf'); | ||
global.Buffer = _Buffer; | ||
assert.strictEqual(Buffer, _Buffer); | ||
assert.strictEqual( | ||
typeof Object.getOwnPropertyDescriptor(global, 'Buffer').get, | ||
'function'); |