| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 31c50e5 commit b085b94
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -310,9 +310,9 @@ const consoleMethods = { | |||
| 310 | 310 | timeEnd(label = 'default') { | |
| 311 | 311 | // Coerces everything other than Symbol to a string | |
| 312 | 312 | label = `${label}`; | |
| 313 | - const hasWarned = timeLogImpl(this, 'timeEnd', label); | ||
| 313 | + const found = timeLogImpl(this, 'timeEnd', label); | ||
| 314 | 314 | trace(kTraceEnd, kTraceConsoleCategory, `time::${label}`, 0); | |
| 315 | - if (!hasWarned) { | ||
| 315 | + if (found) { | ||
| 316 | 316 | this._times.delete(label); | |
| 317 | 317 | } | |
| 318 | 318 | }, | |
@@ -509,12 +509,12 @@ const consoleMethods = { | |||
| 509 | 509 | }, | |
| 510 | 510 | }; | |
| 511 | 511 | ||
| 512 | - // Returns true if label was not found | ||
| 512 | + // Returns true if label was found | ||
| 513 | 513 | function timeLogImpl(self, name, label, data) { | |
| 514 | 514 | const time = self._times.get(label); | |
| 515 | - if (!time) { | ||
| 515 | + if (time === undefined) { | ||
| 516 | 516 | process.emitWarning(`No such label '${label}' for console.${name}()`); | |
| 517 | - return true; | ||
| 517 | + return false; | ||
| 518 | 518 | } | |
| 519 | 519 | const duration = process.hrtime(time); | |
| 520 | 520 | const ms = duration[0] * 1000 + duration[1] / 1e6; | |
@@ -523,7 +523,7 @@ function timeLogImpl(self, name, label, data) { | |||
| 523 | 523 | } else { | |
| 524 | 524 | self.log('%s: %sms', label, ms.toFixed(3), ...data); | |
| 525 | 525 | } | |
| 526 | - return false; | ||
| 526 | + return true; | ||
| 527 | 527 | } | |
| 528 | 528 | ||
| 529 | 529 | const keyKey = 'Key'; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments