refactor: use Symbol.for instead of Symbol in cli/rt/ (#7537)

This commit is contained in:
Bartek Iwańczuk 2020-09-17 18:42:36 +02:00 committed by GitHub
parent bda9379385
commit c307e3e4be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 22 additions and 12 deletions

View file

@ -2,9 +2,9 @@
((window) => {
const { opNow } = window.__bootstrap.timers;
const { customInspect, inspect } = window.__bootstrap.console;
const { cloneValue } = window.__bootstrap.webUtil;
const customInspect = Symbol.for("Deno.customInspect");
let performanceEntries = [];
function findMostRecent(
@ -130,7 +130,7 @@
[customInspect]() {
return this.detail
? `${this.constructor.name} {\n detail: ${
inspect(this.detail, { depth: 3 })
JSON.stringify(this.detail, null, 2)
},\n name: "${this.name}",\n entryType: "${this.entryType}",\n startTime: ${this.startTime},\n duration: ${this.duration}\n}`
: `${this.constructor.name} { detail: ${this.detail}, name: "${this.name}", entryType: "${this.entryType}", startTime: ${this.startTime}, duration: ${this.duration} }`;
}
@ -170,7 +170,7 @@
[customInspect]() {
return this.detail
? `${this.constructor.name} {\n detail: ${
inspect(this.detail, { depth: 3 })
JSON.stringify(this.detail, null, 2)
},\n name: "${this.name}",\n entryType: "${this.entryType}",\n startTime: ${this.startTime},\n duration: ${this.duration}\n}`
: `${this.constructor.name} { detail: ${this.detail}, name: "${this.name}", entryType: "${this.entryType}", startTime: ${this.startTime}, duration: ${this.duration} }`;
}