summaryrefslogtreecommitdiff
path: root/test/parallel/test-env-newprotomethod-remove-unnecessary-prototypes.js
blob: a2e2dabab0ffb2ed8828933cadcea95e3a87a38e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Flags: --expose-internals
'use strict';
require('../common');

// This test ensures that unnecessary prototypes are no longer
// being generated by Environment::NewFunctionTemplate.

const assert = require('assert');
const { internalBinding } = require('internal/test/binding');
[
  internalBinding('udp_wrap').UDP.prototype.bind6,
  internalBinding('tcp_wrap').TCP.prototype.bind6,
  internalBinding('udp_wrap').UDP.prototype.send6,
  internalBinding('tcp_wrap').TCP.prototype.bind,
  internalBinding('udp_wrap').UDP.prototype.close,
  internalBinding('tcp_wrap').TCP.prototype.open
].forEach((binding, i) => {
  assert.strictEqual('prototype' in binding, false, `Test ${i} failed`);
});