Browse Source

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: https://github.com/nodejs/node/pull/6017
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
process-exit-stdio-flushing
Rich Trott 9 years ago
committed by James M Snell
parent
commit
ae2be27add
  1. 5
      test/parallel/test-domain-crypto.js

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

@ -6,8 +6,9 @@ try {
return;
}
// the missing var keyword is intentional
domain = require('domain');
// Pollution of global is intentional as part of test.
// See https://github.com/nodejs/node/commit/d1eff9ab
global.domain = require('domain');
// should not throw a 'TypeError: undefined is not a function' exception
crypto.randomBytes(8);

Loading…
Cancel
Save