| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent e60d905 commit dfe4237
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -29,10 +29,6 @@ class PerformanceResourceTiming extends PerformanceEntry { | |||
| 29 | 29 | throw new ERR_ILLEGAL_CONSTRUCTOR(); | |
| 30 | 30 | } | |
| 31 | 31 | ||
| 32 | - get [SymbolToStringTag]() { | ||
| 33 | - return 'PerformanceResourceTiming'; | ||
| 34 | - } | ||
| 35 | - | ||
| 36 | 32 | get name() { | |
| 37 | 33 | validateInternalField(this, kRequestedUrl, 'PerformanceResourceTiming'); | |
| 38 | 34 | return this[kRequestedUrl]; | |
@@ -185,6 +181,11 @@ ObjectDefineProperties(PerformanceResourceTiming.prototype, { | |||
| 185 | 181 | encodedBodySize: kEnumerableProperty, | |
| 186 | 182 | decodedBodySize: kEnumerableProperty, | |
| 187 | 183 | toJSON: kEnumerableProperty, | |
| 184 | + [SymbolToStringTag]: { | ||
| 185 | + __proto__: null, | ||
| 186 | + configurable: true, | ||
| 187 | + value: 'PerformanceResourceTiming', | ||
| 188 | + }, | ||
| 188 | 189 | }); | |
| 189 | 190 | ||
| 190 | 191 | function createPerformanceResourceTiming(requestedUrl, initiatorType, timingInfo, cacheMode = '') { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -98,10 +98,6 @@ class PerformanceMark { | |||
| 98 | 98 | return this[kDetail]; | |
| 99 | 99 | } | |
| 100 | 100 | ||
| 101 | - get [SymbolToStringTag]() { | ||
| 102 | - return 'PerformanceMark'; | ||
| 103 | - } | ||
| 104 | - | ||
| 105 | 101 | toJSON() { | |
| 106 | 102 | return { | |
| 107 | 103 | name: this.name, | |
@@ -116,6 +112,11 @@ ObjectSetPrototypeOf(PerformanceMark, PerformanceEntry); | |||
| 116 | 112 | ObjectSetPrototypeOf(PerformanceMark.prototype, PerformanceEntry.prototype); | |
| 117 | 113 | ObjectDefineProperties(PerformanceMark.prototype, { | |
| 118 | 114 | detail: kEnumerableProperty, | |
| 115 | + [SymbolToStringTag]: { | ||
| 116 | + __proto__: null, | ||
| 117 | + configurable: true, | ||
| 118 | + value: 'PerformanceMark', | ||
| 119 | + }, | ||
| 119 | 120 | }); | |
| 120 | 121 | ||
| 121 | 122 | class PerformanceMeasure extends PerformanceEntry { | |
@@ -127,13 +128,14 @@ class PerformanceMeasure extends PerformanceEntry { | |||
| 127 | 128 | validateInternalField(this, kDetail, 'PerformanceMeasure'); | |
| 128 | 129 | return this[kDetail]; | |
| 129 | 130 | } | |
| 130 | - | ||
| 131 | - get [SymbolToStringTag]() { | ||
| 132 | - return 'PerformanceMeasure'; | ||
| 133 | - } | ||
| 134 | 131 | } | |
| 135 | 132 | ObjectDefineProperties(PerformanceMeasure.prototype, { | |
| 136 | 133 | detail: kEnumerableProperty, | |
| 134 | + [SymbolToStringTag]: { | ||
| 135 | + __proto__: null, | ||
| 136 | + configurable: true, | ||
| 137 | + value: 'PerformanceMeasure', | ||
| 138 | + }, | ||
| 137 | 139 | }); | |
| 138 | 140 | ||
| 139 | 141 | function createPerformanceMeasure(name, start, duration, detail) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -17,6 +17,11 @@ assert(PerformanceResourceTiming); | |||
| 17 | 17 | assert(performance.clearResourceTimings); | |
| 18 | 18 | assert(performance.markResourceTiming); | |
| 19 | 19 | ||
| 20 | + assert.deepStrictEqual( | ||
| 21 | + Object.getOwnPropertyDescriptor(PerformanceResourceTiming.prototype, Symbol.toStringTag), | ||
| 22 | + { configurable: true, enumerable: false, value: 'PerformanceResourceTiming', writable: false }, | ||
| 23 | + ); | ||
| 24 | + | ||
| 20 | 25 | function createTimingInfo({ | |
| 21 | 26 | startTime = 0, | |
| 22 | 27 | redirectStartTime = 0, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -6,6 +6,7 @@ const { | |||
| 6 | 6 | PerformanceObserver, | |
| 7 | 7 | PerformanceEntry, | |
| 8 | 8 | PerformanceMark, | |
| 9 | + PerformanceMeasure, | ||
| 9 | 10 | performance, | |
| 10 | 11 | performance: { | |
| 11 | 12 | nodeTiming, | |
@@ -18,6 +19,18 @@ assert(PerformanceMark); | |||
| 18 | 19 | assert(performance.mark); | |
| 19 | 20 | assert(performance.measure); | |
| 20 | 21 | ||
| 22 | + [PerformanceMark, PerformanceMeasure].forEach((c) => { | ||
| 23 | + assert.deepStrictEqual( | ||
| 24 | + Object.getOwnPropertyDescriptor(c.prototype, Symbol.toStringTag), | ||
| 25 | + { | ||
| 26 | + configurable: true, | ||
| 27 | + enumerable: false, | ||
| 28 | + writable: false, | ||
| 29 | + value: c.name, | ||
| 30 | + } | ||
| 31 | + ); | ||
| 32 | + }); | ||
| 33 | + | ||
| 21 | 34 | [undefined, 'a', 'null', 1, true].forEach((i) => { | |
| 22 | 35 | const m = performance.mark(i); | |
| 23 | 36 | assert(m instanceof PerformanceEntry); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments