test/common.js contains code that detects global variable leaks. This eslint rule checks that a module named `common` is loaded. It is only applicable to files in the test directory. Tests that intentionally leak variables can opt out with an eslint-disable comment. PR-URL: https://github.com/nodejs/node/pull/3157 Reviewed-By: Rod Vagg <rod@vagg.org> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
18 lines
512 B
JavaScript
18 lines
512 B
JavaScript
/* eslint-disable strict, required-modules */
|
|
try {
|
|
var crypto = require('crypto');
|
|
} catch (e) {
|
|
console.log('1..0 # Skipped: node compiled without OpenSSL.');
|
|
return;
|
|
}
|
|
|
|
// the missing var keyword is intentional
|
|
domain = require('domain');
|
|
|
|
// should not throw a 'TypeError: undefined is not a function' exception
|
|
crypto.randomBytes(8);
|
|
crypto.randomBytes(8, function() {});
|
|
crypto.pseudoRandomBytes(8);
|
|
crypto.pseudoRandomBytes(8, function() {});
|
|
crypto.pbkdf2('password', 'salt', 8, 8, function() {});
|