GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — strange befavior about console.err,console.log on win10 · Issue #18232 · nodejs/node Closed Description
Stackoverflow: a strange behavior about the EventEmitter in node I am learning EventEmitter. and I have a simple stupid test. (node --version v8.4.0 on win10) const EventEmitter = require('events'); const emiter1 = new EventEmitter() const emiter2 = new EventEmitter() // let cnt = 1 emiter1.on('ping', () => { // console.log('ping' + cnt++) emiter2.emit('pong') }) emiter2.on('pong', () => { // console.log('pong' + cnt++) emiter1.emit('ping') }) emiter1.emit('ping') I expect it will become a infinity function call, because emit() is a sync function. Great! Just as I expected. But after I uncomment the cnt and console.log, I got a strange behavior. The program finished without an error, and stop at cnt==1600 (sometime is 1598, 1599) Finally, I run Activity
|
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |