From dd1d6a0f67cb386941ddc08aa453612f8398144f Mon Sep 17 00:00:00 2001 From: Geert-Jan Zwiers Date: Fri, 6 May 2022 19:37:18 +0200 Subject: feat(web): add `performance.timeOrigin` (#14489) Add support for the `performance.timeOrigin` web API. Co-authored-by: Jovi De Croock --- ext/web/15_performance.js | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'ext') diff --git a/ext/web/15_performance.js b/ext/web/15_performance.js index 41b40159e..07fa2a01d 100644 --- a/ext/web/15_performance.js +++ b/ext/web/15_performance.js @@ -24,6 +24,7 @@ const illegalConstructorKey = Symbol("illegalConstructorKey"); const customInspect = SymbolFor("Deno.customInspect"); let performanceEntries = []; + let timeOrigin; webidl.converters["PerformanceMarkOptions"] = webidl .createDictionaryConverter( @@ -77,6 +78,10 @@ return webidl.converters.DOMString(V, opts); }; + function setTimeOrigin(origin) { + timeOrigin = origin; + } + function findMostRecent( name, type, @@ -327,6 +332,10 @@ webidl.illegalConstructor(); } + get timeOrigin() { + return timeOrigin; + } + clearMarks(markName = undefined) { webidl.assertBranded(this, PerformancePrototype); if (markName !== undefined) { @@ -566,5 +575,6 @@ PerformanceMeasure, Performance, performance: webidl.createBranded(Performance), + setTimeOrigin, }; })(this); -- cgit v1.2.3