0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/test/parallel/test-signal-safety.js
James M Snell 0bdb95f4cf
src: move process.binding('signal_wrap') to internalBinding
PR-URL: https://github.com/nodejs/node/pull/22290
Refs: https://github.com/nodejs/node/issues/22160
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: John-David Dalton <john.david.dalton@gmail.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-08-19 14:18:29 -07:00

15 lines
432 B
JavaScript

// Flags: --expose-internals
'use strict';
require('../common');
const assert = require('assert');
const { internalBinding } = require('internal/test/binding');
const { Signal } = internalBinding('signal_wrap');
// Test Signal `this` safety
// https://github.com/joyent/node/issues/6690
assert.throws(function() {
const s = new Signal();
const nots = { start: s.start };
nots.start(9);
}, /^TypeError: Illegal invocation$/);