From 60c9c857584bf5180dd0f7b937683dd9691aef84 Mon Sep 17 00:00:00 2001 From: Luca Casonato Date: Wed, 6 Jan 2021 02:56:40 +0100 Subject: fix: align performance API to spec using WPT (#9012) --- runtime/js/40_performance.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'runtime') 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() { -- cgit v1.2.3