mirror of
https://github.com/denoland/deno.git
synced 2025-03-03 17:34:47 -05:00
feat(cli): upgrade to TypeScript 4.3 (#9960)
This commit is contained in:
parent
56f6e57438
commit
59237d195f
29 changed files with 15418 additions and 11339 deletions
|
@ -131,6 +131,10 @@ fn create_compiler_snapshot(
|
|||
"es2020.sharedmemory",
|
||||
"es2020.string",
|
||||
"es2020.symbol.wellknown",
|
||||
"es2021",
|
||||
"es2021.promise",
|
||||
"es2021.string",
|
||||
"es2021.weakref",
|
||||
"esnext",
|
||||
"esnext.intl",
|
||||
"esnext.promise",
|
||||
|
|
587
cli/dts/lib.dom.d.ts
vendored
587
cli/dts/lib.dom.d.ts
vendored
File diff suppressed because it is too large
Load diff
4
cli/dts/lib.dom.iterable.d.ts
vendored
4
cli/dts/lib.dom.iterable.d.ts
vendored
|
@ -287,10 +287,6 @@ interface WEBGL_draw_buffers {
|
|||
drawBuffersWEBGL(buffers: Iterable<GLenum>): void;
|
||||
}
|
||||
|
||||
interface WebAuthentication {
|
||||
makeCredential(accountInformation: Account, cryptoParameters: Iterable<ScopedCredentialParameters>, attestationChallenge: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null, options?: ScopedCredentialOptions): Promise<ScopedCredentialInfo>;
|
||||
}
|
||||
|
||||
interface WebGL2RenderingContextBase {
|
||||
clearBufferfv(buffer: GLenum, drawbuffer: GLint, values: Iterable<GLfloat>, srcOffset?: GLuint): void;
|
||||
clearBufferiv(buffer: GLenum, drawbuffer: GLint, values: Iterable<GLint>, srcOffset?: GLuint): void;
|
||||
|
|
4
cli/dts/lib.es2015.core.d.ts
vendored
4
cli/dts/lib.es2015.core.d.ts
vendored
|
@ -268,8 +268,8 @@ interface NumberConstructor {
|
|||
|
||||
/**
|
||||
* Converts A string to an integer.
|
||||
* @param s A string to convert into a number.
|
||||
* @param radix A value between 2 and 36 that specifies the base of the number in numString.
|
||||
* @param string A string to convert into a number.
|
||||
* @param radix A value between 2 and 36 that specifies the base of the number in `string`.
|
||||
* If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal.
|
||||
* All other strings are considered decimal.
|
||||
*/
|
||||
|
|
2
cli/dts/lib.es2015.iterable.d.ts
vendored
2
cli/dts/lib.es2015.iterable.d.ts
vendored
|
@ -25,7 +25,7 @@ interface SymbolConstructor {
|
|||
* A method that returns the default iterator for an object. Called by the semantics of the
|
||||
* for-of statement.
|
||||
*/
|
||||
readonly iterator: symbol;
|
||||
readonly iterator: unique symbol;
|
||||
}
|
||||
|
||||
interface IteratorYieldResult<TYield> {
|
||||
|
|
20
cli/dts/lib.es2015.symbol.wellknown.d.ts
vendored
20
cli/dts/lib.es2015.symbol.wellknown.d.ts
vendored
|
@ -25,61 +25,61 @@ interface SymbolConstructor {
|
|||
* A method that determines if a constructor object recognizes an object as one of the
|
||||
* constructor’s instances. Called by the semantics of the instanceof operator.
|
||||
*/
|
||||
readonly hasInstance: symbol;
|
||||
readonly hasInstance: unique symbol;
|
||||
|
||||
/**
|
||||
* A Boolean value that if true indicates that an object should flatten to its array elements
|
||||
* by Array.prototype.concat.
|
||||
*/
|
||||
readonly isConcatSpreadable: symbol;
|
||||
readonly isConcatSpreadable: unique symbol;
|
||||
|
||||
/**
|
||||
* A regular expression method that matches the regular expression against a string. Called
|
||||
* by the String.prototype.match method.
|
||||
*/
|
||||
readonly match: symbol;
|
||||
readonly match: unique symbol;
|
||||
|
||||
/**
|
||||
* A regular expression method that replaces matched substrings of a string. Called by the
|
||||
* String.prototype.replace method.
|
||||
*/
|
||||
readonly replace: symbol;
|
||||
readonly replace: unique symbol;
|
||||
|
||||
/**
|
||||
* A regular expression method that returns the index within a string that matches the
|
||||
* regular expression. Called by the String.prototype.search method.
|
||||
*/
|
||||
readonly search: symbol;
|
||||
readonly search: unique symbol;
|
||||
|
||||
/**
|
||||
* A function valued property that is the constructor function that is used to create
|
||||
* derived objects.
|
||||
*/
|
||||
readonly species: symbol;
|
||||
readonly species: unique symbol;
|
||||
|
||||
/**
|
||||
* A regular expression method that splits a string at the indices that match the regular
|
||||
* expression. Called by the String.prototype.split method.
|
||||
*/
|
||||
readonly split: symbol;
|
||||
readonly split: unique symbol;
|
||||
|
||||
/**
|
||||
* A method that converts an object to a corresponding primitive value.
|
||||
* Called by the ToPrimitive abstract operation.
|
||||
*/
|
||||
readonly toPrimitive: symbol;
|
||||
readonly toPrimitive: unique symbol;
|
||||
|
||||
/**
|
||||
* A String value that is used in the creation of the default string description of an object.
|
||||
* Called by the built-in method Object.prototype.toString.
|
||||
*/
|
||||
readonly toStringTag: symbol;
|
||||
readonly toStringTag: unique symbol;
|
||||
|
||||
/**
|
||||
* An Object whose own property names are property names that are excluded from the 'with'
|
||||
* environment bindings of the associated objects.
|
||||
*/
|
||||
readonly unscopables: symbol;
|
||||
readonly unscopables: unique symbol;
|
||||
}
|
||||
|
||||
interface Symbol {
|
||||
|
|
2
cli/dts/lib.es2018.asynciterable.d.ts
vendored
2
cli/dts/lib.es2018.asynciterable.d.ts
vendored
|
@ -26,7 +26,7 @@ interface SymbolConstructor {
|
|||
* A method that returns the default async iterator for an object. Called by the semantics of
|
||||
* the for-await-of statement.
|
||||
*/
|
||||
readonly asyncIterator: symbol;
|
||||
readonly asyncIterator: unique symbol;
|
||||
}
|
||||
|
||||
interface AsyncIterator<T, TReturn = any, TNext = undefined> {
|
||||
|
|
2
cli/dts/lib.es2020.bigint.d.ts
vendored
2
cli/dts/lib.es2020.bigint.d.ts
vendored
|
@ -121,7 +121,7 @@ interface BigInt {
|
|||
}
|
||||
|
||||
interface BigIntConstructor {
|
||||
(value?: any): bigint;
|
||||
(value: bigint | boolean | number | string): bigint;
|
||||
readonly prototype: BigInt;
|
||||
|
||||
/**
|
||||
|
|
13
cli/dts/lib.es2020.intl.d.ts
vendored
13
cli/dts/lib.es2020.intl.d.ts
vendored
|
@ -21,13 +21,12 @@ and limitations under the License.
|
|||
declare namespace Intl {
|
||||
|
||||
/**
|
||||
* [BCP 47 language tag](http://tools.ietf.org/html/rfc5646) definition.
|
||||
* [Unicode BCP 47 Locale Identifiers](https://unicode.org/reports/tr35/#Unicode_Language_and_Locale_Identifiers) definition.
|
||||
*
|
||||
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locales_argument).
|
||||
*
|
||||
* [Wikipedia](https://en.wikipedia.org/wiki/IETF_language_tag).
|
||||
*/
|
||||
type BCP47LanguageTag = string;
|
||||
type UnicodeBCP47LocaleIdentifier = string;
|
||||
|
||||
/**
|
||||
* Unit to use in the relative time internationalized message.
|
||||
|
@ -98,7 +97,7 @@ declare namespace Intl {
|
|||
* [Specification](https://tc39.es/ecma402/#table-relativetimeformat-resolvedoptions-properties)
|
||||
*/
|
||||
interface ResolvedRelativeTimeFormatOptions {
|
||||
locale: BCP47LanguageTag;
|
||||
locale: UnicodeBCP47LocaleIdentifier;
|
||||
style: RelativeTimeFormatStyle;
|
||||
numeric: RelativeTimeFormatNumeric;
|
||||
numberingSystem: string;
|
||||
|
@ -241,7 +240,7 @@ declare namespace Intl {
|
|||
* [Specification](https://tc39.es/ecma402/#sec-intl-relativetimeformat-constructor).
|
||||
*/
|
||||
new(
|
||||
locales?: BCP47LanguageTag | BCP47LanguageTag[],
|
||||
locales?: UnicodeBCP47LocaleIdentifier | UnicodeBCP47LocaleIdentifier[],
|
||||
options?: RelativeTimeFormatOptions,
|
||||
): RelativeTimeFormat;
|
||||
|
||||
|
@ -277,9 +276,9 @@ declare namespace Intl {
|
|||
* [Specification](https://tc39.es/ecma402/#sec-Intl.RelativeTimeFormat.supportedLocalesOf).
|
||||
*/
|
||||
supportedLocalesOf(
|
||||
locales: BCP47LanguageTag | BCP47LanguageTag[],
|
||||
locales?: UnicodeBCP47LocaleIdentifier | UnicodeBCP47LocaleIdentifier[],
|
||||
options?: RelativeTimeFormatOptions,
|
||||
): BCP47LanguageTag[];
|
||||
): UnicodeBCP47LocaleIdentifier[];
|
||||
};
|
||||
|
||||
interface NumberFormatOptions {
|
||||
|
|
2
cli/dts/lib.es2020.symbol.wellknown.d.ts
vendored
2
cli/dts/lib.es2020.symbol.wellknown.d.ts
vendored
|
@ -26,7 +26,7 @@ interface SymbolConstructor {
|
|||
* A regular expression method that matches the regular expression against a string. Called
|
||||
* by the String.prototype.matchAll method.
|
||||
*/
|
||||
readonly matchAll: symbol;
|
||||
readonly matchAll: unique symbol;
|
||||
}
|
||||
|
||||
interface RegExp {
|
||||
|
|
24
cli/dts/lib.es2021.d.ts
vendored
Normal file
24
cli/dts/lib.es2021.d.ts
vendored
Normal file
|
@ -0,0 +1,24 @@
|
|||
/*! *****************************************************************************
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
||||
this file except in compliance with the License. You may obtain a copy of the
|
||||
License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
||||
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
||||
MERCHANTABLITY OR NON-INFRINGEMENT.
|
||||
|
||||
See the Apache Version 2.0 License for specific language governing permissions
|
||||
and limitations under the License.
|
||||
***************************************************************************** */
|
||||
|
||||
|
||||
|
||||
/// <reference no-default-lib="true"/>
|
||||
|
||||
|
||||
/// <reference lib="es2020" />
|
||||
/// <reference lib="es2021.promise" />
|
||||
/// <reference lib="es2021.string" />
|
||||
/// <reference lib="es2021.weakref" />
|
25
cli/dts/lib.es2021.full.d.ts
vendored
Normal file
25
cli/dts/lib.es2021.full.d.ts
vendored
Normal file
|
@ -0,0 +1,25 @@
|
|||
/*! *****************************************************************************
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
||||
this file except in compliance with the License. You may obtain a copy of the
|
||||
License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
||||
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
||||
MERCHANTABLITY OR NON-INFRINGEMENT.
|
||||
|
||||
See the Apache Version 2.0 License for specific language governing permissions
|
||||
and limitations under the License.
|
||||
***************************************************************************** */
|
||||
|
||||
|
||||
|
||||
/// <reference no-default-lib="true"/>
|
||||
|
||||
|
||||
/// <reference lib="es2021" />
|
||||
/// <reference lib="dom" />
|
||||
/// <reference lib="webworker.importscripts" />
|
||||
/// <reference lib="scripthost" />
|
||||
/// <reference lib="dom.iterable" />
|
43
cli/dts/lib.es2021.promise.d.ts
vendored
Normal file
43
cli/dts/lib.es2021.promise.d.ts
vendored
Normal file
|
@ -0,0 +1,43 @@
|
|||
/*! *****************************************************************************
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
||||
this file except in compliance with the License. You may obtain a copy of the
|
||||
License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
||||
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
||||
MERCHANTABLITY OR NON-INFRINGEMENT.
|
||||
|
||||
See the Apache Version 2.0 License for specific language governing permissions
|
||||
and limitations under the License.
|
||||
***************************************************************************** */
|
||||
|
||||
|
||||
|
||||
/// <reference no-default-lib="true"/>
|
||||
|
||||
|
||||
interface AggregateError extends Error {
|
||||
errors: any[]
|
||||
}
|
||||
|
||||
interface AggregateErrorConstructor {
|
||||
new(errors: Iterable<any>, message?: string): AggregateError;
|
||||
(errors: Iterable<any>, message?: string): AggregateError;
|
||||
readonly prototype: AggregateError;
|
||||
}
|
||||
|
||||
declare var AggregateError: AggregateErrorConstructor;
|
||||
|
||||
/**
|
||||
* Represents the completion of an asynchronous operation
|
||||
*/
|
||||
interface PromiseConstructor {
|
||||
/**
|
||||
* The any function returns a promise that is fulfilled by the first given promise to be fulfilled, or rejected with an AggregateError containing an array of rejection reasons if all of the given promises are rejected. It resolves all elements of the passed iterable to promises as it runs this algorithm.
|
||||
* @param values An array or iterable of Promises.
|
||||
* @returns A new Promise.
|
||||
*/
|
||||
any<T>(values: (T | PromiseLike<T>)[] | Iterable<T | PromiseLike<T>>): Promise<T>
|
||||
}
|
35
cli/dts/lib.es2021.string.d.ts
vendored
Normal file
35
cli/dts/lib.es2021.string.d.ts
vendored
Normal file
|
@ -0,0 +1,35 @@
|
|||
/*! *****************************************************************************
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
||||
this file except in compliance with the License. You may obtain a copy of the
|
||||
License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
||||
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
||||
MERCHANTABLITY OR NON-INFRINGEMENT.
|
||||
|
||||
See the Apache Version 2.0 License for specific language governing permissions
|
||||
and limitations under the License.
|
||||
***************************************************************************** */
|
||||
|
||||
|
||||
|
||||
/// <reference no-default-lib="true"/>
|
||||
|
||||
|
||||
interface String {
|
||||
/**
|
||||
* Replace all instances of a substring in a string, using a regular expression or search string.
|
||||
* @param searchValue A string to search for.
|
||||
* @param replaceValue A string containing the text to replace for every successful match of searchValue in this string.
|
||||
*/
|
||||
replaceAll(searchValue: string | RegExp, replaceValue: string): string;
|
||||
|
||||
/**
|
||||
* Replace all instances of a substring in a string, using a regular expression or search string.
|
||||
* @param searchValue A string to search for.
|
||||
* @param replacer A function that returns the replacement text.
|
||||
*/
|
||||
replaceAll(searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string): string;
|
||||
}
|
75
cli/dts/lib.es2021.weakref.d.ts
vendored
Normal file
75
cli/dts/lib.es2021.weakref.d.ts
vendored
Normal file
|
@ -0,0 +1,75 @@
|
|||
/*! *****************************************************************************
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
||||
this file except in compliance with the License. You may obtain a copy of the
|
||||
License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
||||
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
||||
MERCHANTABLITY OR NON-INFRINGEMENT.
|
||||
|
||||
See the Apache Version 2.0 License for specific language governing permissions
|
||||
and limitations under the License.
|
||||
***************************************************************************** */
|
||||
|
||||
|
||||
|
||||
/// <reference no-default-lib="true"/>
|
||||
|
||||
|
||||
interface WeakRef<T extends object> {
|
||||
readonly [Symbol.toStringTag]: "WeakRef";
|
||||
|
||||
/**
|
||||
* Returns the WeakRef instance's target object, or undefined if the target object has been
|
||||
* reclaimed.
|
||||
*/
|
||||
deref(): T | undefined;
|
||||
}
|
||||
|
||||
interface WeakRefConstructor {
|
||||
readonly prototype: WeakRef<any>;
|
||||
|
||||
/**
|
||||
* Creates a WeakRef instance for the given target object.
|
||||
* @param target The target object for the WeakRef instance.
|
||||
*/
|
||||
new<T extends object>(target: T): WeakRef<T>;
|
||||
}
|
||||
|
||||
declare var WeakRef: WeakRefConstructor;
|
||||
|
||||
interface FinalizationRegistry<T> {
|
||||
readonly [Symbol.toStringTag]: "FinalizationRegistry";
|
||||
|
||||
/**
|
||||
* Registers an object with the registry.
|
||||
* @param target The target object to register.
|
||||
* @param heldValue The value to pass to the finalizer for this object. This cannot be the
|
||||
* target object.
|
||||
* @param unregisterToken The token to pass to the unregister method to unregister the target
|
||||
* object. If provided (and not undefined), this must be an object. If not provided, the target
|
||||
* cannot be unregistered.
|
||||
*/
|
||||
register(target: object, heldValue: T, unregisterToken?: object): void;
|
||||
|
||||
/**
|
||||
* Unregisters an object from the registry.
|
||||
* @param unregisterToken The token that was used as the unregisterToken argument when calling
|
||||
* register to register the target object.
|
||||
*/
|
||||
unregister(unregisterToken: object): void;
|
||||
}
|
||||
|
||||
interface FinalizationRegistryConstructor {
|
||||
readonly prototype: FinalizationRegistry<any>;
|
||||
|
||||
/**
|
||||
* Creates a finalization registry with an associated cleanup callback
|
||||
* @param cleanupCallback The callback to call after an object in the registry has been reclaimed.
|
||||
*/
|
||||
new<T>(cleanupCallback: (heldValue: T) => void): FinalizationRegistry<T>;
|
||||
}
|
||||
|
||||
declare var FinalizationRegistry: FinalizationRegistryConstructor;
|
18
cli/dts/lib.es5.d.ts
vendored
18
cli/dts/lib.es5.d.ts
vendored
|
@ -33,12 +33,12 @@ declare function eval(x: string): any;
|
|||
|
||||
/**
|
||||
* Converts a string to an integer.
|
||||
* @param s A string to convert into a number.
|
||||
* @param radix A value between 2 and 36 that specifies the base of the number in numString.
|
||||
* @param string A string to convert into a number.
|
||||
* @param radix A value between 2 and 36 that specifies the base of the number in `string`.
|
||||
* If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal.
|
||||
* All other strings are considered decimal.
|
||||
*/
|
||||
declare function parseInt(s: string, radix?: number): number;
|
||||
declare function parseInt(string: string, radix?: number): number;
|
||||
|
||||
/**
|
||||
* Converts a string to a floating-point number.
|
||||
|
@ -197,14 +197,14 @@ interface ObjectConstructor {
|
|||
* @param p The property name.
|
||||
* @param attributes Descriptor for the property. It can be for a data property or an accessor property.
|
||||
*/
|
||||
defineProperty(o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>): any;
|
||||
defineProperty<T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>): T;
|
||||
|
||||
/**
|
||||
* Adds one or more properties to an object, and/or modifies attributes of existing properties.
|
||||
* @param o Object on which to add or modify the properties. This can be a native JavaScript object or a DOM object.
|
||||
* @param properties JavaScript object that contains one or more descriptor objects. Each descriptor object describes a data property or an accessor property.
|
||||
*/
|
||||
defineProperties(o: any, properties: PropertyDescriptorMap & ThisType<any>): any;
|
||||
defineProperties<T>(o: T, properties: PropertyDescriptorMap & ThisType<any>): T;
|
||||
|
||||
/**
|
||||
* Prevents the modification of attributes of existing properties, and prevents the addition of new properties.
|
||||
|
@ -1093,7 +1093,7 @@ interface ReadonlyArray<T> {
|
|||
*/
|
||||
toString(): string;
|
||||
/**
|
||||
* Returns a string representation of an array. The elements are converted to string using their toLocalString methods.
|
||||
* Returns a string representation of an array. The elements are converted to string using their toLocaleString methods.
|
||||
*/
|
||||
toLocaleString(): string;
|
||||
/**
|
||||
|
@ -1227,7 +1227,7 @@ interface Array<T> {
|
|||
*/
|
||||
toString(): string;
|
||||
/**
|
||||
* Returns a string representation of an array. The elements are converted to string using their toLocalString methods.
|
||||
* Returns a string representation of an array. The elements are converted to string using their toLocaleString methods.
|
||||
*/
|
||||
toLocaleString(): string;
|
||||
/**
|
||||
|
@ -1528,7 +1528,7 @@ type Parameters<T extends (...args: any) => any> = T extends (...args: infer P)
|
|||
/**
|
||||
* Obtain the parameters of a constructor function type in a tuple
|
||||
*/
|
||||
type ConstructorParameters<T extends new (...args: any) => any> = T extends new (...args: infer P) => any ? P : never;
|
||||
type ConstructorParameters<T extends abstract new (...args: any) => any> = T extends abstract new (...args: infer P) => any ? P : never;
|
||||
|
||||
/**
|
||||
* Obtain the return type of a function type
|
||||
|
@ -1538,7 +1538,7 @@ type ReturnType<T extends (...args: any) => any> = T extends (...args: any) => i
|
|||
/**
|
||||
* Obtain the return type of a constructor function type
|
||||
*/
|
||||
type InstanceType<T extends new (...args: any) => any> = T extends new (...args: any) => infer R ? R : any;
|
||||
type InstanceType<T extends abstract new (...args: any) => any> = T extends abstract new (...args: any) => infer R ? R : any;
|
||||
|
||||
/**
|
||||
* Convert string literal type to uppercase
|
||||
|
|
5
cli/dts/lib.esnext.d.ts
vendored
5
cli/dts/lib.esnext.d.ts
vendored
|
@ -18,8 +18,5 @@ and limitations under the License.
|
|||
/// <reference no-default-lib="true"/>
|
||||
|
||||
|
||||
/// <reference lib="es2020" />
|
||||
/// <reference lib="es2021" />
|
||||
/// <reference lib="esnext.intl" />
|
||||
/// <reference lib="esnext.string" />
|
||||
/// <reference lib="esnext.promise" />
|
||||
/// <reference lib="esnext.weakref" />
|
||||
|
|
81
cli/dts/lib.webworker.d.ts
vendored
81
cli/dts/lib.webworker.d.ts
vendored
|
@ -382,11 +382,6 @@ interface PushPermissionDescriptor extends PermissionDescriptor {
|
|||
userVisibleOnly?: boolean;
|
||||
}
|
||||
|
||||
interface PushSubscriptionChangeEventInit extends ExtendableEventInit {
|
||||
newSubscription?: PushSubscription;
|
||||
oldSubscription?: PushSubscription;
|
||||
}
|
||||
|
||||
interface PushSubscriptionJSON {
|
||||
endpoint?: string;
|
||||
expirationTime?: number | null;
|
||||
|
@ -1570,7 +1565,6 @@ declare var ExtendableMessageEvent: {
|
|||
interface FetchEvent extends ExtendableEvent {
|
||||
readonly clientId: string;
|
||||
readonly preloadResponse: Promise<any>;
|
||||
readonly replacesClientId: string;
|
||||
readonly request: Request;
|
||||
readonly resultingClientId: string;
|
||||
respondWith(r: Response | Promise<Response>): void;
|
||||
|
@ -2722,16 +2716,6 @@ declare var PushSubscription: {
|
|||
new(): PushSubscription;
|
||||
};
|
||||
|
||||
interface PushSubscriptionChangeEvent extends ExtendableEvent {
|
||||
readonly newSubscription: PushSubscription | null;
|
||||
readonly oldSubscription: PushSubscription | null;
|
||||
}
|
||||
|
||||
declare var PushSubscriptionChangeEvent: {
|
||||
prototype: PushSubscriptionChangeEvent;
|
||||
new(type: string, eventInitDict?: PushSubscriptionChangeEventInit): PushSubscriptionChangeEvent;
|
||||
};
|
||||
|
||||
interface PushSubscriptionOptions {
|
||||
readonly applicationServerKey: ArrayBuffer | null;
|
||||
readonly userVisibleOnly: boolean;
|
||||
|
@ -2933,7 +2917,6 @@ interface ServiceWorkerGlobalScopeEventMap extends WorkerGlobalScopeEventMap {
|
|||
"notificationclick": NotificationEvent;
|
||||
"notificationclose": NotificationEvent;
|
||||
"push": PushEvent;
|
||||
"pushsubscriptionchange": PushSubscriptionChangeEvent;
|
||||
"sync": SyncEvent;
|
||||
}
|
||||
|
||||
|
@ -2948,7 +2931,6 @@ interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
|
|||
onnotificationclick: ((this: ServiceWorkerGlobalScope, ev: NotificationEvent) => any) | null;
|
||||
onnotificationclose: ((this: ServiceWorkerGlobalScope, ev: NotificationEvent) => any) | null;
|
||||
onpush: ((this: ServiceWorkerGlobalScope, ev: PushEvent) => any) | null;
|
||||
onpushsubscriptionchange: ((this: ServiceWorkerGlobalScope, ev: PushSubscriptionChangeEvent) => any) | null;
|
||||
onsync: ((this: ServiceWorkerGlobalScope, ev: SyncEvent) => any) | null;
|
||||
readonly registration: ServiceWorkerRegistration;
|
||||
readonly serviceWorker: ServiceWorker;
|
||||
|
@ -3194,34 +3176,6 @@ interface TextMetrics {
|
|||
* Returns the measurement described below.
|
||||
*/
|
||||
readonly actualBoundingBoxRight: number;
|
||||
/**
|
||||
* Returns the measurement described below.
|
||||
*/
|
||||
readonly alphabeticBaseline: number;
|
||||
/**
|
||||
* Returns the measurement described below.
|
||||
*/
|
||||
readonly emHeightAscent: number;
|
||||
/**
|
||||
* Returns the measurement described below.
|
||||
*/
|
||||
readonly emHeightDescent: number;
|
||||
/**
|
||||
* Returns the measurement described below.
|
||||
*/
|
||||
readonly fontBoundingBoxAscent: number;
|
||||
/**
|
||||
* Returns the measurement described below.
|
||||
*/
|
||||
readonly fontBoundingBoxDescent: number;
|
||||
/**
|
||||
* Returns the measurement described below.
|
||||
*/
|
||||
readonly hangingBaseline: number;
|
||||
/**
|
||||
* Returns the measurement described below.
|
||||
*/
|
||||
readonly ideographicBaseline: number;
|
||||
/**
|
||||
* Returns the measurement described below.
|
||||
*/
|
||||
|
@ -4407,7 +4361,7 @@ declare var WebGLActiveInfo: {
|
|||
};
|
||||
|
||||
/** Part of the WebGL API and represents an opaque buffer object storing data such as vertices or colors. */
|
||||
interface WebGLBuffer extends WebGLObject {
|
||||
interface WebGLBuffer {
|
||||
}
|
||||
|
||||
declare var WebGLBuffer: {
|
||||
|
@ -4426,7 +4380,7 @@ declare var WebGLContextEvent: {
|
|||
};
|
||||
|
||||
/** Part of the WebGL API and represents a collection of buffers that serve as a rendering destination. */
|
||||
interface WebGLFramebuffer extends WebGLObject {
|
||||
interface WebGLFramebuffer {
|
||||
}
|
||||
|
||||
declare var WebGLFramebuffer: {
|
||||
|
@ -4434,16 +4388,8 @@ declare var WebGLFramebuffer: {
|
|||
new(): WebGLFramebuffer;
|
||||
};
|
||||
|
||||
interface WebGLObject {
|
||||
}
|
||||
|
||||
declare var WebGLObject: {
|
||||
prototype: WebGLObject;
|
||||
new(): WebGLObject;
|
||||
};
|
||||
|
||||
/** The WebGLProgram is part of the WebGL API and is a combination of two compiled WebGLShaders consisting of a vertex shader and a fragment shader (both written in GLSL). */
|
||||
interface WebGLProgram extends WebGLObject {
|
||||
interface WebGLProgram {
|
||||
}
|
||||
|
||||
declare var WebGLProgram: {
|
||||
|
@ -4451,7 +4397,7 @@ declare var WebGLProgram: {
|
|||
new(): WebGLProgram;
|
||||
};
|
||||
|
||||
interface WebGLQuery extends WebGLObject {
|
||||
interface WebGLQuery {
|
||||
}
|
||||
|
||||
declare var WebGLQuery: {
|
||||
|
@ -4460,7 +4406,7 @@ declare var WebGLQuery: {
|
|||
};
|
||||
|
||||
/** Part of the WebGL API and represents a buffer that can contain an image, or can be source or target of an rendering operation. */
|
||||
interface WebGLRenderbuffer extends WebGLObject {
|
||||
interface WebGLRenderbuffer {
|
||||
}
|
||||
|
||||
declare var WebGLRenderbuffer: {
|
||||
|
@ -5239,7 +5185,7 @@ interface WebGLRenderingContextOverloads {
|
|||
uniformMatrix4fv(location: WebGLUniformLocation | null, transpose: GLboolean, value: Float32List): void;
|
||||
}
|
||||
|
||||
interface WebGLSampler extends WebGLObject {
|
||||
interface WebGLSampler {
|
||||
}
|
||||
|
||||
declare var WebGLSampler: {
|
||||
|
@ -5248,7 +5194,7 @@ declare var WebGLSampler: {
|
|||
};
|
||||
|
||||
/** The WebGLShader is part of the WebGL API and can either be a vertex or a fragment shader. A WebGLProgram requires both types of shaders. */
|
||||
interface WebGLShader extends WebGLObject {
|
||||
interface WebGLShader {
|
||||
}
|
||||
|
||||
declare var WebGLShader: {
|
||||
|
@ -5268,7 +5214,7 @@ declare var WebGLShaderPrecisionFormat: {
|
|||
new(): WebGLShaderPrecisionFormat;
|
||||
};
|
||||
|
||||
interface WebGLSync extends WebGLObject {
|
||||
interface WebGLSync {
|
||||
}
|
||||
|
||||
declare var WebGLSync: {
|
||||
|
@ -5277,7 +5223,7 @@ declare var WebGLSync: {
|
|||
};
|
||||
|
||||
/** Part of the WebGL API and represents an opaque texture object providing storage and state for texturing operations. */
|
||||
interface WebGLTexture extends WebGLObject {
|
||||
interface WebGLTexture {
|
||||
}
|
||||
|
||||
declare var WebGLTexture: {
|
||||
|
@ -5285,7 +5231,7 @@ declare var WebGLTexture: {
|
|||
new(): WebGLTexture;
|
||||
};
|
||||
|
||||
interface WebGLTransformFeedback extends WebGLObject {
|
||||
interface WebGLTransformFeedback {
|
||||
}
|
||||
|
||||
declare var WebGLTransformFeedback: {
|
||||
|
@ -5302,7 +5248,7 @@ declare var WebGLUniformLocation: {
|
|||
new(): WebGLUniformLocation;
|
||||
};
|
||||
|
||||
interface WebGLVertexArrayObject extends WebGLObject {
|
||||
interface WebGLVertexArrayObject {
|
||||
}
|
||||
|
||||
declare var WebGLVertexArrayObject: {
|
||||
|
@ -5310,7 +5256,7 @@ declare var WebGLVertexArrayObject: {
|
|||
new(): WebGLVertexArrayObject;
|
||||
};
|
||||
|
||||
interface WebGLVertexArrayObjectOES extends WebGLObject {
|
||||
interface WebGLVertexArrayObjectOES {
|
||||
}
|
||||
|
||||
interface WebSocketEventMap {
|
||||
|
@ -5383,7 +5329,6 @@ declare var WebSocket: {
|
|||
|
||||
/** This ServiceWorker API interface represents the scope of a service worker client that is a document in a browser context, controlled by an active worker. The service worker client independently selects and uses a service worker for its own loading and sub-resources. */
|
||||
interface WindowClient extends Client {
|
||||
readonly ancestorOrigins: ReadonlyArray<string>;
|
||||
readonly focused: boolean;
|
||||
readonly visibilityState: VisibilityState;
|
||||
focus(): Promise<WindowClient>;
|
||||
|
@ -5506,7 +5451,6 @@ declare var WorkerLocation: {
|
|||
/** A subset of the Navigator interface allowed to be accessed from a Worker. Such an object is initialized for each worker and is available via the WorkerGlobalScope.navigator property obtained by calling window.self.navigator. */
|
||||
interface WorkerNavigator extends NavigatorConcurrentHardware, NavigatorID, NavigatorLanguage, NavigatorOnLine, NavigatorStorage {
|
||||
readonly permissions: Permissions;
|
||||
readonly serviceWorker: ServiceWorkerContainer;
|
||||
}
|
||||
|
||||
declare var WorkerNavigator: {
|
||||
|
@ -5793,6 +5737,7 @@ declare namespace WebAssembly {
|
|||
interface MemoryDescriptor {
|
||||
initial: number;
|
||||
maximum?: number;
|
||||
shared?: boolean;
|
||||
}
|
||||
|
||||
interface ModuleExportDescriptor {
|
||||
|
|
873
cli/dts/typescript.d.ts
vendored
873
cli/dts/typescript.d.ts
vendored
File diff suppressed because it is too large
Load diff
|
@ -183,36 +183,45 @@ fn display_parts_to_string(parts: &[SymbolDisplayPart]) -> String {
|
|||
}
|
||||
|
||||
fn get_tag_body_text(tag: &JsDocTagInfo) -> Option<String> {
|
||||
tag.text.as_ref().map(|text| match tag.name.as_str() {
|
||||
tag.text.as_ref().map(|display_parts| {
|
||||
// TODO(@kitsonk) check logic in vscode about handling this API change in
|
||||
// tsserver
|
||||
let text = display_parts_to_string(display_parts);
|
||||
match tag.name.as_str() {
|
||||
"example" => {
|
||||
let caption_regex =
|
||||
Regex::new(r"<caption>(.*?)</caption>\s*\r?\n((?:\s|\S)*)").unwrap();
|
||||
if caption_regex.is_match(&text) {
|
||||
caption_regex
|
||||
.replace(text, |c: &Captures| {
|
||||
.replace(&text, |c: &Captures| {
|
||||
format!("{}\n\n{}", &c[1], make_codeblock(&c[2]))
|
||||
})
|
||||
.to_string()
|
||||
} else {
|
||||
make_codeblock(text)
|
||||
make_codeblock(&text)
|
||||
}
|
||||
}
|
||||
"author" => {
|
||||
let email_match_regex = Regex::new(r"(.+)\s<([-.\w]+@[-.\w]+)>").unwrap();
|
||||
let email_match_regex =
|
||||
Regex::new(r"(.+)\s<([-.\w]+@[-.\w]+)>").unwrap();
|
||||
email_match_regex
|
||||
.replace(text, |c: &Captures| format!("{} {}", &c[1], &c[2]))
|
||||
.replace(&text, |c: &Captures| format!("{} {}", &c[1], &c[2]))
|
||||
.to_string()
|
||||
}
|
||||
"default" => make_codeblock(text),
|
||||
_ => replace_links(text),
|
||||
"default" => make_codeblock(&text),
|
||||
_ => replace_links(&text),
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
fn get_tag_documentation(tag: &JsDocTagInfo) -> String {
|
||||
match tag.name.as_str() {
|
||||
"augments" | "extends" | "param" | "template" => {
|
||||
if let Some(text) = &tag.text {
|
||||
if let Some(display_parts) = &tag.text {
|
||||
let part_regex = Regex::new(r"^(\S+)\s*-?\s*").unwrap();
|
||||
// TODO(@kitsonk) check logic in vscode about handling this API change
|
||||
// in tsserver
|
||||
let text = display_parts_to_string(display_parts);
|
||||
let body: Vec<&str> = part_regex.split(&text).collect();
|
||||
if body.len() == 3 {
|
||||
let param = body[1];
|
||||
|
@ -474,7 +483,7 @@ pub struct SymbolDisplayPart {
|
|||
#[serde(rename_all = "camelCase")]
|
||||
pub struct JsDocTagInfo {
|
||||
name: String,
|
||||
text: Option<String>,
|
||||
text: Option<Vec<SymbolDisplayPart>>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
|
@ -2703,7 +2712,7 @@ mod tests {
|
|||
"character": 7
|
||||
},
|
||||
"fileName": "file:///a.ts",
|
||||
"messageText": "Cannot find name 'console'. Do you need to change your target library? Try changing the `lib` compiler option to include 'dom'.",
|
||||
"messageText": "Cannot find name 'console'. Do you need to change your target library? Try changing the \'lib\' compiler option to include 'dom'.",
|
||||
"sourceLine": "console.log(\"hello deno\");",
|
||||
"category": 1,
|
||||
"code": 2584
|
||||
|
|
|
@ -7,6 +7,7 @@ unitTest(function version(): void {
|
|||
// Unreleased version of TypeScript now set the version to 0-dev
|
||||
assert(
|
||||
pattern.test(Deno.version.typescript) ||
|
||||
Deno.version.typescript === "0-dev",
|
||||
Deno.version.typescript === "0-dev" ||
|
||||
Deno.version.typescript === "0-beta",
|
||||
);
|
||||
});
|
||||
|
|
|
@ -73,6 +73,7 @@ lazy_static::lazy_static! {
|
|||
("lib.es2018.full.d.ts", inc!("lib.es2018.full.d.ts")),
|
||||
("lib.es2019.full.d.ts", inc!("lib.es2019.full.d.ts")),
|
||||
("lib.es2020.full.d.ts", inc!("lib.es2020.full.d.ts")),
|
||||
("lib.es2021.full.d.ts", inc!("lib.es2021.full.d.ts")),
|
||||
("lib.esnext.full.d.ts", inc!("lib.esnext.full.d.ts")),
|
||||
("lib.scripthost.d.ts", inc!("lib.scripthost.d.ts")),
|
||||
("lib.webworker.d.ts", inc!("lib.webworker.d.ts")),
|
||||
|
|
23381
cli/tsc/00_typescript.js
vendored
23381
cli/tsc/00_typescript.js
vendored
File diff suppressed because it is too large
Load diff
|
@ -287,20 +287,20 @@
|
|||
return finalBuffer;
|
||||
}
|
||||
|
||||
#createBoundary = () => {
|
||||
#createBoundary() {
|
||||
return (
|
||||
"----------" +
|
||||
Array.from(Array(32))
|
||||
.map(() => Math.random().toString(36)[2] || 0)
|
||||
.join("")
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {[string, string][]} headers
|
||||
* @returns {void}
|
||||
*/
|
||||
#writeHeaders = (headers) => {
|
||||
#writeHeaders(headers) {
|
||||
let buf = (this.chunks.length === 0) ? "" : "\r\n";
|
||||
|
||||
buf += `--${this.boundary}\r\n`;
|
||||
|
@ -310,7 +310,7 @@
|
|||
buf += `\r\n`;
|
||||
|
||||
this.chunks.push(encoder.encode(buf));
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} field
|
||||
|
@ -318,11 +318,11 @@
|
|||
* @param {string} [type]
|
||||
* @returns {void}
|
||||
*/
|
||||
#writeFileHeaders = (
|
||||
#writeFileHeaders(
|
||||
field,
|
||||
filename,
|
||||
type,
|
||||
) => {
|
||||
) {
|
||||
/** @type {[string, string][]} */
|
||||
const headers = [
|
||||
[
|
||||
|
@ -332,37 +332,37 @@
|
|||
["Content-Type", type || "application/octet-stream"],
|
||||
];
|
||||
return this.#writeHeaders(headers);
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} field
|
||||
* @returns {void}
|
||||
*/
|
||||
#writeFieldHeaders = (field) => {
|
||||
#writeFieldHeaders(field) {
|
||||
/** @type {[string, string][]} */
|
||||
const headers = [["Content-Disposition", `form-data; name="${field}"`]];
|
||||
return this.#writeHeaders(headers);
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} field
|
||||
* @param {string} value
|
||||
* @returns {void}
|
||||
*/
|
||||
#writeField = (field, value) => {
|
||||
#writeField(field, value) {
|
||||
this.#writeFieldHeaders(field);
|
||||
this.chunks.push(encoder.encode(value));
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} field
|
||||
* @param {File} value
|
||||
* @returns {void}
|
||||
*/
|
||||
#writeFile = (field, value) => {
|
||||
#writeFile(field, value) {
|
||||
this.#writeFileHeaders(field, value.name, value.type);
|
||||
this.chunks.push(value[_byteSequence]);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -418,7 +418,7 @@
|
|||
* @param {string} headersText
|
||||
* @returns {{ headers: Headers, disposition: Map<string, string> }}
|
||||
*/
|
||||
#parseHeaders = (headersText) => {
|
||||
#parseHeaders(headersText) {
|
||||
const headers = new Headers();
|
||||
const rawHeaders = headersText.split("\r\n");
|
||||
for (const rawHeader of rawHeaders) {
|
||||
|
@ -436,7 +436,7 @@
|
|||
);
|
||||
|
||||
return { headers, disposition };
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {FormData}
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
* @param {Blob} blob
|
||||
* @param {{kind: "ArrayBuffer" | "Text" | "DataUrl" | "BinaryString", encoding?: string}} readtype
|
||||
*/
|
||||
#readOperation = (blob, readtype) => {
|
||||
#readOperation(blob, readtype) {
|
||||
// 1. If fr’s state is "loading", throw an InvalidStateError DOMException.
|
||||
if (this[state] === "loading") {
|
||||
throw new DOMException(
|
||||
|
@ -221,7 +221,7 @@
|
|||
}
|
||||
}
|
||||
})();
|
||||
};
|
||||
}
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
|
|
|
@ -58,14 +58,14 @@
|
|||
urls.set(this, null);
|
||||
}
|
||||
|
||||
#updateUrlSearch = () => {
|
||||
#updateUrlSearch() {
|
||||
const url = urls.get(this);
|
||||
if (url == null) {
|
||||
return;
|
||||
}
|
||||
const parseArgs = { href: url.href, setSearch: this.toString() };
|
||||
parts.set(url, core.opSync("op_url_parse", parseArgs));
|
||||
};
|
||||
}
|
||||
|
||||
append(name, value) {
|
||||
requiredArguments("URLSearchParams.append", arguments.length, 2);
|
||||
|
@ -227,7 +227,7 @@
|
|||
return `${this.constructor.name} ${inspect(object)}`;
|
||||
}
|
||||
|
||||
#updateSearchParams = () => {
|
||||
#updateSearchParams() {
|
||||
if (this.#searchParams != null) {
|
||||
const params = paramLists.get(this.#searchParams);
|
||||
const newParams = core.opSync(
|
||||
|
@ -236,7 +236,7 @@
|
|||
);
|
||||
params.splice(0, params.length, ...newParams);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
get hash() {
|
||||
return parts.get(this).hash;
|
||||
|
|
|
@ -192,16 +192,16 @@
|
|||
this.#poll();
|
||||
}
|
||||
|
||||
#handleMessage = (data) => {
|
||||
#handleMessage(data) {
|
||||
const msgEvent = new MessageEvent("message", {
|
||||
cancelable: false,
|
||||
data,
|
||||
});
|
||||
|
||||
this.dispatchEvent(msgEvent);
|
||||
};
|
||||
}
|
||||
|
||||
#handleError = (e) => {
|
||||
#handleError(e) {
|
||||
const event = new ErrorEvent("error", {
|
||||
cancelable: true,
|
||||
message: e.message,
|
||||
|
@ -219,7 +219,7 @@
|
|||
}
|
||||
|
||||
return handled;
|
||||
};
|
||||
}
|
||||
|
||||
#poll = async () => {
|
||||
while (!this.#terminated) {
|
||||
|
|
|
@ -73,19 +73,19 @@
|
|||
this.#off = 0;
|
||||
}
|
||||
|
||||
#tryGrowByReslice = (n) => {
|
||||
#tryGrowByReslice(n) {
|
||||
const l = this.#buf.byteLength;
|
||||
if (n <= this.capacity - l) {
|
||||
this.#reslice(l + n);
|
||||
return l;
|
||||
}
|
||||
return -1;
|
||||
};
|
||||
}
|
||||
|
||||
#reslice = (len) => {
|
||||
#reslice(len) {
|
||||
assert(len <= this.#buf.buffer.byteLength);
|
||||
this.#buf = new Uint8Array(this.#buf.buffer, 0, len);
|
||||
};
|
||||
}
|
||||
|
||||
readSync(p) {
|
||||
if (this.empty()) {
|
||||
|
@ -117,7 +117,7 @@
|
|||
return Promise.resolve(n);
|
||||
}
|
||||
|
||||
#grow = (n) => {
|
||||
#grow(n) {
|
||||
const m = this.length;
|
||||
// If buffer is empty, reset to recover space.
|
||||
if (m === 0 && this.#off !== 0) {
|
||||
|
@ -147,7 +147,7 @@
|
|||
this.#off = 0;
|
||||
this.#reslice(Math.min(m + n, MAX_SIZE));
|
||||
return m;
|
||||
};
|
||||
}
|
||||
|
||||
grow(n) {
|
||||
if (n < 0) {
|
||||
|
|
Loading…
Add table
Reference in a new issue