PerformanceObserver yields a cryptic error when no valid entry types are requested.

RESOLVED INVALID

Status

()

Core
DOM
P3
normal
RESOLVED INVALID
7 months ago
4 months ago

People

(Reporter: Thomas Wisniewski, Unassigned)

Tracking

53 Branch
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

7 months ago
In Chrome, this code:

>new window.PerformanceObserver(e => {}).observe({entryTypes: ["unsupported"]});

Yields the following error:

>Uncaught TypeError: Failed to execute 'observe' on 'PerformanceObserver': A Performance Observer MUST have at least one valid entryType in its entryTypes attribute.

In Firefox, it yields:

>TypeError: The expression cannot be converted to return the specified type.

This message could stand to be clearer. Also, since MDN* lists "valid" entry types that Firefox doesn't yet support (like "frame"), it would be good for the message to specify that the type is *unsupported* instead of not valid. Otherwise the MDN documentation will seem unintentionally misleading.


* https://developer.mozilla.org/en-US/docs/Web/API/PerformanceEntry/entryType

Updated

7 months ago
Priority: -- → P3
(Reporter)

Comment 1

4 months ago
Marking this as obsolete in favor of bug 1403027, given the WG's resolution to remove this exception entirely.
Status: NEW → RESOLVED
Last Resolved: 4 months ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.