mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
58831b2f24
* ensure that UV_... props are constants * improve error message ... the error message when passing in `err >= 0` to `util._errnoException()` was less than useful. * refine uses of process.binding('uv') PR-URL: https://github.com/nodejs/node/pull/14933 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
19 lines
456 B
JavaScript
19 lines
456 B
JavaScript
'use strict';
|
|
|
|
require('../common');
|
|
const assert = require('assert');
|
|
const uv = process.binding('uv');
|
|
|
|
// Ensures that the `UV_...` values in process.binding('uv')
|
|
// are constants.
|
|
|
|
const keys = Object.keys(uv);
|
|
keys.forEach((key) => {
|
|
if (key === 'errname')
|
|
return; // skip this
|
|
const val = uv[key];
|
|
assert.throws(() => uv[key] = 1,
|
|
/^TypeError: Cannot assign to read only property/);
|
|
assert.strictEqual(uv[key], val);
|
|
});
|