mirror of
https://github.com/nodejs/node.git
synced 2025-12-28 07:50:41 +00:00
lib: rename validateInternalField into validateThisInternalField
PR-URL: https://github.com/nodejs/node/pull/58765 Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
68930cf550
commit
6145ba7c75
@ -35,7 +35,7 @@ const {
|
||||
validateAbortSignal,
|
||||
validateObject,
|
||||
validateString,
|
||||
validateInternalField,
|
||||
validateThisInternalField,
|
||||
kValidateObjectAllowObjects,
|
||||
} = require('internal/validators');
|
||||
|
||||
@ -1118,7 +1118,7 @@ function defineEventHandler(emitter, name, event = name) {
|
||||
// 8.1.5.1 Event handlers - basically `on[eventName]` attributes
|
||||
const propName = `on${name}`;
|
||||
function get() {
|
||||
validateInternalField(this, kHandlers, 'EventTarget');
|
||||
validateThisInternalField(this, kHandlers, 'EventTarget');
|
||||
return this[kHandlers]?.get(event)?.handler ?? null;
|
||||
}
|
||||
ObjectDefineProperty(get, 'name', {
|
||||
@ -1127,7 +1127,7 @@ function defineEventHandler(emitter, name, event = name) {
|
||||
});
|
||||
|
||||
function set(value) {
|
||||
validateInternalField(this, kHandlers, 'EventTarget');
|
||||
validateThisInternalField(this, kHandlers, 'EventTarget');
|
||||
let wrappedHandler = this[kHandlers]?.get(event);
|
||||
if (wrappedHandler) {
|
||||
if (typeof wrappedHandler.handler === 'function') {
|
||||
|
||||
@ -51,7 +51,7 @@ const {
|
||||
const {
|
||||
validateFunction,
|
||||
validateObject,
|
||||
validateInternalField,
|
||||
validateThisInternalField,
|
||||
} = require('internal/validators');
|
||||
|
||||
const {
|
||||
@ -178,12 +178,12 @@ class PerformanceObserverEntryList {
|
||||
}
|
||||
|
||||
getEntries() {
|
||||
validateInternalField(this, kBuffer, 'PerformanceObserverEntryList');
|
||||
validateThisInternalField(this, kBuffer, 'PerformanceObserverEntryList');
|
||||
return ArrayPrototypeSlice(this[kBuffer]);
|
||||
}
|
||||
|
||||
getEntriesByType(type) {
|
||||
validateInternalField(this, kBuffer, 'PerformanceObserverEntryList');
|
||||
validateThisInternalField(this, kBuffer, 'PerformanceObserverEntryList');
|
||||
if (arguments.length === 0) {
|
||||
throw new ERR_MISSING_ARGS('type');
|
||||
}
|
||||
@ -194,7 +194,7 @@ class PerformanceObserverEntryList {
|
||||
}
|
||||
|
||||
getEntriesByName(name, type = undefined) {
|
||||
validateInternalField(this, kBuffer, 'PerformanceObserverEntryList');
|
||||
validateThisInternalField(this, kBuffer, 'PerformanceObserverEntryList');
|
||||
if (arguments.length === 0) {
|
||||
throw new ERR_MISSING_ARGS('name');
|
||||
}
|
||||
|
||||
@ -43,7 +43,7 @@ const nodeTiming = require('internal/perf/nodetiming');
|
||||
const timerify = require('internal/perf/timerify');
|
||||
const { customInspectSymbol: kInspect, kEnumerableProperty, kEmptyObject } = require('internal/util');
|
||||
const { inspect } = require('util');
|
||||
const { validateInternalField } = require('internal/validators');
|
||||
const { validateThisInternalField } = require('internal/validators');
|
||||
const { convertToInt } = require('internal/webidl');
|
||||
|
||||
const kPerformanceBrand = Symbol('performance');
|
||||
@ -68,7 +68,7 @@ class Performance extends EventTarget {
|
||||
}
|
||||
|
||||
clearMarks(name = undefined) {
|
||||
validateInternalField(this, kPerformanceBrand, 'Performance');
|
||||
validateThisInternalField(this, kPerformanceBrand, 'Performance');
|
||||
if (name !== undefined) {
|
||||
name = `${name}`;
|
||||
}
|
||||
@ -77,7 +77,7 @@ class Performance extends EventTarget {
|
||||
}
|
||||
|
||||
clearMeasures(name = undefined) {
|
||||
validateInternalField(this, kPerformanceBrand, 'Performance');
|
||||
validateThisInternalField(this, kPerformanceBrand, 'Performance');
|
||||
if (name !== undefined) {
|
||||
name = `${name}`;
|
||||
}
|
||||
@ -85,7 +85,7 @@ class Performance extends EventTarget {
|
||||
}
|
||||
|
||||
clearResourceTimings(name = undefined) {
|
||||
validateInternalField(this, kPerformanceBrand, 'Performance');
|
||||
validateThisInternalField(this, kPerformanceBrand, 'Performance');
|
||||
if (name !== undefined) {
|
||||
name = `${name}`;
|
||||
}
|
||||
@ -93,12 +93,12 @@ class Performance extends EventTarget {
|
||||
}
|
||||
|
||||
getEntries() {
|
||||
validateInternalField(this, kPerformanceBrand, 'Performance');
|
||||
validateThisInternalField(this, kPerformanceBrand, 'Performance');
|
||||
return filterBufferMapByNameAndType();
|
||||
}
|
||||
|
||||
getEntriesByName(name, type = undefined) {
|
||||
validateInternalField(this, kPerformanceBrand, 'Performance');
|
||||
validateThisInternalField(this, kPerformanceBrand, 'Performance');
|
||||
if (arguments.length === 0) {
|
||||
throw new ERR_MISSING_ARGS('name');
|
||||
}
|
||||
@ -110,7 +110,7 @@ class Performance extends EventTarget {
|
||||
}
|
||||
|
||||
getEntriesByType(type) {
|
||||
validateInternalField(this, kPerformanceBrand, 'Performance');
|
||||
validateThisInternalField(this, kPerformanceBrand, 'Performance');
|
||||
if (arguments.length === 0) {
|
||||
throw new ERR_MISSING_ARGS('type');
|
||||
}
|
||||
@ -119,7 +119,7 @@ class Performance extends EventTarget {
|
||||
}
|
||||
|
||||
mark(name, options = kEmptyObject) {
|
||||
validateInternalField(this, kPerformanceBrand, 'Performance');
|
||||
validateThisInternalField(this, kPerformanceBrand, 'Performance');
|
||||
if (arguments.length === 0) {
|
||||
throw new ERR_MISSING_ARGS('name');
|
||||
}
|
||||
@ -127,7 +127,7 @@ class Performance extends EventTarget {
|
||||
}
|
||||
|
||||
measure(name, startOrMeasureOptions = kEmptyObject, endMark = undefined) {
|
||||
validateInternalField(this, kPerformanceBrand, 'Performance');
|
||||
validateThisInternalField(this, kPerformanceBrand, 'Performance');
|
||||
if (arguments.length === 0) {
|
||||
throw new ERR_MISSING_ARGS('name');
|
||||
}
|
||||
@ -135,12 +135,12 @@ class Performance extends EventTarget {
|
||||
}
|
||||
|
||||
now() {
|
||||
validateInternalField(this, kPerformanceBrand, 'Performance');
|
||||
validateThisInternalField(this, kPerformanceBrand, 'Performance');
|
||||
return now();
|
||||
}
|
||||
|
||||
setResourceTimingBufferSize(maxSize) {
|
||||
validateInternalField(this, kPerformanceBrand, 'Performance');
|
||||
validateThisInternalField(this, kPerformanceBrand, 'Performance');
|
||||
if (arguments.length === 0) {
|
||||
throw new ERR_MISSING_ARGS('maxSize');
|
||||
}
|
||||
@ -150,12 +150,12 @@ class Performance extends EventTarget {
|
||||
}
|
||||
|
||||
get timeOrigin() {
|
||||
validateInternalField(this, kPerformanceBrand, 'Performance');
|
||||
validateThisInternalField(this, kPerformanceBrand, 'Performance');
|
||||
return getTimeOriginTimestamp();
|
||||
}
|
||||
|
||||
toJSON() {
|
||||
validateInternalField(this, kPerformanceBrand, 'Performance');
|
||||
validateThisInternalField(this, kPerformanceBrand, 'Performance');
|
||||
return {
|
||||
nodeTiming: this.nodeTiming,
|
||||
timeOrigin: this.timeOrigin,
|
||||
|
||||
@ -15,7 +15,7 @@ const {
|
||||
customInspectSymbol: kInspect,
|
||||
kEnumerableProperty,
|
||||
} = require('internal/util');
|
||||
const { validateInternalField } = require('internal/validators');
|
||||
const { validateThisInternalField } = require('internal/validators');
|
||||
|
||||
const { inspect } = require('util');
|
||||
|
||||
@ -49,22 +49,22 @@ class PerformanceEntry {
|
||||
}
|
||||
|
||||
get name() {
|
||||
validateInternalField(this, kName, 'PerformanceEntry');
|
||||
validateThisInternalField(this, kName, 'PerformanceEntry');
|
||||
return this[kName];
|
||||
}
|
||||
|
||||
get entryType() {
|
||||
validateInternalField(this, kEntryType, 'PerformanceEntry');
|
||||
validateThisInternalField(this, kEntryType, 'PerformanceEntry');
|
||||
return this[kEntryType];
|
||||
}
|
||||
|
||||
get startTime() {
|
||||
validateInternalField(this, kStartTime, 'PerformanceEntry');
|
||||
validateThisInternalField(this, kStartTime, 'PerformanceEntry');
|
||||
return this[kStartTime];
|
||||
}
|
||||
|
||||
get duration() {
|
||||
validateInternalField(this, kDuration, 'PerformanceEntry');
|
||||
validateThisInternalField(this, kDuration, 'PerformanceEntry');
|
||||
return this[kDuration];
|
||||
}
|
||||
|
||||
@ -80,7 +80,7 @@ class PerformanceEntry {
|
||||
}
|
||||
|
||||
toJSON() {
|
||||
validateInternalField(this, kName, 'PerformanceEntry');
|
||||
validateThisInternalField(this, kName, 'PerformanceEntry');
|
||||
return {
|
||||
name: this[kName],
|
||||
entryType: this[kEntryType],
|
||||
@ -106,12 +106,12 @@ function createPerformanceEntry(name, type, start, duration) {
|
||||
*/
|
||||
class PerformanceNodeEntry extends PerformanceEntry {
|
||||
get detail() {
|
||||
validateInternalField(this, kDetail, 'NodePerformanceEntry');
|
||||
validateThisInternalField(this, kDetail, 'NodePerformanceEntry');
|
||||
return this[kDetail];
|
||||
}
|
||||
|
||||
toJSON() {
|
||||
validateInternalField(this, kName, 'PerformanceEntry');
|
||||
validateThisInternalField(this, kName, 'PerformanceEntry');
|
||||
return {
|
||||
name: this[kName],
|
||||
entryType: this[kEntryType],
|
||||
|
||||
@ -14,7 +14,7 @@ const {
|
||||
const { PerformanceEntry, kSkipThrow } = require('internal/perf/performance_entry');
|
||||
const assert = require('internal/assert');
|
||||
const { enqueue, bufferResourceTiming } = require('internal/perf/observe');
|
||||
const { validateInternalField } = require('internal/validators');
|
||||
const { validateThisInternalField } = require('internal/validators');
|
||||
const { kEnumerableProperty } = require('internal/util');
|
||||
|
||||
const kCacheMode = Symbol('kCacheMode');
|
||||
@ -34,104 +34,104 @@ class PerformanceResourceTiming extends PerformanceEntry {
|
||||
}
|
||||
|
||||
get name() {
|
||||
validateInternalField(this, kRequestedUrl, 'PerformanceResourceTiming');
|
||||
validateThisInternalField(this, kRequestedUrl, 'PerformanceResourceTiming');
|
||||
return this[kRequestedUrl];
|
||||
}
|
||||
|
||||
get startTime() {
|
||||
validateInternalField(this, kTimingInfo, 'PerformanceResourceTiming');
|
||||
validateThisInternalField(this, kTimingInfo, 'PerformanceResourceTiming');
|
||||
return this[kTimingInfo].startTime;
|
||||
}
|
||||
|
||||
get duration() {
|
||||
validateInternalField(this, kTimingInfo, 'PerformanceResourceTiming');
|
||||
validateThisInternalField(this, kTimingInfo, 'PerformanceResourceTiming');
|
||||
return this[kTimingInfo].endTime - this[kTimingInfo].startTime;
|
||||
}
|
||||
|
||||
get initiatorType() {
|
||||
validateInternalField(this, kInitiatorType, 'PerformanceResourceTiming');
|
||||
validateThisInternalField(this, kInitiatorType, 'PerformanceResourceTiming');
|
||||
return this[kInitiatorType];
|
||||
}
|
||||
|
||||
get workerStart() {
|
||||
validateInternalField(this, kTimingInfo, 'PerformanceResourceTiming');
|
||||
validateThisInternalField(this, kTimingInfo, 'PerformanceResourceTiming');
|
||||
return this[kTimingInfo].finalServiceWorkerStartTime;
|
||||
}
|
||||
|
||||
get redirectStart() {
|
||||
validateInternalField(this, kTimingInfo, 'PerformanceResourceTiming');
|
||||
validateThisInternalField(this, kTimingInfo, 'PerformanceResourceTiming');
|
||||
return this[kTimingInfo].redirectStartTime;
|
||||
}
|
||||
|
||||
get redirectEnd() {
|
||||
validateInternalField(this, kTimingInfo, 'PerformanceResourceTiming');
|
||||
validateThisInternalField(this, kTimingInfo, 'PerformanceResourceTiming');
|
||||
return this[kTimingInfo].redirectEndTime;
|
||||
}
|
||||
|
||||
get fetchStart() {
|
||||
validateInternalField(this, kTimingInfo, 'PerformanceResourceTiming');
|
||||
validateThisInternalField(this, kTimingInfo, 'PerformanceResourceTiming');
|
||||
return this[kTimingInfo].postRedirectStartTime;
|
||||
}
|
||||
|
||||
get domainLookupStart() {
|
||||
validateInternalField(this, kTimingInfo, 'PerformanceResourceTiming');
|
||||
validateThisInternalField(this, kTimingInfo, 'PerformanceResourceTiming');
|
||||
return this[kTimingInfo].finalConnectionTimingInfo?.domainLookupStartTime;
|
||||
}
|
||||
|
||||
get domainLookupEnd() {
|
||||
validateInternalField(this, kTimingInfo, 'PerformanceResourceTiming');
|
||||
validateThisInternalField(this, kTimingInfo, 'PerformanceResourceTiming');
|
||||
return this[kTimingInfo].finalConnectionTimingInfo?.domainLookupEndTime;
|
||||
}
|
||||
|
||||
get connectStart() {
|
||||
validateInternalField(this, kTimingInfo, 'PerformanceResourceTiming');
|
||||
validateThisInternalField(this, kTimingInfo, 'PerformanceResourceTiming');
|
||||
return this[kTimingInfo].finalConnectionTimingInfo?.connectionStartTime;
|
||||
}
|
||||
|
||||
get connectEnd() {
|
||||
validateInternalField(this, kTimingInfo, 'PerformanceResourceTiming');
|
||||
validateThisInternalField(this, kTimingInfo, 'PerformanceResourceTiming');
|
||||
return this[kTimingInfo].finalConnectionTimingInfo?.connectionEndTime;
|
||||
}
|
||||
|
||||
get secureConnectionStart() {
|
||||
validateInternalField(this, kTimingInfo, 'PerformanceResourceTiming');
|
||||
validateThisInternalField(this, kTimingInfo, 'PerformanceResourceTiming');
|
||||
return this[kTimingInfo]
|
||||
.finalConnectionTimingInfo?.secureConnectionStartTime;
|
||||
}
|
||||
|
||||
get nextHopProtocol() {
|
||||
validateInternalField(this, kTimingInfo, 'PerformanceResourceTiming');
|
||||
validateThisInternalField(this, kTimingInfo, 'PerformanceResourceTiming');
|
||||
return this[kTimingInfo]
|
||||
.finalConnectionTimingInfo?.ALPNNegotiatedProtocol;
|
||||
}
|
||||
|
||||
get requestStart() {
|
||||
validateInternalField(this, kTimingInfo, 'PerformanceResourceTiming');
|
||||
validateThisInternalField(this, kTimingInfo, 'PerformanceResourceTiming');
|
||||
return this[kTimingInfo].finalNetworkRequestStartTime;
|
||||
}
|
||||
|
||||
get responseStart() {
|
||||
validateInternalField(this, kTimingInfo, 'PerformanceResourceTiming');
|
||||
validateThisInternalField(this, kTimingInfo, 'PerformanceResourceTiming');
|
||||
return this[kTimingInfo].finalNetworkResponseStartTime;
|
||||
}
|
||||
|
||||
get responseEnd() {
|
||||
validateInternalField(this, kTimingInfo, 'PerformanceResourceTiming');
|
||||
validateThisInternalField(this, kTimingInfo, 'PerformanceResourceTiming');
|
||||
return this[kTimingInfo].endTime;
|
||||
}
|
||||
|
||||
get encodedBodySize() {
|
||||
validateInternalField(this, kTimingInfo, 'PerformanceResourceTiming');
|
||||
validateThisInternalField(this, kTimingInfo, 'PerformanceResourceTiming');
|
||||
return this[kTimingInfo].encodedBodySize;
|
||||
}
|
||||
|
||||
get decodedBodySize() {
|
||||
validateInternalField(this, kTimingInfo, 'PerformanceResourceTiming');
|
||||
validateThisInternalField(this, kTimingInfo, 'PerformanceResourceTiming');
|
||||
return this[kTimingInfo].decodedBodySize;
|
||||
}
|
||||
|
||||
get transferSize() {
|
||||
validateInternalField(this, kTimingInfo, 'PerformanceResourceTiming');
|
||||
validateThisInternalField(this, kTimingInfo, 'PerformanceResourceTiming');
|
||||
if (this[kCacheMode] === 'local') return 0;
|
||||
if (this[kCacheMode] === 'validated') return 300;
|
||||
|
||||
@ -139,17 +139,17 @@ class PerformanceResourceTiming extends PerformanceEntry {
|
||||
}
|
||||
|
||||
get deliveryType() {
|
||||
validateInternalField(this, kTimingInfo, 'PerformanceResourceTiming');
|
||||
validateThisInternalField(this, kTimingInfo, 'PerformanceResourceTiming');
|
||||
return this[kDeliveryType];
|
||||
}
|
||||
|
||||
get responseStatus() {
|
||||
validateInternalField(this, kTimingInfo, 'PerformanceResourceTiming');
|
||||
validateThisInternalField(this, kTimingInfo, 'PerformanceResourceTiming');
|
||||
return this[kResponseStatus];
|
||||
}
|
||||
|
||||
toJSON() {
|
||||
validateInternalField(this, kInitiatorType, 'PerformanceResourceTiming');
|
||||
validateThisInternalField(this, kInitiatorType, 'PerformanceResourceTiming');
|
||||
return {
|
||||
name: this.name,
|
||||
entryType: this.entryType,
|
||||
|
||||
@ -18,7 +18,7 @@ const {
|
||||
validateNumber,
|
||||
validateObject,
|
||||
validateString,
|
||||
validateInternalField,
|
||||
validateThisInternalField,
|
||||
} = require('internal/validators');
|
||||
|
||||
const {
|
||||
@ -93,7 +93,7 @@ class PerformanceMark extends PerformanceEntry {
|
||||
}
|
||||
|
||||
get detail() {
|
||||
validateInternalField(this, kDetail, 'PerformanceMark');
|
||||
validateThisInternalField(this, kDetail, 'PerformanceMark');
|
||||
return this[kDetail];
|
||||
}
|
||||
|
||||
@ -133,7 +133,7 @@ class PerformanceMeasure extends PerformanceEntry {
|
||||
}
|
||||
|
||||
get detail() {
|
||||
validateInternalField(this, kDetail, 'PerformanceMeasure');
|
||||
validateThisInternalField(this, kDetail, 'PerformanceMeasure');
|
||||
return this[kDetail];
|
||||
}
|
||||
|
||||
|
||||
@ -533,7 +533,7 @@ const validateLinkHeaderFormat = hideStackFrames((value, name) => {
|
||||
* @param {string|symbol} fieldKey
|
||||
* @param {string} className
|
||||
*/
|
||||
const validateInternalField = hideStackFrames((object, fieldKey, className) => {
|
||||
const validateThisInternalField = hideStackFrames((object, fieldKey, className) => {
|
||||
if (typeof object !== 'object' || object === null || !ObjectPrototypeHasOwnProperty(object, fieldKey)) {
|
||||
throw new ERR_INVALID_THIS(className);
|
||||
}
|
||||
@ -648,7 +648,7 @@ module.exports = {
|
||||
validateUnion,
|
||||
validateAbortSignal,
|
||||
validateLinkHeaderValue,
|
||||
validateInternalField,
|
||||
validateThisInternalField,
|
||||
validateFiniteNumber,
|
||||
checkRangesOrGetDefault,
|
||||
};
|
||||
|
||||
@ -49,7 +49,7 @@ const {
|
||||
validateObject,
|
||||
validateUint32,
|
||||
validateString,
|
||||
validateInternalField,
|
||||
validateThisInternalField,
|
||||
} = require('internal/validators');
|
||||
|
||||
const binding = internalBinding('module_wrap');
|
||||
@ -162,17 +162,17 @@ class Module {
|
||||
}
|
||||
|
||||
get identifier() {
|
||||
validateInternalField(this, kWrap, 'Module');
|
||||
validateThisInternalField(this, kWrap, 'Module');
|
||||
return this[kWrap].url;
|
||||
}
|
||||
|
||||
get context() {
|
||||
validateInternalField(this, kWrap, 'Module');
|
||||
validateThisInternalField(this, kWrap, 'Module');
|
||||
return this[kContext];
|
||||
}
|
||||
|
||||
get namespace() {
|
||||
validateInternalField(this, kWrap, 'Module');
|
||||
validateThisInternalField(this, kWrap, 'Module');
|
||||
if (this[kWrap].getStatus() < kInstantiated) {
|
||||
throw new ERR_VM_MODULE_STATUS('must not be unlinked or linking');
|
||||
}
|
||||
@ -180,12 +180,12 @@ class Module {
|
||||
}
|
||||
|
||||
get status() {
|
||||
validateInternalField(this, kWrap, 'Module');
|
||||
validateThisInternalField(this, kWrap, 'Module');
|
||||
return STATUS_MAP[this[kWrap].getStatus()];
|
||||
}
|
||||
|
||||
get error() {
|
||||
validateInternalField(this, kWrap, 'Module');
|
||||
validateThisInternalField(this, kWrap, 'Module');
|
||||
if (this[kWrap].getStatus() !== kErrored) {
|
||||
throw new ERR_VM_MODULE_STATUS('must be errored');
|
||||
}
|
||||
@ -193,7 +193,7 @@ class Module {
|
||||
}
|
||||
|
||||
async link(linker) {
|
||||
validateInternalField(this, kWrap, 'Module');
|
||||
validateThisInternalField(this, kWrap, 'Module');
|
||||
validateFunction(linker, 'linker');
|
||||
if (this.status === 'linked') {
|
||||
throw new ERR_VM_MODULE_ALREADY_LINKED();
|
||||
@ -206,7 +206,7 @@ class Module {
|
||||
}
|
||||
|
||||
async evaluate(options = kEmptyObject) {
|
||||
validateInternalField(this, kWrap, 'Module');
|
||||
validateThisInternalField(this, kWrap, 'Module');
|
||||
validateObject(options, 'options');
|
||||
|
||||
let timeout = options.timeout;
|
||||
@ -229,7 +229,7 @@ class Module {
|
||||
}
|
||||
|
||||
[customInspectSymbol](depth, options) {
|
||||
validateInternalField(this, kWrap, 'Module');
|
||||
validateThisInternalField(this, kWrap, 'Module');
|
||||
if (typeof depth === 'number' && depth < 0)
|
||||
return this;
|
||||
|
||||
@ -350,7 +350,7 @@ class SourceTextModule extends Module {
|
||||
}
|
||||
|
||||
get dependencySpecifiers() {
|
||||
validateInternalField(this, kDependencySpecifiers, 'SourceTextModule');
|
||||
validateThisInternalField(this, kDependencySpecifiers, 'SourceTextModule');
|
||||
// TODO(legendecas): add a new getter to expose the import attributes as the value type
|
||||
// of [[RequestedModules]] is changed in https://tc39.es/proposal-import-attributes/#table-cyclic-module-fields.
|
||||
this[kDependencySpecifiers] ??= ObjectFreeze(
|
||||
@ -359,7 +359,7 @@ class SourceTextModule extends Module {
|
||||
}
|
||||
|
||||
get status() {
|
||||
validateInternalField(this, kDependencySpecifiers, 'SourceTextModule');
|
||||
validateThisInternalField(this, kDependencySpecifiers, 'SourceTextModule');
|
||||
if (this.#error !== kNoError) {
|
||||
return 'errored';
|
||||
}
|
||||
@ -370,7 +370,7 @@ class SourceTextModule extends Module {
|
||||
}
|
||||
|
||||
get error() {
|
||||
validateInternalField(this, kDependencySpecifiers, 'SourceTextModule');
|
||||
validateThisInternalField(this, kDependencySpecifiers, 'SourceTextModule');
|
||||
if (this.#error !== kNoError) {
|
||||
return this.#error;
|
||||
}
|
||||
@ -423,7 +423,7 @@ class SyntheticModule extends Module {
|
||||
}
|
||||
|
||||
setExport(name, value) {
|
||||
validateInternalField(this, kWrap, 'SyntheticModule');
|
||||
validateThisInternalField(this, kWrap, 'SyntheticModule');
|
||||
validateString(name, 'name');
|
||||
if (this[kWrap].getStatus() < kInstantiated) {
|
||||
throw new ERR_VM_MODULE_STATUS('must be linked');
|
||||
|
||||
Loading…
Reference in New Issue
Block a user