You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
perf_hooks: measure() should allow endMark to be omitted #32647
How often does it reproduce? Is there a required condition?
Always. No condition.
What is the expected behavior?
Undefined is returned.
What do you see instead?
Uncaught:
Error [ERR_INVALID_PERFORMANCE_MARK]: The "undefined" performance mark has not been set
at Performance.measure (perf_hooks.js:402:13)
at repl:1:35
at Script.runInThisContext (vm.js:131:20)
at REPLServer.defaultEval (repl.js:432:29)
at bound (domain.js:429:14)
at REPLServer.runBound [as eval] (domain.js:442:12)
at REPLServer.onLine (repl.js:759:10)
at REPLServer.emit (events.js:327:22)
at REPLServer.EventEmitter.emit (domain.js:485:12)
at REPLServer.Interface._onLine (readline.js:337:10) {
code: 'ERR_INVALID_PERFORMANCE_MARK'
}
Additional information
Throwing an exception when an endMark parameter is is not passed to measure() is documented behavior in Node.js, but W3C User Timing Level 2 version 20190226 says it should default to a value of performance.now() if left undefined.
Node's documentation also states "This is the same Performance API as implemented in modern Web browsers," but in this case the behavior is different, because measure() does not throw an exception in this circumstance in evergreen web browsers.
Activity
himself65 commentedon Apr 4, 2020
I'm working on this
perf_hooks: allow omitted parameters in 'performance.measure'
perf_hooks: allow omitted parameters in 'performance.measure'
perf_hooks: allow omitted parameters in 'performance.measure'
perf_hooks: allow omitted parameters in 'performance.measure'