summaryrefslogtreecommitdiff
path: root/test/parallel/test-uv-binding-constant.js
blob: beae7672db12f580ab0c1d6e86c8ea53bb7c877c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
'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);
  }
});