Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a7b3a75

Browse filesBrowse files
TrottMyles Borins
authored andcommitted
test: be explicit about polluting of global
There was a comment in `test-domain-crypto.js` indicating that the pollution of the `global` object with a `domain` property was intentional. Provide more information in the comment so someone may easily determine why. Use `global.domain` rather than declaring `domain` without the `var` keyword to more clearly signal that the pollution is intentional. PR-URL: #6017 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent 56755de commit a7b3a75
Copy full SHA for a7b3a75

File tree

Expand file treeCollapse file tree

1 file changed

+3
-2
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-2
lines changed
Open diff view settings
Collapse file

‎test/parallel/test-domain-crypto.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-domain-crypto.js
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ try {
66
return;
77
}
88

9-
// the missing var keyword is intentional
10-
domain = require('domain');
9+
// Pollution of global is intentional as part of test.
10+
// See https://github.com/nodejs/node/commit/d1eff9ab
11+
global.domain = require('domain');
1112

1213
// should not throw a 'TypeError: undefined is not a function' exception
1314
crypto.randomBytes(8);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.