1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-24 15:19:26 -05:00

fix: align performance API to spec using WPT (#9012)

This commit is contained in:
Luca Casonato 2021-01-06 02:56:40 +01:00 committed by GitHub
parent bb88418221
commit 60c9c85758
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 49 additions and 5 deletions

View file

@ -135,13 +135,49 @@
"Encoding argument supported for decode: UTF-16LE",
"Encoding argument supported for decode: x-user-defined"
]
},
}
// TODO(lucacasonato): enable when we support utf-16
// "textencoder-utf16-surrogates",
// TODO(lucacasonato): uses XMLHttpRequest unnecessarily. should be fixed upstream before enabling
// "unsupported-encodings",
],
"dom": [
"abort/event"
"dom": ["abort/event"],
"hr-time": ["monotonic-clock"],
"html": [
"webappapis/microtask-queuing/queue-microtask-exceptions.any",
"webappapis/microtask-queuing/queue-microtask.any"
],
"user-timing": [
"clear_all_marks",
"clear_all_measures",
"clear_non_existent_mark",
"clear_non_existent_measure",
"clear_one_mark",
"clear_one_measure",
"entry_type",
"mark-entry-constructor",
"mark-errors",
"mark-measure-return-objects",
"mark.any",
{
"name": "measure_syntax_err",
"expectFail": [
// TODO(lucacasonato): re-enable when #9009 is fixed.
"self.performance.measure(\"measure\", \"mark\"), where \"mark\" is a non-existent mark, throws a SyntaxError exception.",
"self.performance.measure(\"measure\", \"mark\", \"existing_mark\"), where \"mark\" is a non-existent mark, throws a SyntaxError exception.",
"self.performance.measure(\"measure\", \"existing_mark\", \"mark\"), where \"mark\" is a non-existent mark, throws a SyntaxError exception.",
"self.performance.measure(\"measure\", \"mark\", \"mark\"), where \"mark\" is a non-existent mark, throws a SyntaxError exception."
]
},
"measure-l3",
{
"name": "structured-serialize-detail",
"expectFail": [
// TODO(lucacasonato): re-enable when we use real structured clone.
"Mark: Throw an exception when the detail property cannot be structured-serialized.",
"Measure: Throw an exception when the detail property cannot be structured-serialized."
]
},
"user_timing_exists"
]
}

View file

@ -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() {

@ -1 +1 @@
Subproject commit b6f4d8ca80c396728754871433e61340da413022
Subproject commit 835839463c5270731a6a57885caff34cac7725e5