mirror of
https://github.com/nodejs/node.git
synced 2025-05-09 09:08:46 +00:00

PR-URL: https://github.com/nodejs/node/pull/22163 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Jon Moss <me@jonathanmoss.me>
21 lines
540 B
JavaScript
21 lines
540 B
JavaScript
// Flags: --expose-internals
|
|
'use strict';
|
|
|
|
require('../common');
|
|
const assert = require('assert');
|
|
const { internalBinding } = require('internal/test/binding');
|
|
const uv = internalBinding('uv');
|
|
|
|
// Ensures that the `UV_...` values in internalBinding('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);
|
|
}
|
|
});
|