%PDF- <> %âãÏÓ endobj 2 0 obj <> endobj 3 0 obj <>/ExtGState<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI] >>/Annots[ 28 0 R 29 0 R] /MediaBox[ 0 0 595.5 842.25] /Contents 4 0 R/Group<>/Tabs/S>> endobj ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<> endobj 2 0 obj<>endobj 2 0 obj<>es 3 0 R>> endobj 2 0 obj<> ox[ 0.000000 0.000000 609.600000 935.600000]/Fi endobj 3 0 obj<> endobj 7 1 obj<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI]>>/Subtype/Form>> stream
/* eslint-disable node-core/require-common-first, node-core/required-modules */ 'use strict'; // Ordinarily test files must require('common') but that action causes // the global console to be compiled, defeating the purpose of this test. const assert = require('assert'); const EventEmitter = require('events'); const leakWarning = /EventEmitter memory leak detected\. 2 hello listeners/; let writeTimes = 0; let warningTimes = 0; process.on('warning', () => { // This will be called after the default internal // process warning handler is called. The default // process warning writes to the console, which will // invoke the monkeypatched process.stderr.write // below. assert.strictEqual(writeTimes, 1); EventEmitter.defaultMaxListeners = oldDefault; warningTimes++; }); process.on('exit', () => { assert.strictEqual(warningTimes, 1); }); process.stderr.write = (data) => { if (writeTimes === 0) assert.match(data, leakWarning); else assert.fail('stderr.write should be called only once'); writeTimes++; }; const oldDefault = EventEmitter.defaultMaxListeners; EventEmitter.defaultMaxListeners = 1; const e = new EventEmitter(); e.on('hello', () => {}); e.on('hello', () => {}); // TODO: Figure out how to validate console. Currently, // there is no obvious way of validating that console // exists here exactly when it should.