mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Forbid accessing block-scoped variables on globalThis (#30510)
* Forbid accessing const & let on globalThis It's just an error; you still get the type of the property. * Disallow access of blockscoped vars on globalThis Also change Array, Function, String, et al from `const` to `var` so that they remain accessible via `globalThis.String`. * Update baselines after lib.d.ts change Note especially the change in redefineArray, which is now allowed as long as you provide a type that is assignable to ArrayConstructor. * Remove blockscoped vars from typeof globalThis Unlike forbidding them, this removes the properties entirely. Unfortunately, this means that accessing these properties is only an error with noImplicitAny, and that error is quite confusing. Let's discuss our options. I see 3: 1. Forbid access of block-scoped vars as properties (in all flag settings), but leave them on the type. Simple to implement. 2. Remove block-scoped vars from the globalThis type. Has the bad error/flag behaviour described above, but simple to implement. 3. Remove block-scoped vars from the globalThis type. Also, forbid accessing them by executing another resolveName lookup for failed property accesses on globalThisSymbol. If the second lookup returns a blockscoped var, issue an error instead of falling back to the index signature. This seems too complex to me. * Update baselines * Better error for block-scoped usage on globalThis So that value-space references have as clear an error as type-space references. * Update fourslash tests * Fix semi-colon lint * Don't copy so much when filtering blockscoped vars
This commit is contained in:
+18
-2
@@ -7116,6 +7116,15 @@ namespace ts {
|
||||
let stringIndexInfo: IndexInfo | undefined;
|
||||
if (symbol.exports) {
|
||||
members = getExportsOfSymbol(symbol);
|
||||
if (symbol === globalThisSymbol) {
|
||||
const varsOnly = createMap<Symbol>() as SymbolTable;
|
||||
members.forEach(p => {
|
||||
if (!(p.flags & SymbolFlags.BlockScoped)) {
|
||||
varsOnly.set(p.escapedName, p);
|
||||
}
|
||||
});
|
||||
members = varsOnly;
|
||||
}
|
||||
}
|
||||
setStructuredTypeMembers(type, members, emptyArray, emptyArray, undefined, undefined);
|
||||
if (symbol.flags & SymbolFlags.Class) {
|
||||
@@ -9877,6 +9886,7 @@ namespace ts {
|
||||
getNodeLinks(accessNode!).resolvedSymbol = prop;
|
||||
}
|
||||
}
|
||||
|
||||
const propType = getTypeOfSymbol(prop);
|
||||
return accessExpression && getAssignmentTargetKind(accessExpression) !== AssignmentKind.Definite ?
|
||||
getFlowTypeOfReference(accessExpression, propType) :
|
||||
@@ -9920,7 +9930,10 @@ namespace ts {
|
||||
return anyType;
|
||||
}
|
||||
if (accessExpression && !isConstEnumObjectType(objectType)) {
|
||||
if (noImplicitAny && !compilerOptions.suppressImplicitAnyIndexErrors) {
|
||||
if (objectType.symbol === globalThisSymbol && propName !== undefined && globalThisSymbol.exports!.has(propName) && (globalThisSymbol.exports!.get(propName)!.flags & SymbolFlags.BlockScoped)) {
|
||||
error(accessExpression, Diagnostics.Property_0_does_not_exist_on_type_1, unescapeLeadingUnderscores(propName), typeToString(objectType));
|
||||
}
|
||||
else if (noImplicitAny && !compilerOptions.suppressImplicitAnyIndexErrors) {
|
||||
if (propName !== undefined && typeHasStaticProperty(propName, objectType)) {
|
||||
error(accessExpression, Diagnostics.Property_0_is_a_static_member_of_type_1, propName as string, typeToString(objectType));
|
||||
}
|
||||
@@ -19515,7 +19528,10 @@ namespace ts {
|
||||
return anyType;
|
||||
}
|
||||
if (leftType.symbol === globalThisSymbol) {
|
||||
if (noImplicitAny) {
|
||||
if (globalThisSymbol.exports!.has(right.escapedText) && (globalThisSymbol.exports!.get(right.escapedText)!.flags & SymbolFlags.BlockScoped)) {
|
||||
error(right, Diagnostics.Property_0_does_not_exist_on_type_1, unescapeLeadingUnderscores(right.escapedText), typeToString(leftType));
|
||||
}
|
||||
else if (noImplicitAny) {
|
||||
error(right, Diagnostics.Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature, typeToString(leftType));
|
||||
}
|
||||
return anyType;
|
||||
|
||||
+59
-59
@@ -4425,7 +4425,7 @@ namespace FourSlashInterface {
|
||||
}
|
||||
export namespace Completion {
|
||||
const functionEntry = (name: string): ExpectedCompletionEntryObject => ({ name, kind: "function", kindModifiers: "declare" });
|
||||
const constEntry = (name: string): ExpectedCompletionEntryObject => ({ name, kind: "const", kindModifiers: "declare" });
|
||||
const varEntry = (name: string): ExpectedCompletionEntryObject => ({ name, kind: "var", kindModifiers: "declare" });
|
||||
const moduleEntry = (name: string): ExpectedCompletionEntryObject => ({ name, kind: "module", kindModifiers: "declare" });
|
||||
const keywordEntry = (name: string): ExpectedCompletionEntryObject => ({ name, kind: "keyword" });
|
||||
const methodEntry = (name: string): ExpectedCompletionEntryObject => ({ name, kind: "method", kindModifiers: "declare" });
|
||||
@@ -4448,48 +4448,48 @@ namespace FourSlashInterface {
|
||||
typeEntry("PropertyKey"),
|
||||
interfaceEntry("PropertyDescriptor"),
|
||||
interfaceEntry("PropertyDescriptorMap"),
|
||||
constEntry("Object"),
|
||||
varEntry("Object"),
|
||||
interfaceEntry("ObjectConstructor"),
|
||||
constEntry("Function"),
|
||||
varEntry("Function"),
|
||||
interfaceEntry("FunctionConstructor"),
|
||||
typeEntry("ThisParameterType"),
|
||||
typeEntry("OmitThisParameter"),
|
||||
interfaceEntry("CallableFunction"),
|
||||
interfaceEntry("NewableFunction"),
|
||||
interfaceEntry("IArguments"),
|
||||
constEntry("String"),
|
||||
varEntry("String"),
|
||||
interfaceEntry("StringConstructor"),
|
||||
constEntry("Boolean"),
|
||||
varEntry("Boolean"),
|
||||
interfaceEntry("BooleanConstructor"),
|
||||
constEntry("Number"),
|
||||
varEntry("Number"),
|
||||
interfaceEntry("NumberConstructor"),
|
||||
interfaceEntry("TemplateStringsArray"),
|
||||
interfaceEntry("ImportMeta"),
|
||||
constEntry("Math"),
|
||||
constEntry("Date"),
|
||||
varEntry("Math"),
|
||||
varEntry("Date"),
|
||||
interfaceEntry("DateConstructor"),
|
||||
interfaceEntry("RegExpMatchArray"),
|
||||
interfaceEntry("RegExpExecArray"),
|
||||
constEntry("RegExp"),
|
||||
varEntry("RegExp"),
|
||||
interfaceEntry("RegExpConstructor"),
|
||||
constEntry("Error"),
|
||||
varEntry("Error"),
|
||||
interfaceEntry("ErrorConstructor"),
|
||||
constEntry("EvalError"),
|
||||
varEntry("EvalError"),
|
||||
interfaceEntry("EvalErrorConstructor"),
|
||||
constEntry("RangeError"),
|
||||
varEntry("RangeError"),
|
||||
interfaceEntry("RangeErrorConstructor"),
|
||||
constEntry("ReferenceError"),
|
||||
varEntry("ReferenceError"),
|
||||
interfaceEntry("ReferenceErrorConstructor"),
|
||||
constEntry("SyntaxError"),
|
||||
varEntry("SyntaxError"),
|
||||
interfaceEntry("SyntaxErrorConstructor"),
|
||||
constEntry("TypeError"),
|
||||
varEntry("TypeError"),
|
||||
interfaceEntry("TypeErrorConstructor"),
|
||||
constEntry("URIError"),
|
||||
varEntry("URIError"),
|
||||
interfaceEntry("URIErrorConstructor"),
|
||||
constEntry("JSON"),
|
||||
varEntry("JSON"),
|
||||
interfaceEntry("ReadonlyArray"),
|
||||
interfaceEntry("ConcatArray"),
|
||||
constEntry("Array"),
|
||||
varEntry("Array"),
|
||||
interfaceEntry("ArrayConstructor"),
|
||||
interfaceEntry("TypedPropertyDescriptor"),
|
||||
typeEntry("ClassDecorator"),
|
||||
@@ -4513,30 +4513,30 @@ namespace FourSlashInterface {
|
||||
typeEntry("ReturnType"),
|
||||
typeEntry("InstanceType"),
|
||||
interfaceEntry("ThisType"),
|
||||
constEntry("ArrayBuffer"),
|
||||
varEntry("ArrayBuffer"),
|
||||
interfaceEntry("ArrayBufferTypes"),
|
||||
typeEntry("ArrayBufferLike"),
|
||||
interfaceEntry("ArrayBufferConstructor"),
|
||||
interfaceEntry("ArrayBufferView"),
|
||||
constEntry("DataView"),
|
||||
varEntry("DataView"),
|
||||
interfaceEntry("DataViewConstructor"),
|
||||
constEntry("Int8Array"),
|
||||
varEntry("Int8Array"),
|
||||
interfaceEntry("Int8ArrayConstructor"),
|
||||
constEntry("Uint8Array"),
|
||||
varEntry("Uint8Array"),
|
||||
interfaceEntry("Uint8ArrayConstructor"),
|
||||
constEntry("Uint8ClampedArray"),
|
||||
varEntry("Uint8ClampedArray"),
|
||||
interfaceEntry("Uint8ClampedArrayConstructor"),
|
||||
constEntry("Int16Array"),
|
||||
varEntry("Int16Array"),
|
||||
interfaceEntry("Int16ArrayConstructor"),
|
||||
constEntry("Uint16Array"),
|
||||
varEntry("Uint16Array"),
|
||||
interfaceEntry("Uint16ArrayConstructor"),
|
||||
constEntry("Int32Array"),
|
||||
varEntry("Int32Array"),
|
||||
interfaceEntry("Int32ArrayConstructor"),
|
||||
constEntry("Uint32Array"),
|
||||
varEntry("Uint32Array"),
|
||||
interfaceEntry("Uint32ArrayConstructor"),
|
||||
constEntry("Float32Array"),
|
||||
varEntry("Float32Array"),
|
||||
interfaceEntry("Float32ArrayConstructor"),
|
||||
constEntry("Float64Array"),
|
||||
varEntry("Float64Array"),
|
||||
interfaceEntry("Float64ArrayConstructor"),
|
||||
moduleEntry("Intl"),
|
||||
];
|
||||
@@ -4744,36 +4744,36 @@ namespace FourSlashInterface {
|
||||
functionEntry("encodeURIComponent"),
|
||||
functionEntry("escape"),
|
||||
functionEntry("unescape"),
|
||||
constEntry("NaN"),
|
||||
constEntry("Infinity"),
|
||||
constEntry("Object"),
|
||||
constEntry("Function"),
|
||||
constEntry("String"),
|
||||
constEntry("Boolean"),
|
||||
constEntry("Number"),
|
||||
constEntry("Math"),
|
||||
constEntry("Date"),
|
||||
constEntry("RegExp"),
|
||||
constEntry("Error"),
|
||||
constEntry("EvalError"),
|
||||
constEntry("RangeError"),
|
||||
constEntry("ReferenceError"),
|
||||
constEntry("SyntaxError"),
|
||||
constEntry("TypeError"),
|
||||
constEntry("URIError"),
|
||||
constEntry("JSON"),
|
||||
constEntry("Array"),
|
||||
constEntry("ArrayBuffer"),
|
||||
constEntry("DataView"),
|
||||
constEntry("Int8Array"),
|
||||
constEntry("Uint8Array"),
|
||||
constEntry("Uint8ClampedArray"),
|
||||
constEntry("Int16Array"),
|
||||
constEntry("Uint16Array"),
|
||||
constEntry("Int32Array"),
|
||||
constEntry("Uint32Array"),
|
||||
constEntry("Float32Array"),
|
||||
constEntry("Float64Array"),
|
||||
varEntry("NaN"),
|
||||
varEntry("Infinity"),
|
||||
varEntry("Object"),
|
||||
varEntry("Function"),
|
||||
varEntry("String"),
|
||||
varEntry("Boolean"),
|
||||
varEntry("Number"),
|
||||
varEntry("Math"),
|
||||
varEntry("Date"),
|
||||
varEntry("RegExp"),
|
||||
varEntry("Error"),
|
||||
varEntry("EvalError"),
|
||||
varEntry("RangeError"),
|
||||
varEntry("ReferenceError"),
|
||||
varEntry("SyntaxError"),
|
||||
varEntry("TypeError"),
|
||||
varEntry("URIError"),
|
||||
varEntry("JSON"),
|
||||
varEntry("Array"),
|
||||
varEntry("ArrayBuffer"),
|
||||
varEntry("DataView"),
|
||||
varEntry("Int8Array"),
|
||||
varEntry("Uint8Array"),
|
||||
varEntry("Uint8ClampedArray"),
|
||||
varEntry("Int16Array"),
|
||||
varEntry("Uint16Array"),
|
||||
varEntry("Int32Array"),
|
||||
varEntry("Uint32Array"),
|
||||
varEntry("Float32Array"),
|
||||
varEntry("Float64Array"),
|
||||
moduleEntry("Intl"),
|
||||
];
|
||||
|
||||
|
||||
Vendored
+30
-30
@@ -2,8 +2,8 @@
|
||||
/// ECMAScript APIs
|
||||
/////////////////////////////
|
||||
|
||||
declare const NaN: number;
|
||||
declare const Infinity: number;
|
||||
declare var NaN: number;
|
||||
declare var Infinity: number;
|
||||
|
||||
/**
|
||||
* Evaluates JavaScript code and executes it.
|
||||
@@ -244,7 +244,7 @@ interface ObjectConstructor {
|
||||
/**
|
||||
* Provides functionality common to all JavaScript objects.
|
||||
*/
|
||||
declare const Object: ObjectConstructor;
|
||||
declare var Object: ObjectConstructor;
|
||||
|
||||
/**
|
||||
* Creates a new function.
|
||||
@@ -293,7 +293,7 @@ interface FunctionConstructor {
|
||||
readonly prototype: Function;
|
||||
}
|
||||
|
||||
declare const Function: FunctionConstructor;
|
||||
declare var Function: FunctionConstructor;
|
||||
|
||||
/**
|
||||
* Extracts the type of the 'this' parameter of a function type, or 'unknown' if the function type has no 'this' parameter.
|
||||
@@ -504,7 +504,7 @@ interface StringConstructor {
|
||||
/**
|
||||
* Allows manipulation and formatting of text strings and determination and location of substrings within strings.
|
||||
*/
|
||||
declare const String: StringConstructor;
|
||||
declare var String: StringConstructor;
|
||||
|
||||
interface Boolean {
|
||||
/** Returns the primitive value of the specified object. */
|
||||
@@ -517,7 +517,7 @@ interface BooleanConstructor {
|
||||
readonly prototype: Boolean;
|
||||
}
|
||||
|
||||
declare const Boolean: BooleanConstructor;
|
||||
declare var Boolean: BooleanConstructor;
|
||||
|
||||
interface Number {
|
||||
/**
|
||||
@@ -579,7 +579,7 @@ interface NumberConstructor {
|
||||
}
|
||||
|
||||
/** An object that represents a number of any kind. All JavaScript numbers are 64-bit floating-point numbers. */
|
||||
declare const Number: NumberConstructor;
|
||||
declare var Number: NumberConstructor;
|
||||
|
||||
interface TemplateStringsArray extends ReadonlyArray<string> {
|
||||
readonly raw: ReadonlyArray<string>;
|
||||
@@ -703,7 +703,7 @@ interface Math {
|
||||
tan(x: number): number;
|
||||
}
|
||||
/** An intrinsic object that provides basic mathematics functionality and constants. */
|
||||
declare const Math: Math;
|
||||
declare var Math: Math;
|
||||
|
||||
/** Enables basic storage and retrieval of dates and times. */
|
||||
interface Date {
|
||||
@@ -884,7 +884,7 @@ interface DateConstructor {
|
||||
now(): number;
|
||||
}
|
||||
|
||||
declare const Date: DateConstructor;
|
||||
declare var Date: DateConstructor;
|
||||
|
||||
interface RegExpMatchArray extends Array<string> {
|
||||
index?: number;
|
||||
@@ -947,7 +947,7 @@ interface RegExpConstructor {
|
||||
lastMatch: string;
|
||||
}
|
||||
|
||||
declare const RegExp: RegExpConstructor;
|
||||
declare var RegExp: RegExpConstructor;
|
||||
|
||||
interface Error {
|
||||
name: string;
|
||||
@@ -961,7 +961,7 @@ interface ErrorConstructor {
|
||||
readonly prototype: Error;
|
||||
}
|
||||
|
||||
declare const Error: ErrorConstructor;
|
||||
declare var Error: ErrorConstructor;
|
||||
|
||||
interface EvalError extends Error {
|
||||
}
|
||||
@@ -972,7 +972,7 @@ interface EvalErrorConstructor {
|
||||
readonly prototype: EvalError;
|
||||
}
|
||||
|
||||
declare const EvalError: EvalErrorConstructor;
|
||||
declare var EvalError: EvalErrorConstructor;
|
||||
|
||||
interface RangeError extends Error {
|
||||
}
|
||||
@@ -983,7 +983,7 @@ interface RangeErrorConstructor {
|
||||
readonly prototype: RangeError;
|
||||
}
|
||||
|
||||
declare const RangeError: RangeErrorConstructor;
|
||||
declare var RangeError: RangeErrorConstructor;
|
||||
|
||||
interface ReferenceError extends Error {
|
||||
}
|
||||
@@ -994,7 +994,7 @@ interface ReferenceErrorConstructor {
|
||||
readonly prototype: ReferenceError;
|
||||
}
|
||||
|
||||
declare const ReferenceError: ReferenceErrorConstructor;
|
||||
declare var ReferenceError: ReferenceErrorConstructor;
|
||||
|
||||
interface SyntaxError extends Error {
|
||||
}
|
||||
@@ -1005,7 +1005,7 @@ interface SyntaxErrorConstructor {
|
||||
readonly prototype: SyntaxError;
|
||||
}
|
||||
|
||||
declare const SyntaxError: SyntaxErrorConstructor;
|
||||
declare var SyntaxError: SyntaxErrorConstructor;
|
||||
|
||||
interface TypeError extends Error {
|
||||
}
|
||||
@@ -1016,7 +1016,7 @@ interface TypeErrorConstructor {
|
||||
readonly prototype: TypeError;
|
||||
}
|
||||
|
||||
declare const TypeError: TypeErrorConstructor;
|
||||
declare var TypeError: TypeErrorConstructor;
|
||||
|
||||
interface URIError extends Error {
|
||||
}
|
||||
@@ -1027,7 +1027,7 @@ interface URIErrorConstructor {
|
||||
readonly prototype: URIError;
|
||||
}
|
||||
|
||||
declare const URIError: URIErrorConstructor;
|
||||
declare var URIError: URIErrorConstructor;
|
||||
|
||||
interface JSON {
|
||||
/**
|
||||
@@ -1056,7 +1056,7 @@ interface JSON {
|
||||
/**
|
||||
* An intrinsic object that provides functions to convert JavaScript values to and from the JavaScript Object Notation (JSON) format.
|
||||
*/
|
||||
declare const JSON: JSON;
|
||||
declare var JSON: JSON;
|
||||
|
||||
|
||||
/////////////////////////////
|
||||
@@ -1345,7 +1345,7 @@ interface ArrayConstructor {
|
||||
readonly prototype: Array<any>;
|
||||
}
|
||||
|
||||
declare const Array: ArrayConstructor;
|
||||
declare var Array: ArrayConstructor;
|
||||
|
||||
interface TypedPropertyDescriptor<T> {
|
||||
enumerable?: boolean;
|
||||
@@ -1504,7 +1504,7 @@ interface ArrayBufferConstructor {
|
||||
new(byteLength: number): ArrayBuffer;
|
||||
isView(arg: any): arg is ArrayBufferView;
|
||||
}
|
||||
declare const ArrayBuffer: ArrayBufferConstructor;
|
||||
declare var ArrayBuffer: ArrayBufferConstructor;
|
||||
|
||||
interface ArrayBufferView {
|
||||
/**
|
||||
@@ -1654,7 +1654,7 @@ interface DataView {
|
||||
interface DataViewConstructor {
|
||||
new(buffer: ArrayBufferLike, byteOffset?: number, byteLength?: number): DataView;
|
||||
}
|
||||
declare const DataView: DataViewConstructor;
|
||||
declare var DataView: DataViewConstructor;
|
||||
|
||||
/**
|
||||
* A typed array of 8-bit integer values. The contents are initialized to 0. If the requested
|
||||
@@ -1929,7 +1929,7 @@ interface Int8ArrayConstructor {
|
||||
|
||||
|
||||
}
|
||||
declare const Int8Array: Int8ArrayConstructor;
|
||||
declare var Int8Array: Int8ArrayConstructor;
|
||||
|
||||
/**
|
||||
* A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the
|
||||
@@ -2204,7 +2204,7 @@ interface Uint8ArrayConstructor {
|
||||
from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8Array;
|
||||
|
||||
}
|
||||
declare const Uint8Array: Uint8ArrayConstructor;
|
||||
declare var Uint8Array: Uint8ArrayConstructor;
|
||||
|
||||
/**
|
||||
* A typed array of 8-bit unsigned integer (clamped) values. The contents are initialized to 0.
|
||||
@@ -2478,7 +2478,7 @@ interface Uint8ClampedArrayConstructor {
|
||||
*/
|
||||
from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8ClampedArray;
|
||||
}
|
||||
declare const Uint8ClampedArray: Uint8ClampedArrayConstructor;
|
||||
declare var Uint8ClampedArray: Uint8ClampedArrayConstructor;
|
||||
|
||||
/**
|
||||
* A typed array of 16-bit signed integer values. The contents are initialized to 0. If the
|
||||
@@ -2753,7 +2753,7 @@ interface Int16ArrayConstructor {
|
||||
|
||||
|
||||
}
|
||||
declare const Int16Array: Int16ArrayConstructor;
|
||||
declare var Int16Array: Int16ArrayConstructor;
|
||||
|
||||
/**
|
||||
* A typed array of 16-bit unsigned integer values. The contents are initialized to 0. If the
|
||||
@@ -3029,7 +3029,7 @@ interface Uint16ArrayConstructor {
|
||||
|
||||
|
||||
}
|
||||
declare const Uint16Array: Uint16ArrayConstructor;
|
||||
declare var Uint16Array: Uint16ArrayConstructor;
|
||||
/**
|
||||
* A typed array of 32-bit signed integer values. The contents are initialized to 0. If the
|
||||
* requested number of bytes could not be allocated an exception is raised.
|
||||
@@ -3303,7 +3303,7 @@ interface Int32ArrayConstructor {
|
||||
from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Int32Array;
|
||||
|
||||
}
|
||||
declare const Int32Array: Int32ArrayConstructor;
|
||||
declare var Int32Array: Int32ArrayConstructor;
|
||||
|
||||
/**
|
||||
* A typed array of 32-bit unsigned integer values. The contents are initialized to 0. If the
|
||||
@@ -3577,7 +3577,7 @@ interface Uint32ArrayConstructor {
|
||||
from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Uint32Array;
|
||||
|
||||
}
|
||||
declare const Uint32Array: Uint32ArrayConstructor;
|
||||
declare var Uint32Array: Uint32ArrayConstructor;
|
||||
|
||||
/**
|
||||
* A typed array of 32-bit float values. The contents are initialized to 0. If the requested number
|
||||
@@ -3853,7 +3853,7 @@ interface Float32ArrayConstructor {
|
||||
|
||||
|
||||
}
|
||||
declare const Float32Array: Float32ArrayConstructor;
|
||||
declare var Float32Array: Float32ArrayConstructor;
|
||||
|
||||
/**
|
||||
* A typed array of 64-bit float values. The contents are initialized to 0. If the requested
|
||||
@@ -4128,7 +4128,7 @@ interface Float64ArrayConstructor {
|
||||
from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Float64Array;
|
||||
|
||||
}
|
||||
declare const Float64Array: Float64ArrayConstructor;
|
||||
declare var Float64Array: Float64ArrayConstructor;
|
||||
|
||||
/////////////////////////////
|
||||
/// ECMAScript Internationalization API
|
||||
|
||||
Vendored
+4
-4
@@ -34,7 +34,7 @@ interface BigIntConstructor {
|
||||
asUintN(bits: number, int: bigint): bigint;
|
||||
}
|
||||
|
||||
declare const BigInt: BigIntConstructor;
|
||||
declare var BigInt: BigIntConstructor;
|
||||
|
||||
/**
|
||||
* A typed array of 64-bit signed integer values. The contents are initialized to 0. If the
|
||||
@@ -303,7 +303,7 @@ interface BigInt64ArrayConstructor {
|
||||
from<U>(arrayLike: ArrayLike<U>, mapfn: (v: U, k: number) => bigint, thisArg?: any): BigInt64Array;
|
||||
}
|
||||
|
||||
declare const BigInt64Array: BigInt64ArrayConstructor;
|
||||
declare var BigInt64Array: BigInt64ArrayConstructor;
|
||||
|
||||
/**
|
||||
* A typed array of 64-bit unsigned integer values. The contents are initialized to 0. If the
|
||||
@@ -572,7 +572,7 @@ interface BigUint64ArrayConstructor {
|
||||
from<U>(arrayLike: ArrayLike<U>, mapfn: (v: U, k: number) => bigint, thisArg?: any): BigUint64Array;
|
||||
}
|
||||
|
||||
declare const BigUint64Array: BigUint64ArrayConstructor;
|
||||
declare var BigUint64Array: BigUint64ArrayConstructor;
|
||||
|
||||
interface DataView {
|
||||
/**
|
||||
@@ -606,4 +606,4 @@ interface DataView {
|
||||
* otherwise a little-endian value should be written.
|
||||
*/
|
||||
setBigUint64(byteOffset: number, value: bigint, littleEndian?: boolean): void;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user