mirror of
https://github.com/nodejs/node.git
synced 2025-05-03 09:52:21 +00:00

The global `process` object had its prototype replaced with a fresh object that had `EventEmitter.prototype` as its prototype. With this change, the original `process.constructor.prototype` is modified to have `EventEmitter.prototype` as its prototype, reflecting that `process` objects are also `EventEmitter`s. Fixes: https://github.com/nodejs/node/issues/14699 PR-URL: https://github.com/nodejs/node/pull/14715 Reviewed-By: Anna Henningsen <anna@addaleax.net>
17 lines
498 B
JavaScript
17 lines
498 B
JavaScript
'use strict';
|
|
require('../common');
|
|
const assert = require('assert');
|
|
const EventEmitter = require('events');
|
|
|
|
const proto = Object.getPrototypeOf(process);
|
|
|
|
assert(process instanceof process.constructor);
|
|
assert(proto instanceof EventEmitter);
|
|
|
|
const desc = Object.getOwnPropertyDescriptor(proto, 'constructor');
|
|
|
|
assert.strictEqual(desc.value, process.constructor);
|
|
assert.strictEqual(desc.writable, true);
|
|
assert.strictEqual(desc.enumerable, false);
|
|
assert.strictEqual(desc.configurable, true);
|