From cc8fcc5a0704bf3fca7dcd5cb81e9775fc0e4a0f Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Fri, 1 Apr 2016 22:39:35 -0700 Subject: [PATCH] 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 Reviewed-By: James M Snell Reviewed-By: Colin Ihrig --- test/parallel/test-domain-crypto.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/parallel/test-domain-crypto.js b/test/parallel/test-domain-crypto.js index e76e8d08791c87..4dd979dafeab73 100644 --- a/test/parallel/test-domain-crypto.js +++ b/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);