| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 7498383 commit 20089e2
8 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -35,7 +35,7 @@ const { | |||
| 35 | 35 | validateAbortSignal, | |
| 36 | 36 | validateObject, | |
| 37 | 37 | validateString, | |
| 38 | - validateInternalField, | ||
| 38 | + validateThisInternalField, | ||
| 39 | 39 | kValidateObjectAllowObjects, | |
| 40 | 40 | } = require('internal/validators'); | |
| 41 | 41 | ||
@@ -1118,7 +1118,7 @@ function defineEventHandler(emitter, name, event = name) { | |||
| 1118 | 1118 | // 8.1.5.1 Event handlers - basically `on[eventName]` attributes | |
| 1119 | 1119 | const propName = `on${name}`; | |
| 1120 | 1120 | function get() { | |
| 1121 | - validateInternalField(this, kHandlers, 'EventTarget'); | ||
| 1121 | + validateThisInternalField(this, kHandlers, 'EventTarget'); | ||
| 1122 | 1122 | return this[kHandlers]?.get(event)?.handler ?? null; | |
| 1123 | 1123 | } | |
| 1124 | 1124 | ObjectDefineProperty(get, 'name', { | |
@@ -1127,7 +1127,7 @@ function defineEventHandler(emitter, name, event = name) { | |||
| 1127 | 1127 | }); | |
| 1128 | 1128 | ||
| 1129 | 1129 | function set(value) { | |
| 1130 | - validateInternalField(this, kHandlers, 'EventTarget'); | ||
| 1130 | + validateThisInternalField(this, kHandlers, 'EventTarget'); | ||
| 1131 | 1131 | let wrappedHandler = this[kHandlers]?.get(event); | |
| 1132 | 1132 | if (wrappedHandler) { | |
| 1133 | 1133 | if (typeof wrappedHandler.handler === 'function') { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -52,7 +52,7 @@ const { | |||
| 52 | 52 | const { | |
| 53 | 53 | validateFunction, | |
| 54 | 54 | validateObject, | |
| 55 | - validateInternalField, | ||
| 55 | + validateThisInternalField, | ||
| 56 | 56 | } = require('internal/validators'); | |
| 57 | 57 | ||
| 58 | 58 | const { | |
@@ -185,12 +185,12 @@ class PerformanceObserverEntryList { | |||
| 185 | 185 | } | |
| 186 | 186 | ||
| 187 | 187 | getEntries() { | |
| 188 | - validateInternalField(this, kBuffer, 'PerformanceObserverEntryList'); | ||
| 188 | + validateThisInternalField(this, kBuffer, 'PerformanceObserverEntryList'); | ||
| 189 | 189 | return ArrayPrototypeSlice(this[kBuffer]); | |
| 190 | 190 | } | |
| 191 | 191 | ||
| 192 | 192 | getEntriesByType(type) { | |
| 193 | - validateInternalField(this, kBuffer, 'PerformanceObserverEntryList'); | ||
| 193 | + validateThisInternalField(this, kBuffer, 'PerformanceObserverEntryList'); | ||
| 194 | 194 | if (arguments.length === 0) { | |
| 195 | 195 | throw new ERR_MISSING_ARGS('type'); | |
| 196 | 196 | } | |
@@ -201,7 +201,7 @@ class PerformanceObserverEntryList { | |||
| 201 | 201 | } | |
| 202 | 202 | ||
| 203 | 203 | getEntriesByName(name, type = undefined) { | |
| 204 | - validateInternalField(this, kBuffer, 'PerformanceObserverEntryList'); | ||
| 204 | + validateThisInternalField(this, kBuffer, 'PerformanceObserverEntryList'); | ||
| 205 | 205 | if (arguments.length === 0) { | |
| 206 | 206 | throw new ERR_MISSING_ARGS('name'); | |
| 207 | 207 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -43,7 +43,7 @@ const nodeTiming = require('internal/perf/nodetiming'); | |||
| 43 | 43 | const timerify = require('internal/perf/timerify'); | |
| 44 | 44 | const { customInspectSymbol: kInspect, kEnumerableProperty, kEmptyObject } = require('internal/util'); | |
| 45 | 45 | const { inspect } = require('util'); | |
| 46 | - const { validateInternalField } = require('internal/validators'); | ||
| 46 | + const { validateThisInternalField } = require('internal/validators'); | ||
| 47 | 47 | const { convertToInt } = require('internal/webidl'); | |
| 48 | 48 | ||
| 49 | 49 | const kPerformanceBrand = Symbol('performance'); | |
@@ -68,7 +68,7 @@ class Performance extends EventTarget { | |||
| 68 | 68 | } | |
| 69 | 69 | ||
| 70 | 70 | clearMarks(name = undefined) { | |
| 71 | - validateInternalField(this, kPerformanceBrand, 'Performance'); | ||
| 71 | + validateThisInternalField(this, kPerformanceBrand, 'Performance'); | ||
| 72 | 72 | if (name !== undefined) { | |
| 73 | 73 | name = `${name}`; | |
| 74 | 74 | } | |
@@ -77,28 +77,28 @@ class Performance extends EventTarget { | |||
| 77 | 77 | } | |
| 78 | 78 | ||
| 79 | 79 | clearMeasures(name = undefined) { | |
| 80 | - validateInternalField(this, kPerformanceBrand, 'Performance'); | ||
| 80 | + validateThisInternalField(this, kPerformanceBrand, 'Performance'); | ||
| 81 | 81 | if (name !== undefined) { | |
| 82 | 82 | name = `${name}`; | |
| 83 | 83 | } | |
| 84 | 84 | clearEntriesFromBuffer('measure', name); | |
| 85 | 85 | } | |
| 86 | 86 | ||
| 87 | 87 | clearResourceTimings(name = undefined) { | |
| 88 | - validateInternalField(this, kPerformanceBrand, 'Performance'); | ||
| 88 | + validateThisInternalField(this, kPerformanceBrand, 'Performance'); | ||
| 89 | 89 | if (name !== undefined) { | |
| 90 | 90 | name = `${name}`; | |
| 91 | 91 | } | |
| 92 | 92 | clearEntriesFromBuffer('resource', name); | |
| 93 | 93 | } | |
| 94 | 94 | ||
| 95 | 95 | getEntries() { | |
| 96 | - validateInternalField(this, kPerformanceBrand, 'Performance'); | ||
| 96 | + validateThisInternalField(this, kPerformanceBrand, 'Performance'); | ||
| 97 | 97 | return filterBufferMapByNameAndType(); | |
| 98 | 98 | } | |
| 99 | 99 | ||
| 100 | 100 | getEntriesByName(name, type = undefined) { | |
| 101 | - validateInternalField(this, kPerformanceBrand, 'Performance'); | ||
| 101 | + validateThisInternalField(this, kPerformanceBrand, 'Performance'); | ||
| 102 | 102 | if (arguments.length === 0) { | |
| 103 | 103 | throw new ERR_MISSING_ARGS('name'); | |
| 104 | 104 | } | |
@@ -110,7 +110,7 @@ class Performance extends EventTarget { | |||
| 110 | 110 | } | |
| 111 | 111 | ||
| 112 | 112 | getEntriesByType(type) { | |
| 113 | - validateInternalField(this, kPerformanceBrand, 'Performance'); | ||
| 113 | + validateThisInternalField(this, kPerformanceBrand, 'Performance'); | ||
| 114 | 114 | if (arguments.length === 0) { | |
| 115 | 115 | throw new ERR_MISSING_ARGS('type'); | |
| 116 | 116 | } | |
@@ -119,28 +119,28 @@ class Performance extends EventTarget { | |||
| 119 | 119 | } | |
| 120 | 120 | ||
| 121 | 121 | mark(name, options = kEmptyObject) { | |
| 122 | - validateInternalField(this, kPerformanceBrand, 'Performance'); | ||
| 122 | + validateThisInternalField(this, kPerformanceBrand, 'Performance'); | ||
| 123 | 123 | if (arguments.length === 0) { | |
| 124 | 124 | throw new ERR_MISSING_ARGS('name'); | |
| 125 | 125 | } | |
| 126 | 126 | return mark(name, options); | |
| 127 | 127 | } | |
| 128 | 128 | ||
| 129 | 129 | measure(name, startOrMeasureOptions = kEmptyObject, endMark = undefined) { | |
| 130 | - validateInternalField(this, kPerformanceBrand, 'Performance'); | ||
| 130 | + validateThisInternalField(this, kPerformanceBrand, 'Performance'); | ||
| 131 | 131 | if (arguments.length === 0) { | |
| 132 | 132 | throw new ERR_MISSING_ARGS('name'); | |
| 133 | 133 | } | |
| 134 | 134 | return measure(name, startOrMeasureOptions, endMark); | |
| 135 | 135 | } | |
| 136 | 136 | ||
| 137 | 137 | now() { | |
| 138 | - validateInternalField(this, kPerformanceBrand, 'Performance'); | ||
| 138 | + validateThisInternalField(this, kPerformanceBrand, 'Performance'); | ||
| 139 | 139 | return now(); | |
| 140 | 140 | } | |
| 141 | 141 | ||
| 142 | 142 | setResourceTimingBufferSize(maxSize) { | |
| 143 | - validateInternalField(this, kPerformanceBrand, 'Performance'); | ||
| 143 | + validateThisInternalField(this, kPerformanceBrand, 'Performance'); | ||
| 144 | 144 | if (arguments.length === 0) { | |
| 145 | 145 | throw new ERR_MISSING_ARGS('maxSize'); | |
| 146 | 146 | } | |
@@ -150,12 +150,12 @@ class Performance extends EventTarget { | |||
| 150 | 150 | } | |
| 151 | 151 | ||
| 152 | 152 | get timeOrigin() { | |
| 153 | - validateInternalField(this, kPerformanceBrand, 'Performance'); | ||
| 153 | + validateThisInternalField(this, kPerformanceBrand, 'Performance'); | ||
| 154 | 154 | return getTimeOriginTimestamp(); | |
| 155 | 155 | } | |
| 156 | 156 | ||
| 157 | 157 | toJSON() { | |
| 158 | - validateInternalField(this, kPerformanceBrand, 'Performance'); | ||
| 158 | + validateThisInternalField(this, kPerformanceBrand, 'Performance'); | ||
| 159 | 159 | return { | |
| 160 | 160 | nodeTiming: this.nodeTiming, | |
| 161 | 161 | timeOrigin: this.timeOrigin, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -15,7 +15,7 @@ const { | |||
| 15 | 15 | customInspectSymbol: kInspect, | |
| 16 | 16 | kEnumerableProperty, | |
| 17 | 17 | } = require('internal/util'); | |
| 18 | - const { validateInternalField } = require('internal/validators'); | ||
| 18 | + const { validateThisInternalField } = require('internal/validators'); | ||
| 19 | 19 | ||
| 20 | 20 | const { inspect } = require('util'); | |
| 21 | 21 | ||
@@ -49,22 +49,22 @@ class PerformanceEntry { | |||
| 49 | 49 | } | |
| 50 | 50 | ||
| 51 | 51 | get name() { | |
| 52 | - validateInternalField(this, kName, 'PerformanceEntry'); | ||
| 52 | + validateThisInternalField(this, kName, 'PerformanceEntry'); | ||
| 53 | 53 | return this[kName]; | |
| 54 | 54 | } | |
| 55 | 55 | ||
| 56 | 56 | get entryType() { | |
| 57 | - validateInternalField(this, kEntryType, 'PerformanceEntry'); | ||
| 57 | + validateThisInternalField(this, kEntryType, 'PerformanceEntry'); | ||
| 58 | 58 | return this[kEntryType]; | |
| 59 | 59 | } | |
| 60 | 60 | ||
| 61 | 61 | get startTime() { | |
| 62 | - validateInternalField(this, kStartTime, 'PerformanceEntry'); | ||
| 62 | + validateThisInternalField(this, kStartTime, 'PerformanceEntry'); | ||
| 63 | 63 | return this[kStartTime]; | |
| 64 | 64 | } | |
| 65 | 65 | ||
| 66 | 66 | get duration() { | |
| 67 | - validateInternalField(this, kDuration, 'PerformanceEntry'); | ||
| 67 | + validateThisInternalField(this, kDuration, 'PerformanceEntry'); | ||
| 68 | 68 | return this[kDuration]; | |
| 69 | 69 | } | |
| 70 | 70 | ||
@@ -80,7 +80,7 @@ class PerformanceEntry { | |||
| 80 | 80 | } | |
| 81 | 81 | ||
| 82 | 82 | toJSON() { | |
| 83 | - validateInternalField(this, kName, 'PerformanceEntry'); | ||
| 83 | + validateThisInternalField(this, kName, 'PerformanceEntry'); | ||
| 84 | 84 | return { | |
| 85 | 85 | name: this[kName], | |
| 86 | 86 | entryType: this[kEntryType], | |
@@ -106,12 +106,12 @@ function createPerformanceEntry(name, type, start, duration) { | |||
| 106 | 106 | */ | |
| 107 | 107 | class PerformanceNodeEntry extends PerformanceEntry { | |
| 108 | 108 | get detail() { | |
| 109 | - validateInternalField(this, kDetail, 'NodePerformanceEntry'); | ||
| 109 | + validateThisInternalField(this, kDetail, 'NodePerformanceEntry'); | ||
| 110 | 110 | return this[kDetail]; | |
| 111 | 111 | } | |
| 112 | 112 | ||
| 113 | 113 | toJSON() { | |
| 114 | - validateInternalField(this, kName, 'PerformanceEntry'); | ||
| 114 | + validateThisInternalField(this, kName, 'PerformanceEntry'); | ||
| 115 | 115 | return { | |
| 116 | 116 | name: this[kName], | |
| 117 | 117 | entryType: this[kEntryType], | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -14,7 +14,7 @@ const { | |||
| 14 | 14 | const { PerformanceEntry, kSkipThrow } = require('internal/perf/performance_entry'); | |
| 15 | 15 | const assert = require('internal/assert'); | |
| 16 | 16 | const { enqueue, bufferResourceTiming } = require('internal/perf/observe'); | |
| 17 | - const { validateInternalField } = require('internal/validators'); | ||
| 17 | + const { validateThisInternalField } = require('internal/validators'); | ||
| 18 | 18 | const { kEnumerableProperty } = require('internal/util'); | |
| 19 | 19 | ||
| 20 | 20 | const kCacheMode = Symbol('kCacheMode'); | |
@@ -34,122 +34,122 @@ class PerformanceResourceTiming extends PerformanceEntry { | |||
| 34 | 34 | } | |
| 35 | 35 | ||
| 36 | 36 | get name() { | |
| 37 | - validateInternalField(this, kRequestedUrl, 'PerformanceResourceTiming'); | ||
| 37 | + validateThisInternalField(this, kRequestedUrl, 'PerformanceResourceTiming'); | ||
| 38 | 38 | return this[kRequestedUrl]; | |
| 39 | 39 | } | |
| 40 | 40 | ||
| 41 | 41 | get startTime() { | |
| 42 | - validateInternalField(this, kTimingInfo, 'PerformanceResourceTiming'); | ||
| 42 | + validateThisInternalField(this, kTimingInfo, 'PerformanceResourceTiming'); | ||
| 43 | 43 | return this[kTimingInfo].startTime; | |
| 44 | 44 | } | |
| 45 | 45 | ||
| 46 | 46 | get duration() { | |
| 47 | - validateInternalField(this, kTimingInfo, 'PerformanceResourceTiming'); | ||
| 47 | + validateThisInternalField(this, kTimingInfo, 'PerformanceResourceTiming'); | ||
| 48 | 48 | return this[kTimingInfo].endTime - this[kTimingInfo].startTime; | |
| 49 | 49 | } | |
| 50 | 50 | ||
| 51 | 51 | get initiatorType() { | |
| 52 | - validateInternalField(this, kInitiatorType, 'PerformanceResourceTiming'); | ||
| 52 | + validateThisInternalField(this, kInitiatorType, 'PerformanceResourceTiming'); | ||
| 53 | 53 | return this[kInitiatorType]; | |
| 54 | 54 | } | |
| 55 | 55 | ||
| 56 | 56 | get workerStart() { | |
| 57 | - validateInternalField(this, kTimingInfo, 'PerformanceResourceTiming'); | ||
| 57 | + validateThisInternalField(this, kTimingInfo, 'PerformanceResourceTiming'); | ||
| 58 | 58 | return this[kTimingInfo].finalServiceWorkerStartTime; | |
| 59 | 59 | } | |
| 60 | 60 | ||
| 61 | 61 | get redirectStart() { | |
| 62 | - validateInternalField(this, kTimingInfo, 'PerformanceResourceTiming'); | ||
| 62 | + validateThisInternalField(this, kTimingInfo, 'PerformanceResourceTiming'); | ||
| 63 | 63 | return this[kTimingInfo].redirectStartTime; | |
| 64 | 64 | } | |
| 65 | 65 | ||
| 66 | 66 | get redirectEnd() { | |
| 67 | - validateInternalField(this, kTimingInfo, 'PerformanceResourceTiming'); | ||
| 67 | + validateThisInternalField(this, kTimingInfo, 'PerformanceResourceTiming'); | ||
| 68 | 68 | return this[kTimingInfo].redirectEndTime; | |
| 69 | 69 | } | |
| 70 | 70 | ||
| 71 | 71 | get fetchStart() { | |
| 72 | - validateInternalField(this, kTimingInfo, 'PerformanceResourceTiming'); | ||
| 72 | + validateThisInternalField(this, kTimingInfo, 'PerformanceResourceTiming'); | ||
| 73 | 73 | return this[kTimingInfo].postRedirectStartTime; | |
| 74 | 74 | } | |
| 75 | 75 | ||
| 76 | 76 | get domainLookupStart() { | |
| 77 | - validateInternalField(this, kTimingInfo, 'PerformanceResourceTiming'); | ||
| 77 | + validateThisInternalField(this, kTimingInfo, 'PerformanceResourceTiming'); | ||
| 78 | 78 | return this[kTimingInfo].finalConnectionTimingInfo?.domainLookupStartTime; | |
| 79 | 79 | } | |
| 80 | 80 | ||
| 81 | 81 | get domainLookupEnd() { | |
| 82 | - validateInternalField(this, kTimingInfo, 'PerformanceResourceTiming'); | ||
| 82 | + validateThisInternalField(this, kTimingInfo, 'PerformanceResourceTiming'); | ||
| 83 | 83 | return this[kTimingInfo].finalConnectionTimingInfo?.domainLookupEndTime; | |
| 84 | 84 | } | |
| 85 | 85 | ||
| 86 | 86 | get connectStart() { | |
| 87 | - validateInternalField(this, kTimingInfo, 'PerformanceResourceTiming'); | ||
| 87 | + validateThisInternalField(this, kTimingInfo, 'PerformanceResourceTiming'); | ||
| 88 | 88 | return this[kTimingInfo].finalConnectionTimingInfo?.connectionStartTime; | |
| 89 | 89 | } | |
| 90 | 90 | ||
| 91 | 91 | get connectEnd() { | |
| 92 | - validateInternalField(this, kTimingInfo, 'PerformanceResourceTiming'); | ||
| 92 | + validateThisInternalField(this, kTimingInfo, 'PerformanceResourceTiming'); | ||
| 93 | 93 | return this[kTimingInfo].finalConnectionTimingInfo?.connectionEndTime; | |
| 94 | 94 | } | |
| 95 | 95 | ||
| 96 | 96 | get secureConnectionStart() { | |
| 97 | - validateInternalField(this, kTimingInfo, 'PerformanceResourceTiming'); | ||
| 97 | + validateThisInternalField(this, kTimingInfo, 'PerformanceResourceTiming'); | ||
| 98 | 98 | return this[kTimingInfo] | |
| 99 | 99 | .finalConnectionTimingInfo?.secureConnectionStartTime; | |
| 100 | 100 | } | |
| 101 | 101 | ||
| 102 | 102 | get nextHopProtocol() { | |
| 103 | - validateInternalField(this, kTimingInfo, 'PerformanceResourceTiming'); | ||
| 103 | + validateThisInternalField(this, kTimingInfo, 'PerformanceResourceTiming'); | ||
| 104 | 104 | return this[kTimingInfo] | |
| 105 | 105 | .finalConnectionTimingInfo?.ALPNNegotiatedProtocol; | |
| 106 | 106 | } | |
| 107 | 107 | ||
| 108 | 108 | get requestStart() { | |
| 109 | - validateInternalField(this, kTimingInfo, 'PerformanceResourceTiming'); | ||
| 109 | + validateThisInternalField(this, kTimingInfo, 'PerformanceResourceTiming'); | ||
| 110 | 110 | return this[kTimingInfo].finalNetworkRequestStartTime; | |
| 111 | 111 | } | |
| 112 | 112 | ||
| 113 | 113 | get responseStart() { | |
| 114 | - validateInternalField(this, kTimingInfo, 'PerformanceResourceTiming'); | ||
| 114 | + validateThisInternalField(this, kTimingInfo, 'PerformanceResourceTiming'); | ||
| 115 | 115 | return this[kTimingInfo].finalNetworkResponseStartTime; | |
| 116 | 116 | } | |
| 117 | 117 | ||
| 118 | 118 | get responseEnd() { | |
| 119 | - validateInternalField(this, kTimingInfo, 'PerformanceResourceTiming'); | ||
| 119 | + validateThisInternalField(this, kTimingInfo, 'PerformanceResourceTiming'); | ||
| 120 | 120 | return this[kTimingInfo].endTime; | |
| 121 | 121 | } | |
| 122 | 122 | ||
| 123 | 123 | get encodedBodySize() { | |
| 124 | - validateInternalField(this, kTimingInfo, 'PerformanceResourceTiming'); | ||
| 124 | + validateThisInternalField(this, kTimingInfo, 'PerformanceResourceTiming'); | ||
| 125 | 125 | return this[kTimingInfo].encodedBodySize; | |
| 126 | 126 | } | |
| 127 | 127 | ||
| 128 | 128 | get decodedBodySize() { | |
| 129 | - validateInternalField(this, kTimingInfo, 'PerformanceResourceTiming'); | ||
| 129 | + validateThisInternalField(this, kTimingInfo, 'PerformanceResourceTiming'); | ||
| 130 | 130 | return this[kTimingInfo].decodedBodySize; | |
| 131 | 131 | } | |
| 132 | 132 | ||
| 133 | 133 | get transferSize() { | |
| 134 | - validateInternalField(this, kTimingInfo, 'PerformanceResourceTiming'); | ||
| 134 | + validateThisInternalField(this, kTimingInfo, 'PerformanceResourceTiming'); | ||
| 135 | 135 | if (this[kCacheMode] === 'local') return 0; | |
| 136 | 136 | if (this[kCacheMode] === 'validated') return 300; | |
| 137 | 137 | ||
| 138 | 138 | return this[kTimingInfo].encodedBodySize + 300; | |
| 139 | 139 | } | |
| 140 | 140 | ||
| 141 | 141 | get deliveryType() { | |
| 142 | - validateInternalField(this, kTimingInfo, 'PerformanceResourceTiming'); | ||
| 142 | + validateThisInternalField(this, kTimingInfo, 'PerformanceResourceTiming'); | ||
| 143 | 143 | return this[kDeliveryType]; | |
| 144 | 144 | } | |
| 145 | 145 | ||
| 146 | 146 | get responseStatus() { | |
| 147 | - validateInternalField(this, kTimingInfo, 'PerformanceResourceTiming'); | ||
| 147 | + validateThisInternalField(this, kTimingInfo, 'PerformanceResourceTiming'); | ||
| 148 | 148 | return this[kResponseStatus]; | |
| 149 | 149 | } | |
| 150 | 150 | ||
| 151 | 151 | toJSON() { | |
| 152 | - validateInternalField(this, kInitiatorType, 'PerformanceResourceTiming'); | ||
| 152 | + validateThisInternalField(this, kInitiatorType, 'PerformanceResourceTiming'); | ||
| 153 | 153 | return { | |
| 154 | 154 | name: this.name, | |
| 155 | 155 | entryType: this.entryType, | |
| Back | FazBrowse Home | New Git URL |
0 commit comments