Confused setTimout behaviour in NodeJS
オープン
まだ誰も着手していません。
timers
- 主要言語
- JavaScript
- スター
- 122k
- フォーク
- 37.3k
- 平均マージ
- 4日 2時間
- マージ済み PR(30日)
- 283
説明
Version
14, 18
Platform
22.2.0 Darwin Kernel arm64
Subsystem
No response
What steps will reproduce the bug?
setTimeout(() => {
console.log('calling 1st timeout')
}, 1)
setTimeout(() => {
console.log('calling 2rd timeout')
}, 0)
// in nodejs
// calling 1st timeout
// calling 2rd timeout
// however, in chrome browser
// calling 2rd timeout
// calling 1st timeout
How often does it reproduce? Is there a required condition?
No response
What is the expected behavior?
Would expect the second time to be called first
What do you see instead?
The first time out is called then the second timeout in NodeJS
Additional information
No response
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、提供されている setTimeout の再現コードを Node.js 14 と 18 で実行し、その後ブラウザーの結果と比較します。Node.js の setTimeout とイベントループのドキュメントを読み、順序が規定されているかどうかを判断します。期待される順序と、Node.js の動作にドキュメントまたは実装の変更が必要かどうかを明らかにできれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- javascript, node.js
- 領域
- backend
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 静か
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 45/100