From c56459bd3a7f4f2a6ba9bacb4e3a04bdbe75b458 Mon Sep 17 00:00:00 2001 From: Kagami Sascha Rosylight Date: Sun, 25 Oct 2020 16:51:30 +0100 Subject: [PATCH 1/3] Trim line ends of comments --- baselines/dom.generated.d.ts | 268 ++++++++++---------- baselines/dom.iterable.generated.d.ts | 2 +- baselines/webworker.generated.d.ts | 126 ++++----- baselines/webworker.iterable.generated.d.ts | 2 +- src/widlprocess.ts | 6 +- 5 files changed, 202 insertions(+), 202 deletions(-) diff --git a/baselines/dom.generated.d.ts b/baselines/dom.generated.d.ts index 07b47aaac..8c46cbc03 100644 --- a/baselines/dom.generated.d.ts +++ b/baselines/dom.generated.d.ts @@ -3315,7 +3315,7 @@ interface CanvasFilters { interface CanvasGradient { /** * Adds a color stop with the given color to the gradient at the given offset. 0.0 is the offset at one end of the gradient, 1.0 is the offset at the other end. - * + * * Throws an "IndexSizeError" DOMException if the offset is out of range. Throws a "SyntaxError" DOMException if the color cannot be parsed. */ addColorStop(offset: number, color: string): void; @@ -3482,13 +3482,13 @@ declare var CharacterData: { interface ChildNode extends Node { /** * Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - * + * * Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. */ after(...nodes: (Node | string)[]): void; /** * Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - * + * * Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. */ before(...nodes: (Node | string)[]): void; @@ -3498,7 +3498,7 @@ interface ChildNode extends Node { remove(): void; /** * Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - * + * * Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. */ replaceWith(...nodes: (Node | string)[]): void; @@ -3916,11 +3916,11 @@ declare var DOMMatrixReadOnly: { interface DOMParser { /** * Parses string using either the HTML or XML parser, according to type, and returns the resulting Document. type can be "text/html" (which will invoke the HTML parser), or any of "text/xml", "application/xml", "application/xhtml+xml", or "image/svg+xml" (which will invoke the XML parser). - * + * * For the XML parser, if string cannot be parsed, then the returned Document will contain elements describing the resulting error. - * + * * Note that script elements are not evaluated during parsing, and the resulting document's encoding will always be UTF-8. - * + * * Values other than the above for type will cause a TypeError exception to be thrown. */ parseFromString(string: string, type: DOMParserSupportedType): Document; @@ -4072,16 +4072,16 @@ interface DOMTokenList { readonly length: number; /** * Returns the associated set as string. - * + * * Can be set, to change the associated attribute. */ value: string; toString(): string; /** * Adds all arguments passed, except those already present. - * + * * Throws a "SyntaxError" DOMException if one of the arguments is the empty string. - * + * * Throws an "InvalidCharacterError" DOMException if one of the arguments contains any ASCII whitespace. */ add(...tokens: string[]): void; @@ -4095,35 +4095,35 @@ interface DOMTokenList { item(index: number): string | null; /** * Removes arguments passed, if they are present. - * + * * Throws a "SyntaxError" DOMException if one of the arguments is the empty string. - * + * * Throws an "InvalidCharacterError" DOMException if one of the arguments contains any ASCII whitespace. */ remove(...tokens: string[]): void; /** * Replaces token with newToken. - * + * * Returns true if token was replaced with newToken, and false otherwise. - * + * * Throws a "SyntaxError" DOMException if one of the arguments is the empty string. - * + * * Throws an "InvalidCharacterError" DOMException if one of the arguments contains any ASCII whitespace. */ replace(oldToken: string, newToken: string): void; /** * Returns true if token is in the associated attribute's supported tokens. Returns false otherwise. - * + * * Throws a TypeError if the associated attribute has no supported tokens defined. */ supports(token: string): boolean; /** * If force is not given, "toggles" token, removing it if it's present and adding it if it's not present. If force is true, adds token (same as add()). If force is false, removes token (same as remove()). - * + * * Returns true if token is now present, and false otherwise. - * + * * Throws a "SyntaxError" DOMException if token is empty. - * + * * Throws an "InvalidCharacterError" DOMException if token contains any spaces. */ toggle(token: string, force?: boolean): boolean; @@ -4153,17 +4153,17 @@ declare var DataCue: { interface DataTransfer { /** * Returns the kind of operation that is currently selected. If the kind of operation isn't one of those that is allowed by the effectAllowed attribute, then the operation will fail. - * + * * Can be set, to change the selected operation. - * + * * The possible values are "none", "copy", "link", and "move". */ dropEffect: "none" | "copy" | "link" | "move"; /** * Returns the kinds of operations that are to be allowed. - * + * * Can be set (during the dragstart event), to change the allowed operations. - * + * * The possible values are "none", "copy", "copyLink", "copyMove", "link", "linkMove", "move", "all", and "uninitialized", */ effectAllowed: "none" | "copy" | "copyLink" | "copyMove" | "link" | "linkMove" | "move" | "all" | "uninitialized"; @@ -4434,15 +4434,15 @@ interface Document extends Node, DocumentAndElementEventHandlers, DocumentOrShad readonly contentType: string; /** * Returns the HTTP cookies that apply to the Document. If there are no cookies or cookies can't be applied to this resource, the empty string will be returned. - * + * * Can be set, to add a new cookie to the element's set of HTTP cookies. - * + * * If the contents are sandboxed into a unique origin (e.g. in an iframe with the sandbox attribute), a "SecurityError" DOMException will be thrown on getting and setting. */ cookie: string; /** * Returns the script element, or the SVG script element, that is currently executing, as long as the element represents a classic script. In the case of reentrant script execution, returns the one that most recently started executing amongst those that have not yet finished executing. - * + * * Returns null if the Document is not currently executing a script or SVG script element (e.g., because the running script is an event handler, or a timeout), or if the currently executing script or SVG script element represents a module script. */ readonly currentScript: HTMLOrSVGScriptElement | null; @@ -4565,7 +4565,7 @@ interface Document extends Node, DocumentAndElementEventHandlers, DocumentOrShad vlinkColor: string; /** * Moves node from another document and returns it. - * + * * If node is a document, throws a "NotSupportedError" DOMException or, if node is a shadow root, throws a "HierarchyRequestError" DOMException. */ adoptNode(source: T): T; @@ -4609,17 +4609,17 @@ interface Document extends Node, DocumentAndElementEventHandlers, DocumentOrShad createElement(tagName: string, options?: ElementCreationOptions): HTMLElement; /** * Returns an element with namespace namespace. Its namespace prefix will be everything before ":" (U+003E) in qualifiedName or null. Its local name will be everything after ":" (U+003E) in qualifiedName or qualifiedName. - * + * * If localName does not match the Name production an "InvalidCharacterError" DOMException will be thrown. - * + * * If one of the following conditions is true a "NamespaceError" DOMException will be thrown: - * + * * localName does not match the QName production. * Namespace prefix is not null and namespace is the empty string. * Namespace prefix is "xml" and namespace is not the XML namespace. * qualifiedName or namespace prefix is "xmlns" and namespace is not the XMLNS namespace. * namespace is the XMLNS namespace and neither qualifiedName nor namespace prefix is "xmlns". - * + * * When supplied, options's is can be used to create a customized built-in element. */ createElementNS(namespaceURI: "http://www.w3.org/1999/xhtml", qualifiedName: string): HTMLElement; @@ -4780,11 +4780,11 @@ interface Document extends Node, DocumentAndElementEventHandlers, DocumentOrShad getElementsByTagName(qualifiedName: string): HTMLCollectionOf; /** * If namespace and localName are "*" returns a HTMLCollection of all descendant elements. - * + * * If only namespace is "*" returns a HTMLCollection of all descendant elements whose local name is localName. - * + * * If only localName is "*" returns a HTMLCollection of all descendant elements whose namespace is namespace. - * + * * Otherwise, returns a HTMLCollection of all descendant elements whose namespace is namespace and local name is localName. */ getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollectionOf; @@ -4800,7 +4800,7 @@ interface Document extends Node, DocumentAndElementEventHandlers, DocumentOrShad hasFocus(): boolean; /** * Returns a copy of node. If deep is true, the copy also includes the node's descendants. - * + * * If node is a document or a shadow root, throws a "NotSupportedError" DOMException. */ importNode(importedNode: T, deep: boolean): T; @@ -5187,7 +5187,7 @@ interface Element extends Node, Animatable, ChildNode, InnerHTML, NonDocumentTyp removeAttributeNode(attr: Attr): Attr; /** * Displays element fullscreen and resolves promise when done. - * + * * When supplied, options's navigationUI member indicates whether showing navigation UI while in fullscreen is preferred or not. If set to "show", navigation simplicity is preferred over screen space, and if set to "hide", more screen space is preferred. User agents are always free to honor user preference over the application's. The default value "auto" indicates no application preference. */ requestFullscreen(options?: FullscreenOptions): Promise; @@ -5212,7 +5212,7 @@ interface Element extends Node, Animatable, ChildNode, InnerHTML, NonDocumentTyp setPointerCapture(pointerId: number): void; /** * If force is not given, "toggles" qualifiedName, removing it if it is present and adding it if it is not present. If force is true, adds qualifiedName. If force is false, removes qualifiedName. - * + * * Returns true if qualifiedName is now present, and false otherwise. */ toggleAttribute(qualifiedName: string, force?: boolean): boolean; @@ -5382,15 +5382,15 @@ declare var EventSource: { interface EventTarget { /** * Appends an event listener for events whose type attribute value is type. The callback argument sets the callback that will be invoked when the event is dispatched. - * + * * The options argument sets listener-specific options. For compatibility this can be a boolean, in which case the method behaves exactly as if the value was specified as options's capture. - * + * * When set to true, options's capture prevents callback from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. When false (or not present), callback will not be invoked when event's eventPhase attribute value is CAPTURING_PHASE. Either way, callback will be invoked if event's eventPhase attribute value is AT_TARGET. - * + * * When set to true, options's passive indicates that the callback will not cancel the event by invoking preventDefault(). This is used to enable performance optimizations described in § 2.8 Observing event listeners. - * + * * When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - * + * * The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. */ addEventListener(type: string, listener: EventListenerOrEventListenerObject | null, options?: boolean | AddEventListenerOptions): void; @@ -5629,16 +5629,16 @@ interface GenericTransformStream { readonly readable: ReadableStream; /** * Returns a writable stream which accepts [AllowShared] BufferSource chunks and runs them through encoding's decoder before making them available to readable. - * + * * Typically this will be used via the pipeThrough() method on a ReadableStream source. - * + * * ``` * var decoder = new TextDecoderStream(encoding); * byteReadable * .pipeThrough(decoder) * .pipeTo(textWritable); * ``` - * + * * If the error mode is "fatal" and encoding's decoder returns error, both readable and writable will be errored with a TypeError. */ readonly writable: WritableStream; @@ -6070,9 +6070,9 @@ interface HTMLAllCollection { item(nameOrIndex?: string): HTMLCollection | Element | null; /** * Returns the item with ID or name name from the collection. - * + * * If there are multiple matching items, then an HTMLCollection object containing all those elements is returned. - * + * * Only button, form, iframe, input, map, meta, object, select, and textarea elements can have a name for the purpose of this method; their name is given by the value of their name attribute. */ namedItem(name: string): HTMLCollection | Element | null; @@ -6733,7 +6733,7 @@ declare var HTMLFontElement: { interface HTMLFormControlsCollection extends HTMLCollectionBase { /** * Returns the item with ID or name name from the collection. - * + * * If there are multiple matching items, then a RadioNodeList object containing all those elements is returned. */ namedItem(name: string): RadioNodeList | Element | null; @@ -7982,25 +7982,25 @@ declare var HTMLOptionElement: { interface HTMLOptionsCollection extends HTMLCollectionOf { /** * Returns the number of elements in the collection. - * + * * When set to a smaller number, truncates the number of option elements in the corresponding container. - * + * * When set to a greater number, adds new blank option elements to that container. */ length: number; /** * Returns the index of the first selected item, if any, or −1 if there is no selected item. - * + * * Can be set, to change the selection. */ selectedIndex: number; /** * Inserts element before the node given by before. - * + * * The before argument can be a number, in which case element is inserted before the item with that number, or an element from the collection, in which case element is inserted before that element. - * + * * If before is omitted, null, or a number out of range, then element will be added at the end of the list. - * + * * This method will throw a "HierarchyRequestError" DOMException if element is an ancestor of the element into which it is to be inserted. */ add(element: HTMLOptionElement | HTMLOptGroupElement, before?: HTMLElement | number | null): void; @@ -9079,15 +9079,15 @@ interface IDBCursor { continuePrimaryKey(key: IDBValidKey, primaryKey: IDBValidKey): void; /** * Delete the record pointed at by the cursor with a new value. - * + * * If successful, request's result will be undefined. */ delete(): IDBRequest; /** * Updated the record pointed at by the cursor with a new value. - * + * * Throws a "DataError" DOMException if the effective object store uses in-line keys and the key would have changed. - * + * * If successful, request's result will be the record's key. */ update(value: any): IDBRequest; @@ -9142,13 +9142,13 @@ interface IDBDatabase extends EventTarget { close(): void; /** * Creates a new object store with the given name and options and returns a new IDBObjectStore. - * + * * Throws a "InvalidStateError" DOMException if not called within an upgrade transaction. */ createObjectStore(name: string, options?: IDBObjectStoreParameters): IDBObjectStore; /** * Deletes the object store with the given name. - * + * * Throws a "InvalidStateError" DOMException if not called within an upgrade transaction. */ deleteObjectStore(name: string): void; @@ -9171,7 +9171,7 @@ declare var IDBDatabase: { interface IDBFactory { /** * Compares two values as keys. Returns -1 if key1 precedes key2, 1 if key2 precedes key1, and 0 if the keys are equal. - * + * * Throws a "DataError" DOMException if either input is not a valid key. */ cmp(first: any, second: any): number; @@ -9205,43 +9205,43 @@ interface IDBIndex { readonly unique: boolean; /** * Retrieves the number of records matching the given key or key range in query. - * + * * If successful, request's result will be the count. */ count(key?: IDBValidKey | IDBKeyRange): IDBRequest; /** * Retrieves the value of the first record matching the given key or key range in query. - * + * * If successful, request's result will be the value, or undefined if there was no matching record. */ get(key: IDBValidKey | IDBKeyRange): IDBRequest; /** * Retrieves the values of the records matching the given key or key range in query (up to count if given). - * + * * If successful, request's result will be an Array of the values. */ getAll(query?: IDBValidKey | IDBKeyRange | null, count?: number): IDBRequest; /** * Retrieves the keys of records matching the given key or key range in query (up to count if given). - * + * * If successful, request's result will be an Array of the keys. */ getAllKeys(query?: IDBValidKey | IDBKeyRange | null, count?: number): IDBRequest; /** * Retrieves the key of the first record matching the given key or key range in query. - * + * * If successful, request's result will be the key, or undefined if there was no matching record. */ getKey(key: IDBValidKey | IDBKeyRange): IDBRequest; /** * Opens a cursor over the records matching query, ordered by direction. If query is null, all records in index are matched. - * + * * If successful, request's result will be an IDBCursorWithValue, or null if there were no matching records. */ openCursor(query?: IDBValidKey | IDBKeyRange | null, direction?: IDBCursorDirection): IDBRequest; /** * Opens a cursor with key only flag set over the records matching query, ordered by direction. If query is null, all records in index are matched. - * + * * If successful, request's result will be an IDBCursor, or null if there were no matching records. */ openKeyCursor(query?: IDBValidKey | IDBKeyRange | null, direction?: IDBCursorDirection): IDBRequest; @@ -9321,88 +9321,88 @@ interface IDBObjectStore { readonly transaction: IDBTransaction; /** * Adds or updates a record in store with the given value and key. - * + * * If the store uses in-line keys and key is specified a "DataError" DOMException will be thrown. - * + * * If put() is used, any existing record with the key will be replaced. If add() is used, and if a record with the key already exists the request will fail, with request's error set to a "ConstraintError" DOMException. - * + * * If successful, request's result will be the record's key. */ add(value: any, key?: IDBValidKey): IDBRequest; /** * Deletes all records in store. - * + * * If successful, request's result will be undefined. */ clear(): IDBRequest; /** * Retrieves the number of records matching the given key or key range in query. - * + * * If successful, request's result will be the count. */ count(key?: IDBValidKey | IDBKeyRange): IDBRequest; /** * Creates a new index in store with the given name, keyPath and options and returns a new IDBIndex. If the keyPath and options define constraints that cannot be satisfied with the data already in store the upgrade transaction will abort with a "ConstraintError" DOMException. - * + * * Throws an "InvalidStateError" DOMException if not called within an upgrade transaction. */ createIndex(name: string, keyPath: string | string[], options?: IDBIndexParameters): IDBIndex; /** * Deletes records in store with the given key or in the given key range in query. - * + * * If successful, request's result will be undefined. */ delete(key: IDBValidKey | IDBKeyRange): IDBRequest; /** * Deletes the index in store with the given name. - * + * * Throws an "InvalidStateError" DOMException if not called within an upgrade transaction. */ deleteIndex(name: string): void; /** * Retrieves the value of the first record matching the given key or key range in query. - * + * * If successful, request's result will be the value, or undefined if there was no matching record. */ get(query: IDBValidKey | IDBKeyRange): IDBRequest; /** * Retrieves the values of the records matching the given key or key range in query (up to count if given). - * + * * If successful, request's result will be an Array of the values. */ getAll(query?: IDBValidKey | IDBKeyRange | null, count?: number): IDBRequest; /** * Retrieves the keys of records matching the given key or key range in query (up to count if given). - * + * * If successful, request's result will be an Array of the keys. */ getAllKeys(query?: IDBValidKey | IDBKeyRange | null, count?: number): IDBRequest; /** * Retrieves the key of the first record matching the given key or key range in query. - * + * * If successful, request's result will be the key, or undefined if there was no matching record. */ getKey(query: IDBValidKey | IDBKeyRange): IDBRequest; index(name: string): IDBIndex; /** * Opens a cursor over the records matching query, ordered by direction. If query is null, all records in store are matched. - * + * * If successful, request's result will be an IDBCursorWithValue pointing at the first matching record, or null if there were no matching records. */ openCursor(query?: IDBValidKey | IDBKeyRange | null, direction?: IDBCursorDirection): IDBRequest; /** * Opens a cursor with key only flag set over the records matching query, ordered by direction. If query is null, all records in store are matched. - * + * * If successful, request's result will be an IDBCursor pointing at the first matching record, or null if there were no matching records. */ openKeyCursor(query?: IDBValidKey | IDBKeyRange | null, direction?: IDBCursorDirection): IDBRequest; /** * Adds or updates a record in store with the given value and key. - * + * * If the store uses in-line keys and key is specified a "DataError" DOMException will be thrown. - * + * * If put() is used, any existing record with the key will be replaced. If add() is used, and if a record with the key already exists the request will fail, with request's error set to a "ConstraintError" DOMException. - * + * * If successful, request's result will be the record's key. */ put(value: any, key?: IDBValidKey): IDBRequest; @@ -9722,25 +9722,25 @@ interface Location { readonly ancestorOrigins: DOMStringList; /** * Returns the Location object's URL's fragment (includes leading "#" if non-empty). - * + * * Can be set, to navigate to the same URL with a changed fragment (ignores leading "#"). */ hash: string; /** * Returns the Location object's URL's host and port (if different from the default port for the scheme). - * + * * Can be set, to navigate to the same URL with a changed host and port. */ host: string; /** * Returns the Location object's URL's host. - * + * * Can be set, to navigate to the same URL with a changed host. */ hostname: string; /** * Returns the Location object's URL. - * + * * Can be set, to navigate to the given URL. */ href: string; @@ -9751,25 +9751,25 @@ interface Location { readonly origin: string; /** * Returns the Location object's URL's path. - * + * * Can be set, to navigate to the same URL with a changed path. */ pathname: string; /** * Returns the Location object's URL's port. - * + * * Can be set, to navigate to the same URL with a changed port. */ port: string; /** * Returns the Location object's URL's scheme. - * + * * Can be set, to navigate to the same URL with a changed scheme. */ protocol: string; /** * Returns the Location object's URL's query (includes leading "?" if non-empty). - * + * * Can be set, to navigate to the same URL with a changed query (ignores leading "?"). */ search: string; @@ -10474,7 +10474,7 @@ interface MessagePort extends EventTarget { close(): void; /** * Posts a message through the channel. Objects listed in transfer are transferred, not just cloned, meaning that they are no longer usable on the sending side. - * + * * Throws a "DataCloneError" DOMException if transfer contains duplicate objects or port, or if message could not be cloned. */ postMessage(message: any, transfer: Transferable[]): void; @@ -10591,7 +10591,7 @@ interface MutationObserver { disconnect(): void; /** * Instructs the user agent to observe a given target (a node) and report any mutations based on the criteria given by options (an object). - * + * * The options argument allows for setting mutation observation options via object members. */ observe(target: Node, options?: MutationObserverInit): void; @@ -11181,27 +11181,27 @@ declare var OfflineAudioContext: { interface OffscreenCanvas extends EventTarget { /** * These attributes return the dimensions of the OffscreenCanvas object's bitmap. - * + * * They can be set, to replace the bitmap with a new, transparent black bitmap of the specified dimensions (effectively resizing it). */ height: number; /** * These attributes return the dimensions of the OffscreenCanvas object's bitmap. - * + * * They can be set, to replace the bitmap with a new, transparent black bitmap of the specified dimensions (effectively resizing it). */ width: number; /** * Returns a promise that will fulfill with a new Blob object representing a file containing the image in the OffscreenCanvas object. - * + * * The argument, if provided, is a dictionary that controls the encoding options of the image file to be created. The type field specifies the file format and has a default value of "image/png"; that type is also used if the requested type isn't supported. If the image format supports variable quality (such as "image/jpeg"), then the quality field is a number in the range 0.0 to 1.0 inclusive indicating the desired quality level for the resulting image. */ convertToBlob(options?: ImageEncodeOptions): Promise; /** * Returns an object that exposes an API for drawing on the OffscreenCanvas object. contextId specifies the desired API: "2d", "bitmaprenderer", "webgl", or "webgl2". options is handled by that API. - * + * * This specification defines the "2d" context below, which is similar but distinct from the "2d" context that is created from a canvas element. The WebGL specifications define the "webgl" and "webgl2" contexts. [WEBGL] - * + * * Returns null if the canvas has already been initialized with another context type (e.g., trying to get a "2d" context after getting a "webgl" context). */ getContext(contextId: "2d", options?: CanvasRenderingContext2DSettings): OffscreenCanvasRenderingContext2D | null; @@ -11277,11 +11277,11 @@ declare var OverflowEvent: { interface PageTransitionEvent extends Event { /** * For the pageshow event, returns false if the page is newly being loaded (and the load event will fire). Otherwise, returns true. - * + * * For the pagehide event, returns false if the page is going away for the last time. Otherwise, returns true, meaning that (if nothing conspires to make the page unsalvageable) the page might be reused if the user navigates back to this page. - * + * * Things that can cause the page to be unsalvageable include: - * + * * Listening for beforeunload events * Listening for unload events * Having iframes that are not salvageable @@ -11339,13 +11339,13 @@ interface ParentNode { readonly lastElementChild: Element | null; /** * Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - * + * * Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. */ append(...nodes: (Node | string)[]): void; /** * Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - * + * * Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. */ prepend(...nodes: (Node | string)[]): void; @@ -15340,7 +15340,7 @@ interface Storage { removeItem(key: string): void; /** * Sets the value of the pair identified by key to value, creating a new key/value pair if none existed for key previously. - * + * * Throws a "QuotaExceededError" DOMException exception if the new value couldn't be set. (Setting could fail if, e.g., the user has disabled storage for the site, or if the quota has been exceeded.) */ setItem(key: string, value: string): void; @@ -15490,7 +15490,7 @@ declare var Text: { interface TextDecoder extends TextDecoderCommon { /** * Returns the result of running encoding's decoder. The method can be invoked zero or more times with options's stream set to true, and then once without options's stream (or set to false), to process a fragmented stream. If the invocation without options's stream (or set to false) has no input, it's clearest to omit both arguments. - * + * * ``` * var string = "", decoder = new TextDecoder(encoding), buffer; * while(buffer = next_chunk()) { @@ -15498,7 +15498,7 @@ interface TextDecoder extends TextDecoderCommon { * } * string += decoder.decode(); // end-of-stream * ``` - * + * * If the error mode is "fatal" and encoding's decoder returns error, throws a TypeError. */ decode(input?: BufferSource, options?: TextDecodeOptions): string; @@ -15671,9 +15671,9 @@ interface TextTrack extends EventTarget { readonly cues: TextTrackCueList | null; /** * Returns the ID of the given track. - * + * * For in-band tracks, this is the ID that can be used with a fragment if the format supports media fragment syntax, and that can be used with the getTrackById() method. - * + * * For TextTrack objects corresponding to track elements, this is the ID of the track element. */ readonly id: string; @@ -15695,7 +15695,7 @@ interface TextTrack extends EventTarget { readonly language: string; /** * Returns the text track mode, represented by a string from the following list: - * + * * Can be set, to change the mode. */ mode: TextTrackMode; @@ -15729,13 +15729,13 @@ interface TextTrackCueEventMap { interface TextTrackCue extends EventTarget { /** * Returns the text track cue end time, in seconds. - * + * * Can be set. */ endTime: number; /** * Returns the text track cue identifier. - * + * * Can be set. */ id: string; @@ -15743,13 +15743,13 @@ interface TextTrackCue extends EventTarget { onexit: ((this: TextTrackCue, ev: Event) => any) | null; /** * Returns true if the text track cue pause-on-exit flag is set, false otherwise. - * + * * Can be set. */ pauseOnExit: boolean; /** * Returns the text track cue start time, in seconds. - * + * * Can be set. */ startTime: number; @@ -15775,7 +15775,7 @@ interface TextTrackCueList { readonly length: number; /** * Returns the first text track cue (in text track cue order) with text track cue identifier id. - * + * * Returns null if none of the cues have the given identifier or if the argument is the empty string. */ getCueById(id: string): TextTrackCue | null; @@ -15819,13 +15819,13 @@ interface TimeRanges { readonly length: number; /** * Returns the time for the end of the range with the given index. - * + * * Throws an "IndexSizeError" DOMException if the index is out of range. */ end(index: number): number; /** * Returns the time for the start of the range with the given index. - * + * * Throws an "IndexSizeError" DOMException if the index is out of range. */ start(index: number): number; @@ -18291,13 +18291,13 @@ interface WebSocketEventMap { interface WebSocket extends EventTarget { /** * Returns a string that indicates how binary data from the WebSocket object is exposed to scripts: - * + * * Can be set, to change how binary data is returned. The default is "blob". */ binaryType: BinaryType; /** * Returns the number of bytes of application data (UTF-8 text and binary data) that have been queued using send() but not yet been transmitted to the network. - * + * * If the WebSocket connection is closed, this attribute's value will only increase with each call to the send() method. (The number does not reset to zero once the connection closes.) */ readonly bufferedAmount: number; @@ -18774,26 +18774,26 @@ interface XMLHttpRequest extends XMLHttpRequestEventTarget { readonly response: any; /** * Returns the text response. - * + * * Throws an "InvalidStateError" DOMException if responseType is not the empty string or "text". */ readonly responseText: string; /** * Returns the response type. - * + * * Can be set to change the response type. Values are: the empty string (default), "arraybuffer", "blob", "document", "json", and "text". - * + * * When set: setting to "document" is ignored if current global object is not a Window object. - * + * * When set: throws an "InvalidStateError" DOMException if state is loading or done. - * + * * When set: throws an "InvalidAccessError" DOMException if the synchronous flag is set and current global object is a Window object. */ responseType: XMLHttpRequestResponseType; readonly responseURL: string; /** * Returns the document response. - * + * * Throws an "InvalidStateError" DOMException if responseType is not the empty string or "document". */ readonly responseXML: Document | null; @@ -18801,7 +18801,7 @@ interface XMLHttpRequest extends XMLHttpRequestEventTarget { readonly statusText: string; /** * Can be set to a time in milliseconds. When set to a non-zero value will cause fetching to terminate after the given time has passed. When the time has passed, the request has not yet completed, and the synchronous flag is unset, a timeout event will then be dispatched, or a "TimeoutError" DOMException will be thrown otherwise (for the send() method). - * + * * When set: throws an "InvalidAccessError" DOMException if the synchronous flag is set and current global object is a Window object. */ timeout: number; @@ -18811,7 +18811,7 @@ interface XMLHttpRequest extends XMLHttpRequestEventTarget { readonly upload: XMLHttpRequestUpload; /** * True when credentials are to be included in a cross-origin request. False when they are to be excluded in a cross-origin request and when cookies are to be ignored in its response. Initially false. - * + * * When set: throws an "InvalidStateError" DOMException if state is not unsent or opened, or if the send() flag is set. */ withCredentials: boolean; @@ -18823,32 +18823,32 @@ interface XMLHttpRequest extends XMLHttpRequestEventTarget { getResponseHeader(name: string): string | null; /** * Sets the request method, request URL, and synchronous flag. - * + * * Throws a "SyntaxError" DOMException if either method is not a valid HTTP method or url cannot be parsed. - * + * * Throws a "SecurityError" DOMException if method is a case-insensitive match for `CONNECT`, `TRACE`, or `TRACK`. - * + * * Throws an "InvalidAccessError" DOMException if async is false, current global object is a Window object, and the timeout attribute is not zero or the responseType attribute is not the empty string. */ open(method: string, url: string): void; open(method: string, url: string, async: boolean, username?: string | null, password?: string | null): void; /** * Acts as if the `Content-Type` header value for response is mime. (It does not actually change the header though.) - * + * * Throws an "InvalidStateError" DOMException if state is loading or done. */ overrideMimeType(mime: string): void; /** * Initiates the request. The body argument provides the request body, if any, and is ignored if the request method is GET or HEAD. - * + * * Throws an "InvalidStateError" DOMException if either state is not opened or the send() flag is set. */ send(body?: Document | BodyInit | null): void; /** * Combines a header in author request headers. - * + * * Throws an "InvalidStateError" DOMException if either state is not opened or the send() flag is set. - * + * * Throws a "SyntaxError" DOMException if name is not a header name or if value is not a header value. */ setRequestHeader(name: string, value: string): void; diff --git a/baselines/dom.iterable.generated.d.ts b/baselines/dom.iterable.generated.d.ts index d7787b97d..1e66934ce 100644 --- a/baselines/dom.iterable.generated.d.ts +++ b/baselines/dom.iterable.generated.d.ts @@ -119,7 +119,7 @@ interface IDBDatabase { interface IDBObjectStore { /** * Creates a new index in store with the given name, keyPath and options and returns a new IDBIndex. If the keyPath and options define constraints that cannot be satisfied with the data already in store the upgrade transaction will abort with a "ConstraintError" DOMException. - * + * * Throws an "InvalidStateError" DOMException if not called within an upgrade transaction. */ createIndex(name: string, keyPath: string | Iterable, options?: IDBIndexParameters): IDBIndex; diff --git a/baselines/webworker.generated.d.ts b/baselines/webworker.generated.d.ts index f24219da5..79b9e7e5a 100644 --- a/baselines/webworker.generated.d.ts +++ b/baselines/webworker.generated.d.ts @@ -781,7 +781,7 @@ interface CanvasFilters { interface CanvasGradient { /** * Adds a color stop with the given color to the gradient at the given offset. 0.0 is the offset at one end of the gradient, 1.0 is the offset at the other end. - * + * * Throws an "IndexSizeError" DOMException if the offset is out of range. Throws a "SyntaxError" DOMException if the color cannot be parsed. */ addColorStop(offset: number, color: string): void; @@ -1463,15 +1463,15 @@ declare var EventSource: { interface EventTarget { /** * Appends an event listener for events whose type attribute value is type. The callback argument sets the callback that will be invoked when the event is dispatched. - * + * * The options argument sets listener-specific options. For compatibility this can be a boolean, in which case the method behaves exactly as if the value was specified as options's capture. - * + * * When set to true, options's capture prevents callback from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. When false (or not present), callback will not be invoked when event's eventPhase attribute value is CAPTURING_PHASE. Either way, callback will be invoked if event's eventPhase attribute value is AT_TARGET. - * + * * When set to true, options's passive indicates that the callback will not cancel the event by invoking preventDefault(). This is used to enable performance optimizations described in § 2.8 Observing event listeners. - * + * * When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - * + * * The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. */ addEventListener(type: string, listener: EventListenerOrEventListenerObject | null, options?: boolean | AddEventListenerOptions): void; @@ -1630,16 +1630,16 @@ interface GenericTransformStream { readonly readable: ReadableStream; /** * Returns a writable stream which accepts [AllowShared] BufferSource chunks and runs them through encoding's decoder before making them available to readable. - * + * * Typically this will be used via the pipeThrough() method on a ReadableStream source. - * + * * ``` * var decoder = new TextDecoderStream(encoding); * byteReadable * .pipeThrough(decoder) * .pipeTo(textWritable); * ``` - * + * * If the error mode is "fatal" and encoding's decoder returns error, both readable and writable will be errored with a TypeError. */ readonly writable: WritableStream; @@ -1695,15 +1695,15 @@ interface IDBCursor { continuePrimaryKey(key: IDBValidKey, primaryKey: IDBValidKey): void; /** * Delete the record pointed at by the cursor with a new value. - * + * * If successful, request's result will be undefined. */ delete(): IDBRequest; /** * Updated the record pointed at by the cursor with a new value. - * + * * Throws a "DataError" DOMException if the effective object store uses in-line keys and the key would have changed. - * + * * If successful, request's result will be the record's key. */ update(value: any): IDBRequest; @@ -1758,13 +1758,13 @@ interface IDBDatabase extends EventTarget { close(): void; /** * Creates a new object store with the given name and options and returns a new IDBObjectStore. - * + * * Throws a "InvalidStateError" DOMException if not called within an upgrade transaction. */ createObjectStore(name: string, options?: IDBObjectStoreParameters): IDBObjectStore; /** * Deletes the object store with the given name. - * + * * Throws a "InvalidStateError" DOMException if not called within an upgrade transaction. */ deleteObjectStore(name: string): void; @@ -1787,7 +1787,7 @@ declare var IDBDatabase: { interface IDBFactory { /** * Compares two values as keys. Returns -1 if key1 precedes key2, 1 if key2 precedes key1, and 0 if the keys are equal. - * + * * Throws a "DataError" DOMException if either input is not a valid key. */ cmp(first: any, second: any): number; @@ -1821,43 +1821,43 @@ interface IDBIndex { readonly unique: boolean; /** * Retrieves the number of records matching the given key or key range in query. - * + * * If successful, request's result will be the count. */ count(key?: IDBValidKey | IDBKeyRange): IDBRequest; /** * Retrieves the value of the first record matching the given key or key range in query. - * + * * If successful, request's result will be the value, or undefined if there was no matching record. */ get(key: IDBValidKey | IDBKeyRange): IDBRequest; /** * Retrieves the values of the records matching the given key or key range in query (up to count if given). - * + * * If successful, request's result will be an Array of the values. */ getAll(query?: IDBValidKey | IDBKeyRange | null, count?: number): IDBRequest; /** * Retrieves the keys of records matching the given key or key range in query (up to count if given). - * + * * If successful, request's result will be an Array of the keys. */ getAllKeys(query?: IDBValidKey | IDBKeyRange | null, count?: number): IDBRequest; /** * Retrieves the key of the first record matching the given key or key range in query. - * + * * If successful, request's result will be the key, or undefined if there was no matching record. */ getKey(key: IDBValidKey | IDBKeyRange): IDBRequest; /** * Opens a cursor over the records matching query, ordered by direction. If query is null, all records in index are matched. - * + * * If successful, request's result will be an IDBCursorWithValue, or null if there were no matching records. */ openCursor(query?: IDBValidKey | IDBKeyRange | null, direction?: IDBCursorDirection): IDBRequest; /** * Opens a cursor with key only flag set over the records matching query, ordered by direction. If query is null, all records in index are matched. - * + * * If successful, request's result will be an IDBCursor, or null if there were no matching records. */ openKeyCursor(query?: IDBValidKey | IDBKeyRange | null, direction?: IDBCursorDirection): IDBRequest; @@ -1937,88 +1937,88 @@ interface IDBObjectStore { readonly transaction: IDBTransaction; /** * Adds or updates a record in store with the given value and key. - * + * * If the store uses in-line keys and key is specified a "DataError" DOMException will be thrown. - * + * * If put() is used, any existing record with the key will be replaced. If add() is used, and if a record with the key already exists the request will fail, with request's error set to a "ConstraintError" DOMException. - * + * * If successful, request's result will be the record's key. */ add(value: any, key?: IDBValidKey): IDBRequest; /** * Deletes all records in store. - * + * * If successful, request's result will be undefined. */ clear(): IDBRequest; /** * Retrieves the number of records matching the given key or key range in query. - * + * * If successful, request's result will be the count. */ count(key?: IDBValidKey | IDBKeyRange): IDBRequest; /** * Creates a new index in store with the given name, keyPath and options and returns a new IDBIndex. If the keyPath and options define constraints that cannot be satisfied with the data already in store the upgrade transaction will abort with a "ConstraintError" DOMException. - * + * * Throws an "InvalidStateError" DOMException if not called within an upgrade transaction. */ createIndex(name: string, keyPath: string | string[], options?: IDBIndexParameters): IDBIndex; /** * Deletes records in store with the given key or in the given key range in query. - * + * * If successful, request's result will be undefined. */ delete(key: IDBValidKey | IDBKeyRange): IDBRequest; /** * Deletes the index in store with the given name. - * + * * Throws an "InvalidStateError" DOMException if not called within an upgrade transaction. */ deleteIndex(name: string): void; /** * Retrieves the value of the first record matching the given key or key range in query. - * + * * If successful, request's result will be the value, or undefined if there was no matching record. */ get(query: IDBValidKey | IDBKeyRange): IDBRequest; /** * Retrieves the values of the records matching the given key or key range in query (up to count if given). - * + * * If successful, request's result will be an Array of the values. */ getAll(query?: IDBValidKey | IDBKeyRange | null, count?: number): IDBRequest; /** * Retrieves the keys of records matching the given key or key range in query (up to count if given). - * + * * If successful, request's result will be an Array of the keys. */ getAllKeys(query?: IDBValidKey | IDBKeyRange | null, count?: number): IDBRequest; /** * Retrieves the key of the first record matching the given key or key range in query. - * + * * If successful, request's result will be the key, or undefined if there was no matching record. */ getKey(query: IDBValidKey | IDBKeyRange): IDBRequest; index(name: string): IDBIndex; /** * Opens a cursor over the records matching query, ordered by direction. If query is null, all records in store are matched. - * + * * If successful, request's result will be an IDBCursorWithValue pointing at the first matching record, or null if there were no matching records. */ openCursor(query?: IDBValidKey | IDBKeyRange | null, direction?: IDBCursorDirection): IDBRequest; /** * Opens a cursor with key only flag set over the records matching query, ordered by direction. If query is null, all records in store are matched. - * + * * If successful, request's result will be an IDBCursor pointing at the first matching record, or null if there were no matching records. */ openKeyCursor(query?: IDBValidKey | IDBKeyRange | null, direction?: IDBCursorDirection): IDBRequest; /** * Adds or updates a record in store with the given value and key. - * + * * If the store uses in-line keys and key is specified a "DataError" DOMException will be thrown. - * + * * If put() is used, any existing record with the key will be replaced. If add() is used, and if a record with the key already exists the request will fail, with request's error set to a "ConstraintError" DOMException. - * + * * If successful, request's result will be the record's key. */ put(value: any, key?: IDBValidKey): IDBRequest; @@ -2264,7 +2264,7 @@ interface MessagePort extends EventTarget { close(): void; /** * Posts a message through the channel. Objects listed in transfer are transferred, not just cloned, meaning that they are no longer usable on the sending side. - * + * * Throws a "DataCloneError" DOMException if transfer contains duplicate objects or port, or if message could not be cloned. */ postMessage(message: any, transfer: Transferable[]): void; @@ -2412,27 +2412,27 @@ interface OES_vertex_array_object { interface OffscreenCanvas extends EventTarget { /** * These attributes return the dimensions of the OffscreenCanvas object's bitmap. - * + * * They can be set, to replace the bitmap with a new, transparent black bitmap of the specified dimensions (effectively resizing it). */ height: number; /** * These attributes return the dimensions of the OffscreenCanvas object's bitmap. - * + * * They can be set, to replace the bitmap with a new, transparent black bitmap of the specified dimensions (effectively resizing it). */ width: number; /** * Returns a promise that will fulfill with a new Blob object representing a file containing the image in the OffscreenCanvas object. - * + * * The argument, if provided, is a dictionary that controls the encoding options of the image file to be created. The type field specifies the file format and has a default value of "image/png"; that type is also used if the requested type isn't supported. If the image format supports variable quality (such as "image/jpeg"), then the quality field is a number in the range 0.0 to 1.0 inclusive indicating the desired quality level for the resulting image. */ convertToBlob(options?: ImageEncodeOptions): Promise; /** * Returns an object that exposes an API for drawing on the OffscreenCanvas object. contextId specifies the desired API: "2d", "bitmaprenderer", "webgl", or "webgl2". options is handled by that API. - * + * * This specification defines the "2d" context below, which is similar but distinct from the "2d" context that is created from a canvas element. The WebGL specifications define the "webgl" and "webgl2" contexts. [WEBGL] - * + * * Returns null if the canvas has already been initialized with another context type (e.g., trying to get a "2d" context after getting a "webgl" context). */ getContext(contextId: "2d", options?: CanvasRenderingContext2DSettings): OffscreenCanvasRenderingContext2D | null; @@ -3109,7 +3109,7 @@ declare var SyncManager: { interface TextDecoder extends TextDecoderCommon { /** * Returns the result of running encoding's decoder. The method can be invoked zero or more times with options's stream set to true, and then once without options's stream (or set to false), to process a fragmented stream. If the invocation without options's stream (or set to false) has no input, it's clearest to omit both arguments. - * + * * ``` * var string = "", decoder = new TextDecoder(encoding), buffer; * while(buffer = next_chunk()) { @@ -3117,7 +3117,7 @@ interface TextDecoder extends TextDecoderCommon { * } * string += decoder.decode(); // end-of-stream * ``` - * + * * If the error mode is "fatal" and encoding's decoder returns error, throws a TypeError. */ decode(input?: BufferSource, options?: TextDecodeOptions): string; @@ -5335,13 +5335,13 @@ interface WebSocketEventMap { interface WebSocket extends EventTarget { /** * Returns a string that indicates how binary data from the WebSocket object is exposed to scripts: - * + * * Can be set, to change how binary data is returned. The default is "blob". */ binaryType: BinaryType; /** * Returns the number of bytes of application data (UTF-8 text and binary data) that have been queued using send() but not yet been transmitted to the network. - * + * * If the WebSocket connection is closed, this attribute's value will only increase with each call to the send() method. (The number does not reset to zero once the connection closes.) */ readonly bufferedAmount: number; @@ -5580,19 +5580,19 @@ interface XMLHttpRequest extends XMLHttpRequestEventTarget { readonly response: any; /** * Returns the text response. - * + * * Throws an "InvalidStateError" DOMException if responseType is not the empty string or "text". */ readonly responseText: string; /** * Returns the response type. - * + * * Can be set to change the response type. Values are: the empty string (default), "arraybuffer", "blob", "document", "json", and "text". - * + * * When set: setting to "document" is ignored if current global object is not a Window object. - * + * * When set: throws an "InvalidStateError" DOMException if state is loading or done. - * + * * When set: throws an "InvalidAccessError" DOMException if the synchronous flag is set and current global object is a Window object. */ responseType: XMLHttpRequestResponseType; @@ -5601,7 +5601,7 @@ interface XMLHttpRequest extends XMLHttpRequestEventTarget { readonly statusText: string; /** * Can be set to a time in milliseconds. When set to a non-zero value will cause fetching to terminate after the given time has passed. When the time has passed, the request has not yet completed, and the synchronous flag is unset, a timeout event will then be dispatched, or a "TimeoutError" DOMException will be thrown otherwise (for the send() method). - * + * * When set: throws an "InvalidAccessError" DOMException if the synchronous flag is set and current global object is a Window object. */ timeout: number; @@ -5611,7 +5611,7 @@ interface XMLHttpRequest extends XMLHttpRequestEventTarget { readonly upload: XMLHttpRequestUpload; /** * True when credentials are to be included in a cross-origin request. False when they are to be excluded in a cross-origin request and when cookies are to be ignored in its response. Initially false. - * + * * When set: throws an "InvalidStateError" DOMException if state is not unsent or opened, or if the send() flag is set. */ withCredentials: boolean; @@ -5623,32 +5623,32 @@ interface XMLHttpRequest extends XMLHttpRequestEventTarget { getResponseHeader(name: string): string | null; /** * Sets the request method, request URL, and synchronous flag. - * + * * Throws a "SyntaxError" DOMException if either method is not a valid HTTP method or url cannot be parsed. - * + * * Throws a "SecurityError" DOMException if method is a case-insensitive match for `CONNECT`, `TRACE`, or `TRACK`. - * + * * Throws an "InvalidAccessError" DOMException if async is false, current global object is a Window object, and the timeout attribute is not zero or the responseType attribute is not the empty string. */ open(method: string, url: string): void; open(method: string, url: string, async: boolean, username?: string | null, password?: string | null): void; /** * Acts as if the `Content-Type` header value for response is mime. (It does not actually change the header though.) - * + * * Throws an "InvalidStateError" DOMException if state is loading or done. */ overrideMimeType(mime: string): void; /** * Initiates the request. The body argument provides the request body, if any, and is ignored if the request method is GET or HEAD. - * + * * Throws an "InvalidStateError" DOMException if either state is not opened or the send() flag is set. */ send(body?: BodyInit | null): void; /** * Combines a header in author request headers. - * + * * Throws an "InvalidStateError" DOMException if either state is not opened or the send() flag is set. - * + * * Throws a "SyntaxError" DOMException if name is not a header name or if value is not a header value. */ setRequestHeader(name: string, value: string): void; diff --git a/baselines/webworker.iterable.generated.d.ts b/baselines/webworker.iterable.generated.d.ts index 249b5b899..48ab3b9a7 100644 --- a/baselines/webworker.iterable.generated.d.ts +++ b/baselines/webworker.iterable.generated.d.ts @@ -60,7 +60,7 @@ interface IDBDatabase { interface IDBObjectStore { /** * Creates a new index in store with the given name, keyPath and options and returns a new IDBIndex. If the keyPath and options define constraints that cannot be satisfied with the data already in store the upgrade transaction will abort with a "ConstraintError" DOMException. - * + * * Throws an "InvalidStateError" DOMException if not called within an upgrade transaction. */ createIndex(name: string, keyPath: string | Iterable, options?: IDBIndexParameters): IDBIndex; diff --git a/src/widlprocess.ts b/src/widlprocess.ts index e5daec02c..4539ab1cd 100644 --- a/src/widlprocess.ts +++ b/src/widlprocess.ts @@ -103,9 +103,9 @@ function addComments(obj: any, commentMap: Record, container: st const key = container.toLowerCase() + (member ? "-" + member.toLowerCase() : ""); if (commentMap[key]) { const comments = commentMap[key].split("\n"); - obj["comment"] = "/**\n * "; - obj["comment"] += comments.join("\n * "); - obj["comment"] += "\n */"; + obj["comment"] = "/**\n"; + obj["comment"] += comments.map(c => ` * ${c}`.trimRight() + "\n").join(""); + obj["comment"] += " */"; } } From 6e5a48e507c43f0554f0e474ddb2723189aa7507 Mon Sep 17 00:00:00 2001 From: Kagami Sascha Rosylight Date: Sun, 25 Oct 2020 17:03:36 +0100 Subject: [PATCH 2/3] Indent only for non-empty line --- baselines/dom.generated.d.ts | 44 +++++++++++++++--------------- baselines/webworker.generated.d.ts | 32 +++++++++++----------- src/emitter.ts | 2 +- 3 files changed, 39 insertions(+), 39 deletions(-) diff --git a/baselines/dom.generated.d.ts b/baselines/dom.generated.d.ts index 8c46cbc03..b7230d457 100644 --- a/baselines/dom.generated.d.ts +++ b/baselines/dom.generated.d.ts @@ -19055,52 +19055,52 @@ declare namespace CSS { declare namespace WebAssembly { interface CompileError { } - + var CompileError: { prototype: CompileError; new(): CompileError; }; - + interface Global { value: any; valueOf(): any; } - + var Global: { prototype: Global; new(descriptor: GlobalDescriptor, v?: any): Global; }; - + interface Instance { readonly exports: Exports; } - + var Instance: { prototype: Instance; new(module: Module, importObject?: Imports): Instance; }; - + interface LinkError { } - + var LinkError: { prototype: LinkError; new(): LinkError; }; - + interface Memory { readonly buffer: ArrayBuffer; grow(delta: number): number; } - + var Memory: { prototype: Memory; new(descriptor: MemoryDescriptor): Memory; }; - + interface Module { } - + var Module: { prototype: Module; new(bytes: BufferSource): Module; @@ -19108,59 +19108,59 @@ declare namespace WebAssembly { exports(moduleObject: Module): ModuleExportDescriptor[]; imports(moduleObject: Module): ModuleImportDescriptor[]; }; - + interface RuntimeError { } - + var RuntimeError: { prototype: RuntimeError; new(): RuntimeError; }; - + interface Table { readonly length: number; get(index: number): Function | null; grow(delta: number): number; set(index: number, value: Function | null): void; } - + var Table: { prototype: Table; new(descriptor: TableDescriptor): Table; }; - + interface GlobalDescriptor { mutable?: boolean; value: ValueType; } - + interface MemoryDescriptor { initial: number; maximum?: number; } - + interface ModuleExportDescriptor { kind: ImportExportKind; name: string; } - + interface ModuleImportDescriptor { kind: ImportExportKind; module: string; name: string; } - + interface TableDescriptor { element: TableKind; initial: number; maximum?: number; } - + interface WebAssemblyInstantiatedSource { instance: Instance; module: Module; } - + type ImportExportKind = "function" | "global" | "memory" | "table"; type TableKind = "anyfunc"; type ValueType = "f32" | "f64" | "i32" | "i64"; diff --git a/baselines/webworker.generated.d.ts b/baselines/webworker.generated.d.ts index 79b9e7e5a..6c54cc19e 100644 --- a/baselines/webworker.generated.d.ts +++ b/baselines/webworker.generated.d.ts @@ -5748,34 +5748,34 @@ declare namespace WebAssembly { value: any; valueOf(): any; } - + var Global: { prototype: Global; new(descriptor: GlobalDescriptor, v?: any): Global; }; - + interface Instance { readonly exports: Exports; } - + var Instance: { prototype: Instance; new(module: Module, importObject?: Imports): Instance; }; - + interface Memory { readonly buffer: ArrayBuffer; grow(delta: number): number; } - + var Memory: { prototype: Memory; new(descriptor: MemoryDescriptor): Memory; }; - + interface Module { } - + var Module: { prototype: Module; new(bytes: BufferSource): Module; @@ -5783,51 +5783,51 @@ declare namespace WebAssembly { exports(moduleObject: Module): ModuleExportDescriptor[]; imports(moduleObject: Module): ModuleImportDescriptor[]; }; - + interface Table { readonly length: number; get(index: number): Function | null; grow(delta: number): number; set(index: number, value: Function | null): void; } - + var Table: { prototype: Table; new(descriptor: TableDescriptor): Table; }; - + interface GlobalDescriptor { mutable?: boolean; value: ValueType; } - + interface MemoryDescriptor { initial: number; maximum?: number; } - + interface ModuleExportDescriptor { kind: ImportExportKind; name: string; } - + interface ModuleImportDescriptor { kind: ImportExportKind; module: string; name: string; } - + interface TableDescriptor { element: TableKind; initial: number; maximum?: number; } - + interface WebAssemblyInstantiatedSource { instance: Instance; module: Module; } - + type ImportExportKind = "function" | "global" | "memory" | "table"; type TableKind = "anyfunc"; type ValueType = "f32" | "f64" | "i32" | "i64"; diff --git a/src/emitter.ts b/src/emitter.ts index 889a8874e..0153ee470 100644 --- a/src/emitter.ts +++ b/src/emitter.ts @@ -68,7 +68,7 @@ function createTextWriter(newLine: string) { } function write(s: string) { - if (lineStart) { + if (s && lineStart) { output += getIndentString(indent); lineStart = false; } From 09e2039467509eec2018518384ac91170abd7747 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Tue, 23 Feb 2021 09:04:45 -0800 Subject: [PATCH 3/3] accept baselines --- baselines/dom.generated.d.ts | 18 +++++++++--------- baselines/webworker.generated.d.ts | 18 +++++++++--------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/baselines/dom.generated.d.ts b/baselines/dom.generated.d.ts index 88d384e64..e7c1b9c39 100644 --- a/baselines/dom.generated.d.ts +++ b/baselines/dom.generated.d.ts @@ -1145,7 +1145,7 @@ interface QueuingStrategy { interface QueuingStrategyInit { /** * Creates a new ByteLengthQueuingStrategy with the provided high water mark. - * + * * Note that the provided high water mark will not be validated ahead of time. Instead, if it is negative, NaN, or not a number, the resulting ByteLengthQueuingStrategy will cause the corresponding stream constructor to throw. */ highWaterMark: number; @@ -1567,7 +1567,7 @@ interface ReadableWritablePair { readable: ReadableStream; /** * Provides a convenient, chainable way of piping this readable stream through a transform stream (or any other { writable, readable } pair). It simply pipes the stream into the writable side of the supplied pair, and returns the readable side for further use. - * + * * Piping a stream will lock it for the duration of the pipe, preventing any other consumer from acquiring a reader. */ writable: WritableStream; @@ -1812,19 +1812,19 @@ interface StreamPipeOptions { preventCancel?: boolean; /** * Pipes this readable stream to a given writable stream destination. The way in which the piping process behaves under various error conditions can be customized with a number of passed options. It returns a promise that fulfills when the piping process completes successfully, or rejects if any errors were encountered. - * + * * Piping a stream will lock it for the duration of the pipe, preventing any other consumer from acquiring a reader. - * + * * Errors and closures of the source and destination streams propagate as follows: - * + * * An error in this source readable stream will abort destination, unless preventAbort is truthy. The returned promise will be rejected with the source's error, or with any error that occurs during aborting the destination. - * + * * An error in destination will cancel this source readable stream, unless preventCancel is truthy. The returned promise will be rejected with the destination's error, or with any error that occurs during canceling the source. - * + * * When this source readable stream closes, destination will be closed, unless preventClose is truthy. The returned promise will be fulfilled once this process completes, unless an error is encountered while closing the destination, in which case it will be rejected with that error. - * + * * If destination starts out closed or closing, this source readable stream will be canceled, unless preventCancel is true. The returned promise will be rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source. - * + * * The signal option can be set to an AbortSignal to allow aborting an ongoing pipe operation via the corresponding AbortController. In this case, this source readable stream will be canceled, and destination aborted, unless the respective options preventCancel or preventAbort are set. */ preventClose?: boolean; diff --git a/baselines/webworker.generated.d.ts b/baselines/webworker.generated.d.ts index 24545735b..3164c065f 100644 --- a/baselines/webworker.generated.d.ts +++ b/baselines/webworker.generated.d.ts @@ -386,7 +386,7 @@ interface QueuingStrategy { interface QueuingStrategyInit { /** * Creates a new ByteLengthQueuingStrategy with the provided high water mark. - * + * * Note that the provided high water mark will not be validated ahead of time. Instead, if it is negative, NaN, or not a number, the resulting ByteLengthQueuingStrategy will cause the corresponding stream constructor to throw. */ highWaterMark: number; @@ -406,7 +406,7 @@ interface ReadableWritablePair { readable: ReadableStream; /** * Provides a convenient, chainable way of piping this readable stream through a transform stream (or any other { writable, readable } pair). It simply pipes the stream into the writable side of the supplied pair, and returns the readable side for further use. - * + * * Piping a stream will lock it for the duration of the pipe, preventing any other consumer from acquiring a reader. */ writable: WritableStream; @@ -516,19 +516,19 @@ interface StreamPipeOptions { preventCancel?: boolean; /** * Pipes this readable stream to a given writable stream destination. The way in which the piping process behaves under various error conditions can be customized with a number of passed options. It returns a promise that fulfills when the piping process completes successfully, or rejects if any errors were encountered. - * + * * Piping a stream will lock it for the duration of the pipe, preventing any other consumer from acquiring a reader. - * + * * Errors and closures of the source and destination streams propagate as follows: - * + * * An error in this source readable stream will abort destination, unless preventAbort is truthy. The returned promise will be rejected with the source's error, or with any error that occurs during aborting the destination. - * + * * An error in destination will cancel this source readable stream, unless preventCancel is truthy. The returned promise will be rejected with the destination's error, or with any error that occurs during canceling the source. - * + * * When this source readable stream closes, destination will be closed, unless preventClose is truthy. The returned promise will be fulfilled once this process completes, unless an error is encountered while closing the destination, in which case it will be rejected with that error. - * + * * If destination starts out closed or closing, this source readable stream will be canceled, unless preventCancel is true. The returned promise will be rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source. - * + * * The signal option can be set to an AbortSignal to allow aborting an ongoing pipe operation via the corresponding AbortController. In this case, this source readable stream will be canceled, and destination aborted, unless the respective options preventCancel or preventAbort are set. */ preventClose?: boolean;