| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 66c7454 commit 5a77c09
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -819,7 +819,8 @@ | |||
| 819 | 819 | var signalWraps = {}; | |
| 820 | 820 | ||
| 821 | 821 | function isSignal(event) { | |
| 822 | - return event.slice(0, 3) === 'SIG' && | ||
| 822 | + return typeof event === 'string' && | ||
| 823 | + event.slice(0, 3) === 'SIG' && | ||
| 823 | 824 | startup.lazyConstants().hasOwnProperty(event); | |
| 824 | 825 | } | |
| 825 | 826 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,20 @@ | |||
| 1 | + 'use strict'; | ||
| 2 | + const common = require('../common'); | ||
| 3 | + const assert = require('assert'); | ||
| 4 | + const sym = Symbol(); | ||
| 5 | + | ||
| 6 | + process.on('normal', common.mustCall(data => { | ||
| 7 | + assert.strictEqual(data, 'normalData'); | ||
| 8 | + })); | ||
| 9 | + | ||
| 10 | + process.on(sym, common.mustCall(data => { | ||
| 11 | + assert.strictEqual(data, 'symbolData'); | ||
| 12 | + })); | ||
| 13 | + | ||
| 14 | + process.on('SIGPIPE', common.mustCall(data => { | ||
| 15 | + assert.strictEqual(data, 'signalData'); | ||
| 16 | + })); | ||
| 17 | + | ||
| 18 | + process.emit('normal', 'normalData'); | ||
| 19 | + process.emit(sym, 'symbolData'); | ||
| 20 | + process.emit('SIGPIPE', 'signalData'); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments