Skip to content

Commit a7b3a75

Browse files
TrottMyles Borins
authored and
Myles Borins
committed
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 <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent 56755de commit a7b3a75

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

test/parallel/test-domain-crypto.js

+3-2
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)