diff options
Diffstat (limited to 'ext')
-rw-r--r-- | ext/cache/01_cache.js | 4 | ||||
-rw-r--r-- | ext/crypto/00_crypto.js | 6 | ||||
-rw-r--r-- | ext/fetch/20_headers.js | 2 | ||||
-rw-r--r-- | ext/fetch/21_formdata.js | 2 | ||||
-rw-r--r-- | ext/fetch/23_request.js | 2 | ||||
-rw-r--r-- | ext/fetch/23_response.js | 2 | ||||
-rw-r--r-- | ext/url/00_url.js | 4 | ||||
-rw-r--r-- | ext/url/01_urlpattern.js | 2 | ||||
-rw-r--r-- | ext/web/01_dom_exception.js | 2 | ||||
-rw-r--r-- | ext/web/02_event.js | 2 | ||||
-rw-r--r-- | ext/web/03_abort_signal.js | 4 | ||||
-rw-r--r-- | ext/web/06_streams.js | 26 | ||||
-rw-r--r-- | ext/web/08_text_encoding.js | 8 | ||||
-rw-r--r-- | ext/web/09_file.js | 4 | ||||
-rw-r--r-- | ext/web/10_filereader.js | 2 | ||||
-rw-r--r-- | ext/web/13_message_port.js | 4 | ||||
-rw-r--r-- | ext/web/14_compression.js | 4 | ||||
-rw-r--r-- | ext/web/15_performance.js | 8 | ||||
-rw-r--r-- | ext/webidl/00_webidl.js | 28 | ||||
-rw-r--r-- | ext/webidl/internal.d.ts | 2 | ||||
-rw-r--r-- | ext/websocket/01_websocket.js | 2 |
21 files changed, 63 insertions, 57 deletions
diff --git a/ext/cache/01_cache.js b/ext/cache/01_cache.js index 99daa4d42..e64178d89 100644 --- a/ext/cache/01_cache.js +++ b/ext/cache/01_cache.js @@ -277,8 +277,8 @@ class Cache { } } -webidl.configurePrototype(CacheStorage); -webidl.configurePrototype(Cache); +webidl.configureInterface(CacheStorage); +webidl.configureInterface(Cache); const CacheStoragePrototype = CacheStorage.prototype; const CachePrototype = Cache.prototype; diff --git a/ext/crypto/00_crypto.js b/ext/crypto/00_crypto.js index f262e43d9..de4ad07e1 100644 --- a/ext/crypto/00_crypto.js +++ b/ext/crypto/00_crypto.js @@ -361,7 +361,7 @@ class CryptoKey { } } -webidl.configurePrototype(CryptoKey); +webidl.configureInterface(CryptoKey); const CryptoKeyPrototype = CryptoKey.prototype; /** @@ -4671,7 +4671,7 @@ async function encrypt(normalizedAlgorithm, key, data) { } } -webidl.configurePrototype(SubtleCrypto); +webidl.configureInterface(SubtleCrypto); const subtle = webidl.createBranded(SubtleCrypto); class Crypto { @@ -4734,7 +4734,7 @@ class Crypto { } } -webidl.configurePrototype(Crypto); +webidl.configureInterface(Crypto); const CryptoPrototype = Crypto.prototype; const crypto = webidl.createBranded(Crypto); diff --git a/ext/fetch/20_headers.js b/ext/fetch/20_headers.js index a004daa89..b99758de5 100644 --- a/ext/fetch/20_headers.js +++ b/ext/fetch/20_headers.js @@ -453,7 +453,7 @@ class Headers { webidl.mixinPairIterable("Headers", Headers, _iterableHeaders, 0, 1); -webidl.configurePrototype(Headers); +webidl.configureInterface(Headers); const HeadersPrototype = Headers.prototype; webidl.converters["HeadersInit"] = (V, prefix, context, opts) => { diff --git a/ext/fetch/21_formdata.js b/ext/fetch/21_formdata.js index d905ec7c4..84d31898e 100644 --- a/ext/fetch/21_formdata.js +++ b/ext/fetch/21_formdata.js @@ -266,7 +266,7 @@ class FormData { webidl.mixinPairIterable("FormData", FormData, entryList, "name", "value"); -webidl.configurePrototype(FormData); +webidl.configureInterface(FormData); const FormDataPrototype = FormData.prototype; const ESCAPE_FILENAME_PATTERN = new SafeRegExp(/\r?\n|\r/g); diff --git a/ext/fetch/23_request.js b/ext/fetch/23_request.js index c09bd4880..a59bfb29d 100644 --- a/ext/fetch/23_request.js +++ b/ext/fetch/23_request.js @@ -497,7 +497,7 @@ class Request { } } -webidl.configurePrototype(Request); +webidl.configureInterface(Request); const RequestPrototype = Request.prototype; mixinBody(RequestPrototype, _body, _mimeType); diff --git a/ext/fetch/23_response.js b/ext/fetch/23_response.js index 73a90166d..83fad403a 100644 --- a/ext/fetch/23_response.js +++ b/ext/fetch/23_response.js @@ -426,7 +426,7 @@ class Response { } } -webidl.configurePrototype(Response); +webidl.configureInterface(Response); ObjectDefineProperties(Response, { json: { enumerable: true }, redirect: { enumerable: true }, diff --git a/ext/url/00_url.js b/ext/url/00_url.js index 65cde2ce2..ce366a27a 100644 --- a/ext/url/00_url.js +++ b/ext/url/00_url.js @@ -324,7 +324,7 @@ class URLSearchParams { webidl.mixinPairIterable("URLSearchParams", URLSearchParams, _list, 0, 1); -webidl.configurePrototype(URLSearchParams); +webidl.configureInterface(URLSearchParams); const URLSearchParamsPrototype = URLSearchParams.prototype; webidl.converters["URLSearchParams"] = webidl.createInterfaceConverter( @@ -806,7 +806,7 @@ class URL { } } -webidl.configurePrototype(URL); +webidl.configureInterface(URL); const URLPrototype = URL.prototype; /** diff --git a/ext/url/01_urlpattern.js b/ext/url/01_urlpattern.js index e6d21e49d..0cabccc1b 100644 --- a/ext/url/01_urlpattern.js +++ b/ext/url/01_urlpattern.js @@ -238,7 +238,7 @@ class URLPattern { } } -webidl.configurePrototype(URLPattern); +webidl.configureInterface(URLPattern); const URLPatternPrototype = URLPattern.prototype; webidl.converters.URLPatternInit = webidl diff --git a/ext/web/01_dom_exception.js b/ext/web/01_dom_exception.js index 54d47beaf..d876d90a6 100644 --- a/ext/web/01_dom_exception.js +++ b/ext/web/01_dom_exception.js @@ -170,7 +170,7 @@ ObjectDefineProperty(DOMException.prototype, "__callSiteEvals", { ObjectSetPrototypeOf(DOMException.prototype, ErrorPrototype); -webidl.configurePrototype(DOMException); +webidl.configureInterface(DOMException); const DOMExceptionPrototype = DOMException.prototype; const entries = ObjectEntries({ diff --git a/ext/web/02_event.js b/ext/web/02_event.js index 80dc4ffc7..8831d37fb 100644 --- a/ext/web/02_event.js +++ b/ext/web/02_event.js @@ -1044,7 +1044,7 @@ class EventTarget { } } -webidl.configurePrototype(EventTarget); +webidl.configureInterface(EventTarget); const EventTargetPrototype = EventTarget.prototype; defineEnumerableProps(EventTarget, [ diff --git a/ext/web/03_abort_signal.js b/ext/web/03_abort_signal.js index 2cc64189b..9b5eb51ad 100644 --- a/ext/web/03_abort_signal.js +++ b/ext/web/03_abort_signal.js @@ -152,7 +152,7 @@ class AbortSignal extends EventTarget { } defineEventHandler(AbortSignal.prototype, "abort"); -webidl.configurePrototype(AbortSignal); +webidl.configureInterface(AbortSignal); const AbortSignalPrototype = AbortSignal.prototype; class AbortController { @@ -173,7 +173,7 @@ class AbortController { } } -webidl.configurePrototype(AbortController); +webidl.configureInterface(AbortController); const AbortControllerPrototype = AbortController.prototype; webidl.converters["AbortSignal"] = webidl.createInterfaceConverter( diff --git a/ext/web/06_streams.js b/ext/web/06_streams.js index 7f43d3fc2..9c6191fce 100644 --- a/ext/web/06_streams.js +++ b/ext/web/06_streams.js @@ -4866,7 +4866,7 @@ class ByteLengthQueuingStrategy { } } -webidl.configurePrototype(ByteLengthQueuingStrategy); +webidl.configureInterface(ByteLengthQueuingStrategy); const ByteLengthQueuingStrategyPrototype = ByteLengthQueuingStrategy.prototype; /** @type {WeakMap<typeof globalThis, (chunk: ArrayBufferView) => number>} */ @@ -4920,7 +4920,7 @@ class CountQueuingStrategy { } } -webidl.configurePrototype(CountQueuingStrategy); +webidl.configureInterface(CountQueuingStrategy); const CountQueuingStrategyPrototype = CountQueuingStrategy.prototype; /** @type {WeakMap<typeof globalThis, () => 1>} */ @@ -5254,7 +5254,7 @@ ObjectDefineProperty(ReadableStream.prototype, SymbolAsyncIterator, { configurable: true, }); -webidl.configurePrototype(ReadableStream); +webidl.configureInterface(ReadableStream); const ReadableStreamPrototype = ReadableStream.prototype; function errorReadableStream(stream, e) { @@ -5354,7 +5354,7 @@ class ReadableStreamDefaultReader { } } -webidl.configurePrototype(ReadableStreamDefaultReader); +webidl.configureInterface(ReadableStreamDefaultReader); const ReadableStreamDefaultReaderPrototype = ReadableStreamDefaultReader.prototype; @@ -5484,7 +5484,7 @@ class ReadableStreamBYOBReader { } } -webidl.configurePrototype(ReadableStreamBYOBReader); +webidl.configureInterface(ReadableStreamBYOBReader); const ReadableStreamBYOBReaderPrototype = ReadableStreamBYOBReader.prototype; class ReadableStreamBYOBRequest { @@ -5564,7 +5564,7 @@ class ReadableStreamBYOBRequest { } } -webidl.configurePrototype(ReadableStreamBYOBRequest); +webidl.configureInterface(ReadableStreamBYOBRequest); const ReadableStreamBYOBRequestPrototype = ReadableStreamBYOBRequest.prototype; class ReadableByteStreamController { @@ -5761,7 +5761,7 @@ class ReadableByteStreamController { } } -webidl.configurePrototype(ReadableByteStreamController); +webidl.configureInterface(ReadableByteStreamController); const ReadableByteStreamControllerPrototype = ReadableByteStreamController.prototype; @@ -5884,7 +5884,7 @@ class ReadableStreamDefaultController { } } -webidl.configurePrototype(ReadableStreamDefaultController); +webidl.configureInterface(ReadableStreamDefaultController); const ReadableStreamDefaultControllerPrototype = ReadableStreamDefaultController.prototype; @@ -6002,7 +6002,7 @@ class TransformStream { } } -webidl.configurePrototype(TransformStream); +webidl.configureInterface(TransformStream); const TransformStreamPrototype = TransformStream.prototype; /** @template O */ @@ -6069,7 +6069,7 @@ class TransformStreamDefaultController { } } -webidl.configurePrototype(TransformStreamDefaultController); +webidl.configureInterface(TransformStreamDefaultController); const TransformStreamDefaultControllerPrototype = TransformStreamDefaultController.prototype; @@ -6204,7 +6204,7 @@ class WritableStream { } } -webidl.configurePrototype(WritableStream); +webidl.configureInterface(WritableStream); const WritableStreamPrototype = WritableStream.prototype; /** @template W */ @@ -6350,7 +6350,7 @@ class WritableStreamDefaultWriter { } } -webidl.configurePrototype(WritableStreamDefaultWriter); +webidl.configureInterface(WritableStreamDefaultWriter); const WritableStreamDefaultWriterPrototype = WritableStreamDefaultWriter.prototype; @@ -6428,7 +6428,7 @@ class WritableStreamDefaultController { } } -webidl.configurePrototype(WritableStreamDefaultController); +webidl.configureInterface(WritableStreamDefaultController); const WritableStreamDefaultControllerPrototype = WritableStreamDefaultController.prototype; diff --git a/ext/web/08_text_encoding.js b/ext/web/08_text_encoding.js index e7e535f90..45dbad538 100644 --- a/ext/web/08_text_encoding.js +++ b/ext/web/08_text_encoding.js @@ -192,7 +192,7 @@ class TextDecoder { } } -webidl.configurePrototype(TextDecoder); +webidl.configureInterface(TextDecoder); const TextDecoderPrototype = TextDecoder.prototype; class TextEncoder { @@ -251,7 +251,7 @@ class TextEncoder { const encodeIntoBuf = new Uint32Array(2); -webidl.configurePrototype(TextEncoder); +webidl.configureInterface(TextEncoder); const TextEncoderPrototype = TextEncoder.prototype; class TextDecoderStream { @@ -336,7 +336,7 @@ class TextDecoderStream { } } -webidl.configurePrototype(TextDecoderStream); +webidl.configureInterface(TextDecoderStream); const TextDecoderStreamPrototype = TextDecoderStream.prototype; class TextEncoderStream { @@ -409,7 +409,7 @@ class TextEncoderStream { } } -webidl.configurePrototype(TextEncoderStream); +webidl.configureInterface(TextEncoderStream); const TextEncoderStreamPrototype = TextEncoderStream.prototype; webidl.converters.TextDecoderOptions = webidl.createDictionaryConverter( diff --git a/ext/web/09_file.js b/ext/web/09_file.js index fd0451438..30b91c053 100644 --- a/ext/web/09_file.js +++ b/ext/web/09_file.js @@ -428,7 +428,7 @@ class Blob { } } -webidl.configurePrototype(Blob); +webidl.configureInterface(Blob); const BlobPrototype = Blob.prototype; webidl.converters["Blob"] = webidl.createInterfaceConverter( @@ -549,7 +549,7 @@ class File extends Blob { } } -webidl.configurePrototype(File); +webidl.configureInterface(File); const FilePrototype = File.prototype; webidl.converters["FilePropertyBag"] = webidl.createDictionaryConverter( diff --git a/ext/web/10_filereader.js b/ext/web/10_filereader.js index fe5dbb915..f7b88669b 100644 --- a/ext/web/10_filereader.js +++ b/ext/web/10_filereader.js @@ -432,7 +432,7 @@ class FileReader extends EventTarget { } } -webidl.configurePrototype(FileReader); +webidl.configureInterface(FileReader); const FileReaderPrototype = FileReader.prototype; ObjectDefineProperty(FileReader, "EMPTY", { diff --git a/ext/web/13_message_port.js b/ext/web/13_message_port.js index ffbc48812..4b0404ab6 100644 --- a/ext/web/13_message_port.js +++ b/ext/web/13_message_port.js @@ -64,7 +64,7 @@ class MessageChannel { } } -webidl.configurePrototype(MessageChannel); +webidl.configureInterface(MessageChannel); const MessageChannelPrototype = MessageChannel.prototype; const _id = Symbol("id"); @@ -188,7 +188,7 @@ defineEventHandler(MessagePort.prototype, "message", function (self) { }); defineEventHandler(MessagePort.prototype, "messageerror"); -webidl.configurePrototype(MessagePort); +webidl.configureInterface(MessagePort); const MessagePortPrototype = MessagePort.prototype; /** diff --git a/ext/web/14_compression.js b/ext/web/14_compression.js index 2ba7746bd..1b6dd4964 100644 --- a/ext/web/14_compression.js +++ b/ext/web/14_compression.js @@ -62,7 +62,7 @@ class CompressionStream { } } -webidl.configurePrototype(CompressionStream); +webidl.configureInterface(CompressionStream); const CompressionStreamPrototype = CompressionStream.prototype; class DecompressionStream { @@ -110,7 +110,7 @@ function maybeEnqueue(controller, output) { } } -webidl.configurePrototype(DecompressionStream); +webidl.configureInterface(DecompressionStream); const DecompressionStreamPrototype = DecompressionStream.prototype; export { CompressionStream, DecompressionStream }; diff --git a/ext/web/15_performance.js b/ext/web/15_performance.js index 72f4d3a7e..9ec2cd376 100644 --- a/ext/web/15_performance.js +++ b/ext/web/15_performance.js @@ -212,7 +212,7 @@ class PerformanceEntry { })); } } -webidl.configurePrototype(PerformanceEntry); +webidl.configureInterface(PerformanceEntry); const PerformanceEntryPrototype = PerformanceEntry.prototype; const _detail = Symbol("[[detail]]"); @@ -279,7 +279,7 @@ class PerformanceMark extends PerformanceEntry { })); } } -webidl.configurePrototype(PerformanceMark); +webidl.configureInterface(PerformanceMark); const PerformanceMarkPrototype = PerformanceMark.prototype; class PerformanceMeasure extends PerformanceEntry { [_detail] = null; @@ -338,7 +338,7 @@ class PerformanceMeasure extends PerformanceEntry { })); } } -webidl.configurePrototype(PerformanceMeasure); +webidl.configureInterface(PerformanceMeasure); const PerformanceMeasurePrototype = PerformanceMeasure.prototype; class Performance extends EventTarget { constructor(key = null) { @@ -577,7 +577,7 @@ class Performance extends EventTarget { })); } } -webidl.configurePrototype(Performance); +webidl.configureInterface(Performance); const PerformancePrototype = Performance.prototype; webidl.converters["Performance"] = webidl.createInterfaceConverter( diff --git a/ext/webidl/00_webidl.js b/ext/webidl/00_webidl.js index a532c5ac4..c3b00286f 100644 --- a/ext/webidl/00_webidl.js +++ b/ext/webidl/00_webidl.js @@ -1138,36 +1138,42 @@ function mixinPairIterable(name, prototype, dataSymbol, keyKey, valueKey) { return ObjectDefineProperties(prototype.prototype, properties); } -function configurePrototype(prototype) { - const descriptors = ObjectGetOwnPropertyDescriptors(prototype.prototype); +function configureInterface(interface_) { + configureProperties(interface_); + configureProperties(interface_.prototype); + ObjectDefineProperty(interface_.prototype, SymbolToStringTag, { + value: interface_.name, + enumerable: false, + configurable: true, + writable: false, + }); +} + +function configureProperties(obj) { + const descriptors = ObjectGetOwnPropertyDescriptors(obj); for (const key in descriptors) { if (!ObjectHasOwn(descriptors, key)) { continue; } if (key === "constructor") continue; + if (key === "prototype") continue; const descriptor = descriptors[key]; if ( ReflectHas(descriptor, "value") && typeof descriptor.value === "function" ) { - ObjectDefineProperty(prototype.prototype, key, { + ObjectDefineProperty(obj, key, { enumerable: true, writable: true, configurable: true, }); } else if (ReflectHas(descriptor, "get")) { - ObjectDefineProperty(prototype.prototype, key, { + ObjectDefineProperty(obj, key, { enumerable: true, configurable: true, }); } } - ObjectDefineProperty(prototype.prototype, SymbolToStringTag, { - value: prototype.name, - enumerable: false, - configurable: true, - writable: false, - }); } const setlikeInner = Symbol("[[set]]"); @@ -1275,7 +1281,7 @@ function setlike(obj, objPrototype, readonly) { export { assertBranded, brand, - configurePrototype, + configureInterface, converters, createBranded, createDictionaryConverter, diff --git a/ext/webidl/internal.d.ts b/ext/webidl/internal.d.ts index 38f176ab2..7f1f68282 100644 --- a/ext/webidl/internal.d.ts +++ b/ext/webidl/internal.d.ts @@ -543,7 +543,7 @@ declare module "ext:deno_webidl/00_webidl.js" { /** * Configure prototype properties enumerability / writability / configurability. */ - function configurePrototype(prototype: any); + function configureInterface(prototype: any); /** * Get the WebIDL / ES type of a value. diff --git a/ext/websocket/01_websocket.js b/ext/websocket/01_websocket.js index 3417eff67..752ff93bd 100644 --- a/ext/websocket/01_websocket.js +++ b/ext/websocket/01_websocket.js @@ -570,7 +570,7 @@ defineEventHandler(WebSocket.prototype, "error"); defineEventHandler(WebSocket.prototype, "close"); defineEventHandler(WebSocket.prototype, "open"); -webidl.configurePrototype(WebSocket); +webidl.configureInterface(WebSocket); const WebSocketPrototype = WebSocket.prototype; export { |