summaryrefslogtreecommitdiff
path: root/ext/web/15_performance.js
diff options
context:
space:
mode:
authorKenta Moriuchi <moriken@kimamass.com>2023-11-19 17:13:38 +0900
committerGitHub <noreply@github.com>2023-11-19 09:13:38 +0100
commitc806fbdabe144c865612bbbc9ef596c9611c8310 (patch)
treeedb38d58720377580677ccbeffb693ffa1225cc4 /ext/web/15_performance.js
parenta7548afb58b9848e501a085455446f5de897ffaa (diff)
fix(ext,runtime): add missing custom inspections (#21219)
Diffstat (limited to 'ext/web/15_performance.js')
-rw-r--r--ext/web/15_performance.js107
1 files changed, 59 insertions, 48 deletions
diff --git a/ext/web/15_performance.js b/ext/web/15_performance.js
index 9ec2cd376..4527ff00c 100644
--- a/ext/web/15_performance.js
+++ b/ext/web/15_performance.js
@@ -22,7 +22,6 @@ import { opNow } from "ext:deno_web/02_timers.js";
import DOMException from "ext:deno_web/01_dom_exception.js";
const illegalConstructorKey = Symbol("illegalConstructorKey");
-const customInspect = SymbolFor("Deno.customInspect");
let performanceEntries = [];
let timeOrigin;
@@ -196,20 +195,23 @@ class PerformanceEntry {
};
}
- [customInspect](inspect) {
- return inspect(createFilteredInspectProxy({
- object: this,
- evaluate: ObjectPrototypeIsPrototypeOf(
- PerformanceEntryPrototype,
- this,
- ),
- keys: [
- "name",
- "entryType",
- "startTime",
- "duration",
- ],
- }));
+ [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
+ return inspect(
+ createFilteredInspectProxy({
+ object: this,
+ evaluate: ObjectPrototypeIsPrototypeOf(
+ PerformanceEntryPrototype,
+ this,
+ ),
+ keys: [
+ "name",
+ "entryType",
+ "startTime",
+ "duration",
+ ],
+ }),
+ inspectOptions,
+ );
}
}
webidl.configureInterface(PerformanceEntry);
@@ -265,18 +267,21 @@ class PerformanceMark extends PerformanceEntry {
};
}
- [customInspect](inspect) {
- return inspect(createFilteredInspectProxy({
- object: this,
- evaluate: ObjectPrototypeIsPrototypeOf(PerformanceMarkPrototype, this),
- keys: [
- "name",
- "entryType",
- "startTime",
- "duration",
- "detail",
- ],
- }));
+ [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
+ return inspect(
+ createFilteredInspectProxy({
+ object: this,
+ evaluate: ObjectPrototypeIsPrototypeOf(PerformanceMarkPrototype, this),
+ keys: [
+ "name",
+ "entryType",
+ "startTime",
+ "duration",
+ "detail",
+ ],
+ }),
+ inspectOptions,
+ );
}
}
webidl.configureInterface(PerformanceMark);
@@ -321,21 +326,24 @@ class PerformanceMeasure extends PerformanceEntry {
};
}
- [customInspect](inspect) {
- return inspect(createFilteredInspectProxy({
- object: this,
- evaluate: ObjectPrototypeIsPrototypeOf(
- PerformanceMeasurePrototype,
- this,
- ),
- keys: [
- "name",
- "entryType",
- "startTime",
- "duration",
- "detail",
- ],
- }));
+ [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
+ return inspect(
+ createFilteredInspectProxy({
+ object: this,
+ evaluate: ObjectPrototypeIsPrototypeOf(
+ PerformanceMeasurePrototype,
+ this,
+ ),
+ keys: [
+ "name",
+ "entryType",
+ "startTime",
+ "duration",
+ "detail",
+ ],
+ }),
+ inspectOptions,
+ );
}
}
webidl.configureInterface(PerformanceMeasure);
@@ -569,12 +577,15 @@ class Performance extends EventTarget {
};
}
- [customInspect](inspect) {
- return inspect(createFilteredInspectProxy({
- object: this,
- evaluate: ObjectPrototypeIsPrototypeOf(PerformancePrototype, this),
- keys: [],
- }));
+ [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
+ return inspect(
+ createFilteredInspectProxy({
+ object: this,
+ evaluate: ObjectPrototypeIsPrototypeOf(PerformancePrototype, this),
+ keys: ["timeOrigin"],
+ }),
+ inspectOptions,
+ );
}
}
webidl.configureInterface(Performance);