diff options
author | Geert-Jan Zwiers <geertjanzwiers@protonmail.com> | 2022-05-06 19:37:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-06 19:37:18 +0200 |
commit | dd1d6a0f67cb386941ddc08aa453612f8398144f (patch) | |
tree | 450ebcac29f6c812245939449a08d83e4e5e3e61 /ext/web/15_performance.js | |
parent | 23c77df6643f5b5a8846f67a738fe2e9c1e3c716 (diff) |
feat(web): add `performance.timeOrigin` (#14489)
Add support for the `performance.timeOrigin` web API.
Co-authored-by: Jovi De Croock <decroockjovi@gmail.com>
Diffstat (limited to 'ext/web/15_performance.js')
-rw-r--r-- | ext/web/15_performance.js | 10 |
1 files changed, 10 insertions, 0 deletions
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); |