mirror of
https://github.com/nodejs/node.git
synced 2025-05-06 21:35:34 +00:00

Add a errno -> [error code, uv error message] map to the uv binding so the error message can be assembled in the JS layer. PR-URL: https://github.com/nodejs/node/pull/17338 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
19 lines
449 B
JavaScript
19 lines
449 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.startsWith('UV_')) {
|
|
const val = uv[key];
|
|
assert.throws(() => uv[key] = 1,
|
|
/^TypeError: Cannot assign to read only property/);
|
|
assert.strictEqual(uv[key], val);
|
|
}
|
|
});
|