2017-08-18 15:37:35 -07:00
|
|
|
'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) => {
|
2017-12-25 21:36:15 +08:00
|
|
|
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);
|
|
|
|
}
|
2017-08-18 15:37:35 -07:00
|
|
|
});
|