| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 87bddda commit 11f7dcf
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -598,6 +598,9 @@ Timeout.prototype.unref = function() { | |||
| 598 | 598 | } | |
| 599 | 599 | ||
| 600 | 600 | var handle = reuse(this); | |
| 601 | + if (handle) { | ||
| 602 | + handle._list = undefined; | ||
| 603 | + } | ||
| 601 | 604 | ||
| 602 | 605 | this._handle = handle || new TimerWrap(); | |
| 603 | 606 | this._handle.owner = this; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,14 @@ | |||
| 1 | + 'use strict'; | ||
| 2 | + | ||
| 3 | + require('../common'); | ||
| 4 | + const assert = require('assert'); | ||
| 5 | + | ||
| 6 | + const timer1 = setTimeout(() => {}, 1).unref(); | ||
| 7 | + assert.strictEqual(timer1._handle._list, undefined, | ||
| 8 | + 'timer1._handle._list should be undefined'); | ||
| 9 | + | ||
| 10 | + // Check that everything works even if the handle was not re-used. | ||
| 11 | + setTimeout(() => {}, 1); | ||
| 12 | + const timer2 = setTimeout(() => {}, 1).unref(); | ||
| 13 | + assert.strictEqual(timer2._handle._list, undefined, | ||
| 14 | + 'timer2._handle._list should be undefined'); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments