-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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 <jasnell@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
- 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'); |