node/test/parallel/test-process-prototype.js
Bryan English e0bc5a7361
process: maintain constructor descriptor
Use the original property descriptor instead of just taking the value,
which would, by default, be non-writable and non-configurable.

PR-URL: https://github.com/nodejs/node/pull/9306
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2017-03-25 00:33:20 +01:00

16 lines
450 B
JavaScript

'use strict';
require('../common');
const assert = require('assert');
const EventEmitter = require('events');
const proto = Object.getPrototypeOf(process);
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);