summaryrefslogtreecommitdiff
path: root/cli
diff options
context:
space:
mode:
Diffstat (limited to 'cli')
-rw-r--r--cli/dts/lib.deno.shared_globals.d.ts2
-rw-r--r--cli/tests/unit/performance_test.ts13
2 files changed, 14 insertions, 1 deletions
diff --git a/cli/dts/lib.deno.shared_globals.d.ts b/cli/dts/lib.deno.shared_globals.d.ts
index d430c16b0..efd59ca2e 100644
--- a/cli/dts/lib.deno.shared_globals.d.ts
+++ b/cli/dts/lib.deno.shared_globals.d.ts
@@ -449,7 +449,7 @@ declare class Worker extends EventTarget {
declare type PerformanceEntryList = PerformanceEntry[];
-declare class Performance {
+declare class Performance extends EventTarget {
/** Returns a timestamp representing the start of the performance measurement. */
readonly timeOrigin: number;
constructor();
diff --git a/cli/tests/unit/performance_test.ts b/cli/tests/unit/performance_test.ts
index 917546e2c..687bb024d 100644
--- a/cli/tests/unit/performance_test.ts
+++ b/cli/tests/unit/performance_test.ts
@@ -140,3 +140,16 @@ Deno.test(function performanceMeasureIllegalConstructor() {
"Illegal constructor",
);
});
+
+Deno.test(function performanceIsEventTarget() {
+ assert(performance instanceof EventTarget);
+
+ return new Promise((resolve) => {
+ const handler = () => {
+ resolve();
+ };
+
+ performance.addEventListener("test", handler, { once: true });
+ performance.dispatchEvent(new Event("test"));
+ });
+});