diff options
author | Luca Casonato <lucacasonato@yahoo.com> | 2021-01-06 02:56:40 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-06 02:56:40 +0100 |
commit | 60c9c857584bf5180dd0f7b937683dd9691aef84 (patch) | |
tree | 86ad8ab84bdf962752c0f7a4361a3f8c556691c9 /runtime/js | |
parent | bb884182218b5c12c7354c93860d69f65f59752a (diff) |
fix: align performance API to spec using WPT (#9012)
Diffstat (limited to 'runtime/js')
-rw-r--r-- | runtime/js/40_performance.js | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/runtime/js/40_performance.js b/runtime/js/40_performance.js index 0a63dc704..b9c873270 100644 --- a/runtime/js/40_performance.js +++ b/runtime/js/40_performance.js @@ -99,6 +99,8 @@ } class PerformanceMark extends PerformanceEntry { + [Symbol.toStringTag] = "PerformanceMark"; + #detail = null; get detail() { @@ -111,8 +113,12 @@ constructor( name, - { detail = null, startTime = now() } = {}, + options = {}, ) { + if (typeof options !== "object") { + throw new TypeError("Invalid options"); + } + const { detail = null, startTime = now() } = options; super(name, "mark", startTime, 0, illegalConstructorKey); if (startTime < 0) { throw new TypeError("startTime cannot be negative"); @@ -140,6 +146,8 @@ } class PerformanceMeasure extends PerformanceEntry { + [Symbol.toStringTag] = "PerformanceMeasure"; + #detail = null; get detail() { |