[Pkg-javascript-commits] [node-tap] 36/186: set hrtime/start on timeout if not already set

Bastien Roucariès rouca at moszumanska.debian.org
Fri Dec 1 16:40:41 UTC 2017


This is an automated email from the git hooks/post-receive script.

rouca pushed a commit to branch master
in repository node-tap.

commit 2de5e9c7ef6e4c16e9d68d9b9dd5200ee9e7d31a
Author: isaacs <i at izs.me>
Date:   Fri Sep 8 08:43:08 2017 -0700

    set hrtime/start on timeout if not already set
---
 lib/base.js | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/lib/base.js b/lib/base.js
index 9d700ee..e0ca317 100644
--- a/lib/base.js
+++ b/lib/base.js
@@ -67,16 +67,16 @@ class Base extends MiniPass {
   }
 
   setTimeout (n) {
+    if (!this.hrtime)
+      this.hrtime = process.hrtime()
+
+    if (!this.start)
+      this.start = Date.now()
+
     if (!n) {
       clearTimeout(this.timer)
       this.timer = null
     } else {
-      if (!this.hrtime)
-        this.hrtime = process.hrtime()
-
-      if (!this.start)
-        this.start = Date.now()
-
       if (this.timer)
         clearTimeout(this.timer)
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-tap.git



More information about the Pkg-javascript-commits mailing list