mirror of
https://github.com/nodejs/node.git
synced 2024-11-30 07:27:22 +01:00
cc195bf37b
Enable `no-proto` in `.eslintrc`. Use `Object.setPrototypeOf()` and `Object.getPrototypeOf()` instead of. PR-URL: https://github.com/nodejs/node/pull/5140 Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: James M Snell <jasnell@gmail.com>
35 lines
654 B
JavaScript
35 lines
654 B
JavaScript
'use strict';
|
|
var common = require('../common');
|
|
var assert = require('assert');
|
|
|
|
var spawn = require('child_process').spawn;
|
|
|
|
var env = {
|
|
'HELLO': 'WORLD'
|
|
};
|
|
Object.setPrototypeOf(env, {
|
|
'FOO': 'BAR'
|
|
});
|
|
|
|
var child;
|
|
if (common.isWindows) {
|
|
child = spawn('cmd.exe', ['/c', 'set'], {env: env});
|
|
} else {
|
|
child = spawn('/usr/bin/env', [], {env: env});
|
|
}
|
|
|
|
|
|
var response = '';
|
|
|
|
child.stdout.setEncoding('utf8');
|
|
|
|
child.stdout.on('data', function(chunk) {
|
|
console.log('stdout: ' + chunk);
|
|
response += chunk;
|
|
});
|
|
|
|
process.on('exit', function() {
|
|
assert.ok(response.indexOf('HELLO=WORLD') >= 0);
|
|
assert.ok(response.indexOf('FOO=BAR') >= 0);
|
|
});
|