mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Merge remote-tracking branch 'upstream/master' into jsDoc2
This commit is contained in:
+2
-21
@@ -8228,31 +8228,12 @@ namespace ts {
|
||||
return jsxElementType || anyType;
|
||||
}
|
||||
|
||||
function tagNamesAreEquivalent(lhs: EntityName, rhs: EntityName): boolean {
|
||||
if (lhs.kind !== rhs.kind) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (lhs.kind === SyntaxKind.Identifier) {
|
||||
return (<Identifier>lhs).text === (<Identifier>rhs).text;
|
||||
}
|
||||
|
||||
return (<QualifiedName>lhs).right.text === (<QualifiedName>rhs).right.text &&
|
||||
tagNamesAreEquivalent((<QualifiedName>lhs).left, (<QualifiedName>rhs).left);
|
||||
}
|
||||
|
||||
function checkJsxElement(node: JsxElement) {
|
||||
// Check attributes
|
||||
checkJsxOpeningLikeElement(node.openingElement);
|
||||
|
||||
// Check that the closing tag matches
|
||||
if (!tagNamesAreEquivalent(node.openingElement.tagName, node.closingElement.tagName)) {
|
||||
error(node.closingElement, Diagnostics.Expected_corresponding_JSX_closing_tag_for_0, getTextOfNode(node.openingElement.tagName));
|
||||
}
|
||||
else {
|
||||
// Perform resolution on the closing tag so that rename/go to definition/etc work
|
||||
getJsxElementTagSymbol(node.closingElement);
|
||||
}
|
||||
// Perform resolution on the closing tag so that rename/go to definition/etc work
|
||||
getJsxElementTagSymbol(node.closingElement);
|
||||
|
||||
// Check children
|
||||
for (const child of node.children) {
|
||||
|
||||
@@ -2586,5 +2586,9 @@
|
||||
"A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses.": {
|
||||
"category": "Error",
|
||||
"code": 17007
|
||||
},
|
||||
"JSX element '{0}' has no corresponding closing tag.": {
|
||||
"category": "Error",
|
||||
"code": 17008
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6990,7 +6990,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
|
||||
|
||||
write(text);
|
||||
}
|
||||
write(`], function(${exportFunctionForFile}, __moduleName) {`);
|
||||
write(`], function(${exportFunctionForFile}) {`);
|
||||
writeLine();
|
||||
increaseIndent();
|
||||
const startIndex = emitDirectivePrologues(node.statements, /*startWithNewLine*/ true, /*ensureUseStrict*/ true);
|
||||
|
||||
+23
-1
@@ -3478,6 +3478,20 @@ namespace ts {
|
||||
return finishNode(node);
|
||||
}
|
||||
|
||||
function tagNamesAreEquivalent(lhs: EntityName, rhs: EntityName): boolean {
|
||||
if (lhs.kind !== rhs.kind) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (lhs.kind === SyntaxKind.Identifier) {
|
||||
return (<Identifier>lhs).text === (<Identifier>rhs).text;
|
||||
}
|
||||
|
||||
return (<QualifiedName>lhs).right.text === (<QualifiedName>rhs).right.text &&
|
||||
tagNamesAreEquivalent((<QualifiedName>lhs).left, (<QualifiedName>rhs).left);
|
||||
}
|
||||
|
||||
|
||||
function parseJsxElementOrSelfClosingElement(inExpressionContext: boolean): JsxElement | JsxSelfClosingElement {
|
||||
const opening = parseJsxOpeningOrSelfClosingElement(inExpressionContext);
|
||||
let result: JsxElement | JsxSelfClosingElement;
|
||||
@@ -3487,6 +3501,11 @@ namespace ts {
|
||||
|
||||
node.children = parseJsxChildren(node.openingElement.tagName);
|
||||
node.closingElement = parseJsxClosingElement(inExpressionContext);
|
||||
|
||||
if (!tagNamesAreEquivalent(node.openingElement.tagName, node.closingElement.tagName)) {
|
||||
parseErrorAtPosition(node.closingElement.pos, node.closingElement.end - node.closingElement.pos, Diagnostics.Expected_corresponding_JSX_closing_tag_for_0, getTextOfNodeFromSourceText(sourceText, node.openingElement.tagName));
|
||||
}
|
||||
|
||||
result = finishNode(node);
|
||||
}
|
||||
else {
|
||||
@@ -3546,10 +3565,13 @@ namespace ts {
|
||||
while (true) {
|
||||
token = scanner.reScanJsxToken();
|
||||
if (token === SyntaxKind.LessThanSlashToken) {
|
||||
// Closing tag
|
||||
break;
|
||||
}
|
||||
else if (token === SyntaxKind.EndOfFileToken) {
|
||||
parseErrorAtCurrentToken(Diagnostics.Expected_corresponding_JSX_closing_tag_for_0, getTextOfNodeFromSourceText(sourceText, openingTagName));
|
||||
// If we hit EOF, issue the error at the tag that lacks the closing element
|
||||
// rather than at the end of the file (which is useless)
|
||||
parseErrorAtPosition(openingTagName.pos, openingTagName.end - openingTagName.pos, Diagnostics.JSX_element_0_has_no_corresponding_closing_tag, getTextOfNodeFromSourceText(sourceText, openingTagName));
|
||||
break;
|
||||
}
|
||||
result.push(parseJsxChild());
|
||||
|
||||
+25
-11
@@ -53,13 +53,13 @@ namespace ts {
|
||||
if (getRootLength(moduleName) !== 0 || nameStartsWithDotSlashOrDotDotSlash(moduleName)) {
|
||||
const failedLookupLocations: string[] = [];
|
||||
const candidate = normalizePath(combinePaths(containingDirectory, moduleName));
|
||||
let resolvedFileName = loadNodeModuleFromFile(supportedExtensions, candidate, failedLookupLocations, host);
|
||||
let resolvedFileName = loadNodeModuleFromFile(supportedExtensions, candidate, failedLookupLocations, /*onlyRecordFailures*/ false, host);
|
||||
|
||||
if (resolvedFileName) {
|
||||
return { resolvedModule: { resolvedFileName }, failedLookupLocations };
|
||||
}
|
||||
|
||||
resolvedFileName = loadNodeModuleFromDirectory(supportedExtensions, candidate, failedLookupLocations, host);
|
||||
resolvedFileName = loadNodeModuleFromDirectory(supportedExtensions, candidate, failedLookupLocations, /*onlyRecordFailures*/ false, host);
|
||||
return resolvedFileName
|
||||
? { resolvedModule: { resolvedFileName }, failedLookupLocations }
|
||||
: { resolvedModule: undefined, failedLookupLocations };
|
||||
@@ -69,12 +69,22 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
function loadNodeModuleFromFile(extensions: string[], candidate: string, failedLookupLocation: string[], host: ModuleResolutionHost): string {
|
||||
/* @internal */
|
||||
export function directoryProbablyExists(directoryName: string, host: { directoryExists?: (directoryName: string) => boolean } ): boolean {
|
||||
// if host does not support 'directoryExists' assume that directory will exist
|
||||
return !host.directoryExists || host.directoryExists(directoryName);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {boolean} onlyRecordFailures - if true then function won't try to actually load files but instead record all attempts as failures. This flag is necessary
|
||||
* in cases when we know upfront that all load attempts will fail (because containing folder does not exists) however we still need to record all failed lookup locations.
|
||||
*/
|
||||
function loadNodeModuleFromFile(extensions: string[], candidate: string, failedLookupLocation: string[], onlyRecordFailures: boolean, host: ModuleResolutionHost): string {
|
||||
return forEach(extensions, tryLoad);
|
||||
|
||||
function tryLoad(ext: string): string {
|
||||
const fileName = fileExtensionIs(candidate, ext) ? candidate : candidate + ext;
|
||||
if (host.fileExists(fileName)) {
|
||||
if (!onlyRecordFailures && host.fileExists(fileName)) {
|
||||
return fileName;
|
||||
}
|
||||
else {
|
||||
@@ -84,9 +94,10 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
function loadNodeModuleFromDirectory(extensions: string[], candidate: string, failedLookupLocation: string[], host: ModuleResolutionHost): string {
|
||||
function loadNodeModuleFromDirectory(extensions: string[], candidate: string, failedLookupLocation: string[], onlyRecordFailures: boolean, host: ModuleResolutionHost): string {
|
||||
const packageJsonPath = combinePaths(candidate, "package.json");
|
||||
if (host.fileExists(packageJsonPath)) {
|
||||
const directoryExists = !onlyRecordFailures && directoryProbablyExists(candidate, host);
|
||||
if (directoryExists && host.fileExists(packageJsonPath)) {
|
||||
|
||||
let jsonContent: { typings?: string };
|
||||
|
||||
@@ -100,7 +111,8 @@ namespace ts {
|
||||
}
|
||||
|
||||
if (typeof jsonContent.typings === "string") {
|
||||
const result = loadNodeModuleFromFile(extensions, normalizePath(combinePaths(candidate, jsonContent.typings)), failedLookupLocation, host);
|
||||
const path = normalizePath(combinePaths(candidate, jsonContent.typings));
|
||||
const result = loadNodeModuleFromFile(extensions, path, failedLookupLocation, !directoryProbablyExists(getDirectoryPath(path), host), host);
|
||||
if (result) {
|
||||
return result;
|
||||
}
|
||||
@@ -111,7 +123,7 @@ namespace ts {
|
||||
failedLookupLocation.push(packageJsonPath);
|
||||
}
|
||||
|
||||
return loadNodeModuleFromFile(extensions, combinePaths(candidate, "index"), failedLookupLocation, host);
|
||||
return loadNodeModuleFromFile(extensions, combinePaths(candidate, "index"), failedLookupLocation, !directoryExists, host);
|
||||
}
|
||||
|
||||
function loadModuleFromNodeModules(moduleName: string, directory: string, host: ModuleResolutionHost): ResolvedModuleWithFailedLookupLocations {
|
||||
@@ -121,14 +133,15 @@ namespace ts {
|
||||
const baseName = getBaseFileName(directory);
|
||||
if (baseName !== "node_modules") {
|
||||
const nodeModulesFolder = combinePaths(directory, "node_modules");
|
||||
const nodeModulesFolderExists = directoryProbablyExists(nodeModulesFolder, host);
|
||||
const candidate = normalizePath(combinePaths(nodeModulesFolder, moduleName));
|
||||
// Load only typescript files irrespective of allowJs option if loading from node modules
|
||||
let result = loadNodeModuleFromFile(supportedTypeScriptExtensions, candidate, failedLookupLocations, host);
|
||||
let result = loadNodeModuleFromFile(supportedTypeScriptExtensions, candidate, failedLookupLocations, !nodeModulesFolderExists, host);
|
||||
if (result) {
|
||||
return { resolvedModule: { resolvedFileName: result, isExternalLibraryImport: true }, failedLookupLocations };
|
||||
}
|
||||
|
||||
result = loadNodeModuleFromDirectory(supportedTypeScriptExtensions, candidate, failedLookupLocations, host);
|
||||
result = loadNodeModuleFromDirectory(supportedTypeScriptExtensions, candidate, failedLookupLocations, !nodeModulesFolderExists, host);
|
||||
if (result) {
|
||||
return { resolvedModule: { resolvedFileName: result, isExternalLibraryImport: true }, failedLookupLocations };
|
||||
}
|
||||
@@ -281,7 +294,8 @@ namespace ts {
|
||||
getCanonicalFileName,
|
||||
getNewLine: () => newLine,
|
||||
fileExists: fileName => sys.fileExists(fileName),
|
||||
readFile: fileName => sys.readFile(fileName)
|
||||
readFile: fileName => sys.readFile(fileName),
|
||||
directoryExists: directoryName => sys.directoryExists(directoryName)
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -2649,6 +2649,8 @@ namespace ts {
|
||||
// readFile function is used to read arbitrary text files on disk, i.e. when resolution procedure needs the content of 'package.json'
|
||||
// to determine location of bundled typings for node module
|
||||
readFile(fileName: string): string;
|
||||
|
||||
directoryExists?(directoryName: string): boolean;
|
||||
}
|
||||
|
||||
export interface ResolvedModule {
|
||||
|
||||
@@ -267,6 +267,10 @@ namespace Harness.LanguageService {
|
||||
log(s: string): void { this.nativeHost.log(s); }
|
||||
trace(s: string): void { this.nativeHost.trace(s); }
|
||||
error(s: string): void { this.nativeHost.error(s); }
|
||||
directoryExists(directoryName: string): boolean {
|
||||
// for tests pessimistically assume that directory always exists
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
class ClassifierShimProxy implements ts.Classifier {
|
||||
|
||||
Vendored
+5
-2
@@ -321,6 +321,7 @@ interface AudioContext extends EventTarget {
|
||||
destination: AudioDestinationNode;
|
||||
listener: AudioListener;
|
||||
sampleRate: number;
|
||||
state: string;
|
||||
createAnalyser(): AnalyserNode;
|
||||
createBiquadFilter(): BiquadFilterNode;
|
||||
createBuffer(numberOfChannels: number, length: number, sampleRate: number): AudioBuffer;
|
||||
@@ -2774,6 +2775,7 @@ interface Element extends Node, GlobalEventHandlers, ElementTraversal, NodeSelec
|
||||
tagName: string;
|
||||
id: string;
|
||||
className: string;
|
||||
innerHTML: string;
|
||||
getAttribute(name?: string): string;
|
||||
getAttributeNS(namespaceURI: string, localName: string): string;
|
||||
getAttributeNode(name: string): Attr;
|
||||
@@ -2969,7 +2971,7 @@ interface Element extends Node, GlobalEventHandlers, ElementTraversal, NodeSelec
|
||||
removeAttributeNode(oldAttr: Attr): Attr;
|
||||
requestFullscreen(): void;
|
||||
requestPointerLock(): void;
|
||||
setAttribute(name?: string, value?: string): void;
|
||||
setAttribute(name: string, value: string): void;
|
||||
setAttributeNS(namespaceURI: string, qualifiedName: string, value: string): void;
|
||||
setAttributeNode(newAttr: Attr): Attr;
|
||||
setAttributeNodeNS(newAttr: Attr): Attr;
|
||||
@@ -5512,7 +5514,7 @@ interface HTMLMediaElement extends HTMLElement {
|
||||
* Gets or sets the current playback position, in seconds.
|
||||
*/
|
||||
preload: string;
|
||||
readyState: any;
|
||||
readyState: number;
|
||||
/**
|
||||
* Returns a TimeRanges object that represents the ranges of the current media resource that can be seeked.
|
||||
*/
|
||||
@@ -6169,6 +6171,7 @@ interface HTMLSelectElement extends HTMLElement {
|
||||
* Returns whether an element will successfully validate based on forms validation rules and constraints.
|
||||
*/
|
||||
willValidate: boolean;
|
||||
selectedOptions: HTMLCollection;
|
||||
/**
|
||||
* Adds an element to the areas, controlRange, or options collection.
|
||||
* @param element Variant of type Number that specifies the index position in the collection where the element is placed. If no value is given, the method places the element at the end of the collection.
|
||||
|
||||
Vendored
+20
-11
@@ -7,7 +7,7 @@ interface Symbol {
|
||||
/** Returns the primitive value of the specified object. */
|
||||
valueOf(): Object;
|
||||
|
||||
[Symbol.toStringTag]: string;
|
||||
[Symbol.toStringTag]: "Symbol";
|
||||
}
|
||||
|
||||
interface SymbolConstructor {
|
||||
@@ -565,7 +565,7 @@ interface IterableIterator<T> extends Iterator<T> {
|
||||
}
|
||||
|
||||
interface GeneratorFunction extends Function {
|
||||
|
||||
[Symbol.toStringTag]: "GeneratorFunction";
|
||||
}
|
||||
|
||||
interface GeneratorFunctionConstructor {
|
||||
@@ -690,7 +690,7 @@ interface Math {
|
||||
*/
|
||||
cbrt(x: number): number;
|
||||
|
||||
[Symbol.toStringTag]: string;
|
||||
[Symbol.toStringTag]: "Math";
|
||||
}
|
||||
|
||||
interface Date {
|
||||
@@ -807,7 +807,7 @@ interface Map<K, V> {
|
||||
size: number;
|
||||
values(): IterableIterator<V>;
|
||||
[Symbol.iterator]():IterableIterator<[K,V]>;
|
||||
[Symbol.toStringTag]: string;
|
||||
[Symbol.toStringTag]: "Map";
|
||||
}
|
||||
|
||||
interface MapConstructor {
|
||||
@@ -824,7 +824,7 @@ interface WeakMap<K, V> {
|
||||
get(key: K): V;
|
||||
has(key: K): boolean;
|
||||
set(key: K, value?: V): WeakMap<K, V>;
|
||||
[Symbol.toStringTag]: string;
|
||||
[Symbol.toStringTag]: "WeakMap";
|
||||
}
|
||||
|
||||
interface WeakMapConstructor {
|
||||
@@ -846,7 +846,7 @@ interface Set<T> {
|
||||
size: number;
|
||||
values(): IterableIterator<T>;
|
||||
[Symbol.iterator]():IterableIterator<T>;
|
||||
[Symbol.toStringTag]: string;
|
||||
[Symbol.toStringTag]: "Set";
|
||||
}
|
||||
|
||||
interface SetConstructor {
|
||||
@@ -862,7 +862,7 @@ interface WeakSet<T> {
|
||||
clear(): void;
|
||||
delete(value: T): boolean;
|
||||
has(value: T): boolean;
|
||||
[Symbol.toStringTag]: string;
|
||||
[Symbol.toStringTag]: "WeakSet";
|
||||
}
|
||||
|
||||
interface WeakSetConstructor {
|
||||
@@ -874,7 +874,7 @@ interface WeakSetConstructor {
|
||||
declare var WeakSet: WeakSetConstructor;
|
||||
|
||||
interface JSON {
|
||||
[Symbol.toStringTag]: string;
|
||||
[Symbol.toStringTag]: "JSON";
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -884,11 +884,11 @@ interface JSON {
|
||||
* buffer as needed.
|
||||
*/
|
||||
interface ArrayBuffer {
|
||||
[Symbol.toStringTag]: string;
|
||||
[Symbol.toStringTag]: "ArrayBuffer";
|
||||
}
|
||||
|
||||
interface DataView {
|
||||
[Symbol.toStringTag]: string;
|
||||
[Symbol.toStringTag]: "DataView";
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -909,6 +909,7 @@ interface Int8Array {
|
||||
*/
|
||||
values(): IterableIterator<number>;
|
||||
[Symbol.iterator](): IterableIterator<number>;
|
||||
[Symbol.toStringTag]: "Int8Array";
|
||||
}
|
||||
|
||||
interface Int8ArrayConstructor {
|
||||
@@ -941,6 +942,7 @@ interface Uint8Array {
|
||||
*/
|
||||
values(): IterableIterator<number>;
|
||||
[Symbol.iterator](): IterableIterator<number>;
|
||||
[Symbol.toStringTag]: "UInt8Array";
|
||||
}
|
||||
|
||||
interface Uint8ArrayConstructor {
|
||||
@@ -976,6 +978,7 @@ interface Uint8ClampedArray {
|
||||
values(): IterableIterator<number>;
|
||||
|
||||
[Symbol.iterator](): IterableIterator<number>;
|
||||
[Symbol.toStringTag]: "Uint8ClampedArray";
|
||||
}
|
||||
|
||||
interface Uint8ClampedArrayConstructor {
|
||||
@@ -1013,6 +1016,7 @@ interface Int16Array {
|
||||
|
||||
|
||||
[Symbol.iterator](): IterableIterator<number>;
|
||||
[Symbol.toStringTag]: "Int16Array";
|
||||
}
|
||||
|
||||
interface Int16ArrayConstructor {
|
||||
@@ -1045,6 +1049,7 @@ interface Uint16Array {
|
||||
*/
|
||||
values(): IterableIterator<number>;
|
||||
[Symbol.iterator](): IterableIterator<number>;
|
||||
[Symbol.toStringTag]: "Uint16Array";
|
||||
}
|
||||
|
||||
interface Uint16ArrayConstructor {
|
||||
@@ -1077,6 +1082,7 @@ interface Int32Array {
|
||||
*/
|
||||
values(): IterableIterator<number>;
|
||||
[Symbol.iterator](): IterableIterator<number>;
|
||||
[Symbol.toStringTag]: "Int32Array";
|
||||
}
|
||||
|
||||
interface Int32ArrayConstructor {
|
||||
@@ -1109,6 +1115,7 @@ interface Uint32Array {
|
||||
*/
|
||||
values(): IterableIterator<number>;
|
||||
[Symbol.iterator](): IterableIterator<number>;
|
||||
[Symbol.toStringTag]: "Uint32Array";
|
||||
}
|
||||
|
||||
interface Uint32ArrayConstructor {
|
||||
@@ -1141,6 +1148,7 @@ interface Float32Array {
|
||||
*/
|
||||
values(): IterableIterator<number>;
|
||||
[Symbol.iterator](): IterableIterator<number>;
|
||||
[Symbol.toStringTag]: "Float32Array";
|
||||
}
|
||||
|
||||
interface Float32ArrayConstructor {
|
||||
@@ -1173,6 +1181,7 @@ interface Float64Array {
|
||||
*/
|
||||
values(): IterableIterator<number>;
|
||||
[Symbol.iterator](): IterableIterator<number>;
|
||||
[Symbol.toStringTag]: "Float64Array";
|
||||
}
|
||||
|
||||
interface Float64ArrayConstructor {
|
||||
@@ -1249,7 +1258,7 @@ interface Promise<T> {
|
||||
catch(onrejected?: (reason: any) => T | PromiseLike<T>): Promise<T>;
|
||||
catch(onrejected?: (reason: any) => void): Promise<T>;
|
||||
|
||||
[Symbol.toStringTag]: string;
|
||||
[Symbol.toStringTag]: "Promise";
|
||||
}
|
||||
|
||||
interface PromiseConstructor {
|
||||
|
||||
@@ -100,7 +100,8 @@ namespace ts.server {
|
||||
this.filenameToScript = createFileMap<ScriptInfo>();
|
||||
this.moduleResolutionHost = {
|
||||
fileExists: fileName => this.fileExists(fileName),
|
||||
readFile: fileName => this.host.readFile(fileName)
|
||||
readFile: fileName => this.host.readFile(fileName),
|
||||
directoryExists: directoryName => this.host.directoryExists(directoryName)
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -1034,6 +1034,7 @@ namespace ts {
|
||||
* host specific questions using 'getScriptSnapshot'.
|
||||
*/
|
||||
resolveModuleNames?(moduleNames: string[], containingFile: string): ResolvedModule[];
|
||||
directoryExists?(directoryName: string): boolean;
|
||||
}
|
||||
|
||||
//
|
||||
@@ -1911,7 +1912,8 @@ namespace ts {
|
||||
getCurrentDirectory: () => "",
|
||||
getNewLine: () => newLine,
|
||||
fileExists: (fileName): boolean => fileName === inputFileName,
|
||||
readFile: (fileName): string => ""
|
||||
readFile: (fileName): string => "",
|
||||
directoryExists: directoryExists => true
|
||||
};
|
||||
|
||||
const program = createProgram([inputFileName], options, compilerHost);
|
||||
@@ -2768,6 +2770,10 @@ namespace ts {
|
||||
// stub missing host functionality
|
||||
const entry = hostCache.getOrCreateEntry(fileName);
|
||||
return entry && entry.scriptSnapshot.getText(0, entry.scriptSnapshot.getLength());
|
||||
},
|
||||
directoryExists: directoryName => {
|
||||
Debug.assert(!host.resolveModuleNames);
|
||||
return directoryProbablyExists(directoryName, host);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
+13
-3
@@ -62,6 +62,7 @@ namespace ts {
|
||||
useCaseSensitiveFileNames?(): boolean;
|
||||
|
||||
getModuleResolutionsForFile?(fileName: string): string;
|
||||
directoryExists(directoryName: string): boolean;
|
||||
}
|
||||
|
||||
/** Public interface of the the of a config service shim instance.*/
|
||||
@@ -274,6 +275,7 @@ namespace ts {
|
||||
private tracingEnabled = false;
|
||||
|
||||
public resolveModuleNames: (moduleName: string[], containingFile: string) => ResolvedModule[];
|
||||
public directoryExists: (directoryName: string) => boolean;
|
||||
|
||||
constructor(private shimHost: LanguageServiceShimHost) {
|
||||
// if shimHost is a COM object then property check will become method call with no arguments.
|
||||
@@ -287,6 +289,9 @@ namespace ts {
|
||||
});
|
||||
};
|
||||
}
|
||||
if ("directoryExists" in this.shimHost) {
|
||||
this.directoryExists = directoryName => this.shimHost.directoryExists(directoryName);
|
||||
}
|
||||
}
|
||||
|
||||
public log(s: string): void {
|
||||
@@ -405,9 +410,14 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
export class CoreServicesShimHostAdapter implements ParseConfigHost {
|
||||
export class CoreServicesShimHostAdapter implements ParseConfigHost, ModuleResolutionHost {
|
||||
|
||||
public directoryExists: (directoryName: string) => boolean;
|
||||
|
||||
constructor(private shimHost: CoreServicesShimHost) {
|
||||
if ("directoryExists" in this.shimHost) {
|
||||
this.directoryExists = directoryName => this.shimHost.directoryExists(directoryName);
|
||||
}
|
||||
}
|
||||
|
||||
public readDirectory(rootDir: string, extension: string, exclude: string[]): string[] {
|
||||
@@ -424,11 +434,11 @@ namespace ts {
|
||||
}
|
||||
return JSON.parse(encoded);
|
||||
}
|
||||
|
||||
|
||||
public fileExists(fileName: string): boolean {
|
||||
return this.shimHost.fileExists(fileName);
|
||||
}
|
||||
|
||||
|
||||
public readFile(fileName: string): string {
|
||||
return this.shimHost.readFile(fileName);
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ module M {
|
||||
|
||||
|
||||
//// [aliasesInSystemModule1.js]
|
||||
System.register(['foo'], function(exports_1, __moduleName) {
|
||||
System.register(['foo'], function(exports_1) {
|
||||
"use strict";
|
||||
var alias;
|
||||
var cls, cls2, x, y, z, M;
|
||||
|
||||
@@ -16,7 +16,7 @@ module M {
|
||||
}
|
||||
|
||||
//// [aliasesInSystemModule2.js]
|
||||
System.register(["foo"], function(exports_1, __moduleName) {
|
||||
System.register(["foo"], function(exports_1) {
|
||||
"use strict";
|
||||
var foo_1;
|
||||
var cls, cls2, x, y, z, M;
|
||||
|
||||
@@ -10,7 +10,7 @@ export class Foo {
|
||||
}
|
||||
|
||||
//// [b.js]
|
||||
System.register([], function(exports_1, __moduleName) {
|
||||
System.register([], function(exports_1) {
|
||||
"use strict";
|
||||
var Foo;
|
||||
return {
|
||||
@@ -26,7 +26,7 @@ System.register([], function(exports_1, __moduleName) {
|
||||
}
|
||||
});
|
||||
//// [a.js]
|
||||
System.register(["./b"], function(exports_1, __moduleName) {
|
||||
System.register(["./b"], function(exports_1) {
|
||||
"use strict";
|
||||
var b_1;
|
||||
var x;
|
||||
|
||||
@@ -11,7 +11,7 @@ export class Foo {
|
||||
|
||||
|
||||
//// [b.js]
|
||||
System.register([], function(exports_1, __moduleName) {
|
||||
System.register([], function(exports_1) {
|
||||
"use strict";
|
||||
var Foo;
|
||||
return {
|
||||
@@ -27,7 +27,7 @@ System.register([], function(exports_1, __moduleName) {
|
||||
}
|
||||
});
|
||||
//// [a.js]
|
||||
System.register(["./b"], function(exports_1, __moduleName) {
|
||||
System.register(["./b"], function(exports_1) {
|
||||
"use strict";
|
||||
var b_1;
|
||||
var x;
|
||||
|
||||
@@ -12,7 +12,7 @@ export var x = new Foo();
|
||||
|
||||
|
||||
//// [a.js]
|
||||
System.register(["./b"], function(exports_1, __moduleName) {
|
||||
System.register(["./b"], function(exports_1) {
|
||||
"use strict";
|
||||
var b_1;
|
||||
var x;
|
||||
|
||||
@@ -12,7 +12,7 @@ export var x = new Foo();
|
||||
|
||||
|
||||
//// [a.js]
|
||||
System.register(["./b"], function(exports_1, __moduleName) {
|
||||
System.register(["./b"], function(exports_1) {
|
||||
"use strict";
|
||||
var b_1;
|
||||
var x;
|
||||
|
||||
@@ -7,7 +7,7 @@ export default class {}
|
||||
export default function() {}
|
||||
|
||||
//// [a.js]
|
||||
System.register([], function(exports_1, __moduleName) {
|
||||
System.register([], function(exports_1) {
|
||||
"use strict";
|
||||
var default_1;
|
||||
return {
|
||||
@@ -20,7 +20,7 @@ System.register([], function(exports_1, __moduleName) {
|
||||
}
|
||||
});
|
||||
//// [b.js]
|
||||
System.register([], function(exports_1, __moduleName) {
|
||||
System.register([], function(exports_1) {
|
||||
"use strict";
|
||||
function default_1() { }
|
||||
exports_1("default", default_1);
|
||||
|
||||
@@ -144,7 +144,7 @@ for (const y = 0; y < 1;) {
|
||||
|
||||
|
||||
//// [capturedLetConstInLoop4.js]
|
||||
System.register([], function(exports_1, __moduleName) {
|
||||
System.register([], function(exports_1) {
|
||||
"use strict";
|
||||
var v0, v00, v1, v2, v3, v4, v5, v6, v7, v8, v0_c, v00_c, v1_c, v2_c, v3_c, v4_c, v5_c, v6_c, v7_c, v8_c;
|
||||
//======let
|
||||
|
||||
@@ -13,7 +13,7 @@ var decorator: ClassDecorator;
|
||||
export default class {}
|
||||
|
||||
//// [a.js]
|
||||
System.register([], function(exports_1, __moduleName) {
|
||||
System.register([], function(exports_1) {
|
||||
"use strict";
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
@@ -35,7 +35,7 @@ System.register([], function(exports_1, __moduleName) {
|
||||
}
|
||||
});
|
||||
//// [b.js]
|
||||
System.register([], function(exports_1, __moduleName) {
|
||||
System.register([], function(exports_1) {
|
||||
"use strict";
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
|
||||
@@ -8,7 +8,7 @@ export default function foo() {}
|
||||
|
||||
|
||||
//// [a.js]
|
||||
System.register([], function(exports_1, __moduleName) {
|
||||
System.register([], function(exports_1) {
|
||||
"use strict";
|
||||
var Foo;
|
||||
return {
|
||||
@@ -21,7 +21,7 @@ System.register([], function(exports_1, __moduleName) {
|
||||
}
|
||||
});
|
||||
//// [b.js]
|
||||
System.register([], function(exports_1, __moduleName) {
|
||||
System.register([], function(exports_1) {
|
||||
"use strict";
|
||||
function foo() { }
|
||||
exports_1("default", foo);
|
||||
|
||||
@@ -15,7 +15,7 @@ export default class A
|
||||
|
||||
|
||||
//// [es5-system.js]
|
||||
System.register([], function(exports_1, __moduleName) {
|
||||
System.register([], function(exports_1) {
|
||||
"use strict";
|
||||
var A;
|
||||
return {
|
||||
|
||||
@@ -35,7 +35,7 @@ export let h1: D = new D;
|
||||
|
||||
|
||||
//// [exportNonInitializedVariablesSystem.js]
|
||||
System.register([], function(exports_1, __moduleName) {
|
||||
System.register([], function(exports_1) {
|
||||
"use strict";
|
||||
var a, b, c, d, A, e, f, B, C, a1, b1, c1, d1, D, e1, f1, g1, h1;
|
||||
return {
|
||||
|
||||
@@ -13,7 +13,7 @@ export * from "file1";
|
||||
var x = 1;
|
||||
|
||||
//// [file0.js]
|
||||
System.register([], function(exports_1, __moduleName) {
|
||||
System.register([], function(exports_1) {
|
||||
"use strict";
|
||||
var v;
|
||||
return {
|
||||
@@ -24,7 +24,7 @@ System.register([], function(exports_1, __moduleName) {
|
||||
}
|
||||
});
|
||||
//// [file1.js]
|
||||
System.register([], function(exports_1, __moduleName) {
|
||||
System.register([], function(exports_1) {
|
||||
"use strict";
|
||||
return {
|
||||
setters:[],
|
||||
@@ -33,7 +33,7 @@ System.register([], function(exports_1, __moduleName) {
|
||||
}
|
||||
});
|
||||
//// [file2.js]
|
||||
System.register(["file0"], function(exports_1, __moduleName) {
|
||||
System.register(["file0"], function(exports_1) {
|
||||
"use strict";
|
||||
var x;
|
||||
function exportStar_1(m) {
|
||||
|
||||
@@ -9,7 +9,7 @@ export * from "file1"
|
||||
export var x = 1;
|
||||
|
||||
//// [file1.js]
|
||||
System.register([], function(exports_1, __moduleName) {
|
||||
System.register([], function(exports_1) {
|
||||
"use strict";
|
||||
return {
|
||||
setters:[],
|
||||
@@ -18,7 +18,7 @@ System.register([], function(exports_1, __moduleName) {
|
||||
}
|
||||
});
|
||||
//// [file2.js]
|
||||
System.register([], function(exports_1, __moduleName) {
|
||||
System.register([], function(exports_1) {
|
||||
"use strict";
|
||||
var x;
|
||||
return {
|
||||
|
||||
@@ -9,7 +9,7 @@ export * from "file1"
|
||||
var x = 1;
|
||||
|
||||
//// [file1.js]
|
||||
System.register([], function(exports_1, __moduleName) {
|
||||
System.register([], function(exports_1) {
|
||||
"use strict";
|
||||
return {
|
||||
setters:[],
|
||||
@@ -18,7 +18,7 @@ System.register([], function(exports_1, __moduleName) {
|
||||
}
|
||||
});
|
||||
//// [file2.js]
|
||||
System.register([], function(exports_1, __moduleName) {
|
||||
System.register([], function(exports_1) {
|
||||
"use strict";
|
||||
var x;
|
||||
return {
|
||||
|
||||
@@ -5,7 +5,7 @@ run(1);
|
||||
|
||||
|
||||
//// [isolatedModulesPlainFile-System.js]
|
||||
System.register([], function(exports_1, __moduleName) {
|
||||
System.register([], function(exports_1) {
|
||||
"use strict";
|
||||
return {
|
||||
setters:[],
|
||||
|
||||
@@ -1,14 +1,20 @@
|
||||
tests/cases/conformance/jsx/jsxAndTypeAssertion.tsx(7,6): error TS17008: JSX element 'any' has no corresponding closing tag.
|
||||
tests/cases/conformance/jsx/jsxAndTypeAssertion.tsx(7,13): error TS2304: Cannot find name 'test'.
|
||||
tests/cases/conformance/jsx/jsxAndTypeAssertion.tsx(7,17): error TS1005: '}' expected.
|
||||
tests/cases/conformance/jsx/jsxAndTypeAssertion.tsx(9,6): error TS17008: JSX element 'any' has no corresponding closing tag.
|
||||
tests/cases/conformance/jsx/jsxAndTypeAssertion.tsx(11,6): error TS17008: JSX element 'foo' has no corresponding closing tag.
|
||||
tests/cases/conformance/jsx/jsxAndTypeAssertion.tsx(11,32): error TS1005: '}' expected.
|
||||
tests/cases/conformance/jsx/jsxAndTypeAssertion.tsx(13,36): error TS1005: '}' expected.
|
||||
tests/cases/conformance/jsx/jsxAndTypeAssertion.tsx(15,17): error TS17008: JSX element 'foo' has no corresponding closing tag.
|
||||
tests/cases/conformance/jsx/jsxAndTypeAssertion.tsx(15,45): error TS1005: '}' expected.
|
||||
tests/cases/conformance/jsx/jsxAndTypeAssertion.tsx(19,2): error TS17008: JSX element 'foo' has no corresponding closing tag.
|
||||
tests/cases/conformance/jsx/jsxAndTypeAssertion.tsx(19,8): error TS17008: JSX element 'foo' has no corresponding closing tag.
|
||||
tests/cases/conformance/jsx/jsxAndTypeAssertion.tsx(19,13): error TS17008: JSX element 'foo' has no corresponding closing tag.
|
||||
tests/cases/conformance/jsx/jsxAndTypeAssertion.tsx(22,1): error TS1005: ':' expected.
|
||||
tests/cases/conformance/jsx/jsxAndTypeAssertion.tsx(22,1): error TS17002: Expected corresponding JSX closing tag for 'any'.
|
||||
tests/cases/conformance/jsx/jsxAndTypeAssertion.tsx(22,1): error TS17002: Expected corresponding JSX closing tag for 'foo'.
|
||||
tests/cases/conformance/jsx/jsxAndTypeAssertion.tsx(22,1): error TS1005: '</' expected.
|
||||
|
||||
|
||||
==== tests/cases/conformance/jsx/jsxAndTypeAssertion.tsx (8 errors) ====
|
||||
==== tests/cases/conformance/jsx/jsxAndTypeAssertion.tsx (14 errors) ====
|
||||
|
||||
declare var createElement: any;
|
||||
|
||||
@@ -16,14 +22,20 @@ tests/cases/conformance/jsx/jsxAndTypeAssertion.tsx(22,1): error TS17002: Expect
|
||||
|
||||
var x: any;
|
||||
x = <any> { test: <any></any> };
|
||||
~~~
|
||||
!!! error TS17008: JSX element 'any' has no corresponding closing tag.
|
||||
~~~~
|
||||
!!! error TS2304: Cannot find name 'test'.
|
||||
~
|
||||
!!! error TS1005: '}' expected.
|
||||
|
||||
x = <any><any></any>;
|
||||
~~~
|
||||
!!! error TS17008: JSX element 'any' has no corresponding closing tag.
|
||||
|
||||
x = <foo>hello {<foo>{}} </foo>;
|
||||
~~~
|
||||
!!! error TS17008: JSX element 'foo' has no corresponding closing tag.
|
||||
~
|
||||
!!! error TS1005: '}' expected.
|
||||
|
||||
@@ -32,18 +44,24 @@ tests/cases/conformance/jsx/jsxAndTypeAssertion.tsx(22,1): error TS17002: Expect
|
||||
!!! error TS1005: '}' expected.
|
||||
|
||||
x = <foo test={<foo>{}}>hello{<foo>{}}</foo>;
|
||||
~~~
|
||||
!!! error TS17008: JSX element 'foo' has no corresponding closing tag.
|
||||
~
|
||||
!!! error TS1005: '}' expected.
|
||||
|
||||
x = <foo>x</foo>, x = <foo/>;
|
||||
|
||||
<foo>{<foo><foo>{/foo/.test(x) ? <foo><foo></foo> : <foo><foo></foo>}</foo>}</foo>
|
||||
~~~
|
||||
!!! error TS17008: JSX element 'foo' has no corresponding closing tag.
|
||||
~~~
|
||||
!!! error TS17008: JSX element 'foo' has no corresponding closing tag.
|
||||
~~~
|
||||
!!! error TS17008: JSX element 'foo' has no corresponding closing tag.
|
||||
|
||||
|
||||
|
||||
|
||||
!!! error TS1005: ':' expected.
|
||||
|
||||
!!! error TS17002: Expected corresponding JSX closing tag for 'any'.
|
||||
|
||||
!!! error TS17002: Expected corresponding JSX closing tag for 'foo'.
|
||||
!!! error TS1005: '</' expected.
|
||||
@@ -50,6 +50,8 @@ tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(17,3): error TS1003:
|
||||
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(17,11): error TS1109: Expression expected.
|
||||
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(17,13): error TS2304: Cannot find name 'a'.
|
||||
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(17,22): error TS1109: Expression expected.
|
||||
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(18,2): error TS17008: JSX element 'a' has no corresponding closing tag.
|
||||
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(19,2): error TS17008: JSX element 'a' has no corresponding closing tag.
|
||||
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(22,10): error TS1005: '}' expected.
|
||||
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(23,20): error TS1003: Identifier expected.
|
||||
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(24,15): error TS1003: Identifier expected.
|
||||
@@ -58,14 +60,16 @@ tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(25,7): error TS2304:
|
||||
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(27,17): error TS1005: '>' expected.
|
||||
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(28,10): error TS2304: Cannot find name 'props'.
|
||||
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(28,28): error TS1005: '>' expected.
|
||||
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(32,2): error TS17008: JSX element 'a' has no corresponding closing tag.
|
||||
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(32,6): error TS1005: '{' expected.
|
||||
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(33,2): error TS17008: JSX element 'a' has no corresponding closing tag.
|
||||
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(33,6): error TS1005: '{' expected.
|
||||
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(33,7): error TS1109: Expression expected.
|
||||
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(35,4): error TS1003: Identifier expected.
|
||||
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(35,21): error TS17002: Expected corresponding JSX closing tag for 'a'.
|
||||
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(35,21): error TS1005: '</' expected.
|
||||
|
||||
|
||||
==== tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx (65 errors) ====
|
||||
==== tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx (69 errors) ====
|
||||
declare var React: any;
|
||||
|
||||
</>;
|
||||
@@ -188,7 +192,11 @@ tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(35,21): error TS17002
|
||||
~
|
||||
!!! error TS1109: Expression expected.
|
||||
<a><a />;
|
||||
~
|
||||
!!! error TS17008: JSX element 'a' has no corresponding closing tag.
|
||||
<a b={}>;
|
||||
~
|
||||
!!! error TS17008: JSX element 'a' has no corresponding closing tag.
|
||||
var x = <div>one</div><div>two</div>;;
|
||||
var x = <div>one</div> /* intervening comment */ <div>two</div>;;
|
||||
<a>{"str";}</a>;
|
||||
@@ -218,9 +226,13 @@ tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(35,21): error TS17002
|
||||
<a>></a>;
|
||||
<a> ></a>;
|
||||
<a b=}>;
|
||||
~
|
||||
!!! error TS17008: JSX element 'a' has no corresponding closing tag.
|
||||
~
|
||||
!!! error TS1005: '{' expected.
|
||||
<a b=<}>;
|
||||
~
|
||||
!!! error TS17008: JSX element 'a' has no corresponding closing tag.
|
||||
~
|
||||
!!! error TS1005: '{' expected.
|
||||
~
|
||||
@@ -230,4 +242,4 @@ tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(35,21): error TS17002
|
||||
~~~
|
||||
!!! error TS1003: Identifier expected.
|
||||
|
||||
!!! error TS17002: Expected corresponding JSX closing tag for 'a'.
|
||||
!!! error TS1005: '</' expected.
|
||||
@@ -0,0 +1,66 @@
|
||||
tests/cases/conformance/jsx/Error1.tsx(2,11): error TS17008: JSX element 'div' has no corresponding closing tag.
|
||||
tests/cases/conformance/jsx/Error1.tsx(2,21): error TS17002: Expected corresponding JSX closing tag for 'span'.
|
||||
tests/cases/conformance/jsx/Error1.tsx(3,1): error TS1005: '</' expected.
|
||||
tests/cases/conformance/jsx/Error2.tsx(1,15): error TS17002: Expected corresponding JSX closing tag for 'div'.
|
||||
tests/cases/conformance/jsx/Error3.tsx(1,11): error TS17008: JSX element 'div' has no corresponding closing tag.
|
||||
tests/cases/conformance/jsx/Error3.tsx(3,1): error TS1005: '</' expected.
|
||||
tests/cases/conformance/jsx/Error4.tsx(1,11): error TS17008: JSX element 'div' has no corresponding closing tag.
|
||||
tests/cases/conformance/jsx/Error4.tsx(1,20): error TS17002: Expected corresponding JSX closing tag for 'div'.
|
||||
tests/cases/conformance/jsx/Error4.tsx(2,1): error TS1005: '</' expected.
|
||||
tests/cases/conformance/jsx/Error5.tsx(1,11): error TS17008: JSX element 'div' has no corresponding closing tag.
|
||||
tests/cases/conformance/jsx/Error5.tsx(1,16): error TS17008: JSX element 'span' has no corresponding closing tag.
|
||||
tests/cases/conformance/jsx/Error5.tsx(3,1): error TS1005: '</' expected.
|
||||
|
||||
|
||||
==== tests/cases/conformance/jsx/file.tsx (0 errors) ====
|
||||
|
||||
declare module JSX {
|
||||
interface Element { }
|
||||
interface IntrinsicElements {
|
||||
[s: string]: any;
|
||||
}
|
||||
}
|
||||
|
||||
==== tests/cases/conformance/jsx/Error1.tsx (3 errors) ====
|
||||
// Issue error about missing span closing tag, not missing div closing tag
|
||||
let x1 = <div><span></div>;
|
||||
~~~
|
||||
!!! error TS17008: JSX element 'div' has no corresponding closing tag.
|
||||
~~~~~~
|
||||
!!! error TS17002: Expected corresponding JSX closing tag for 'span'.
|
||||
|
||||
|
||||
!!! error TS1005: '</' expected.
|
||||
==== tests/cases/conformance/jsx/Error2.tsx (1 errors) ====
|
||||
let x2 = <div></span>;
|
||||
~~~~~~~
|
||||
!!! error TS17002: Expected corresponding JSX closing tag for 'div'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/jsx/Error3.tsx (2 errors) ====
|
||||
let x3 = <div>;
|
||||
~~~
|
||||
!!! error TS17008: JSX element 'div' has no corresponding closing tag.
|
||||
|
||||
|
||||
|
||||
!!! error TS1005: '</' expected.
|
||||
==== tests/cases/conformance/jsx/Error4.tsx (3 errors) ====
|
||||
let x4 = <div><div></span>;
|
||||
~~~
|
||||
!!! error TS17008: JSX element 'div' has no corresponding closing tag.
|
||||
~~~~~~~
|
||||
!!! error TS17002: Expected corresponding JSX closing tag for 'div'.
|
||||
|
||||
|
||||
!!! error TS1005: '</' expected.
|
||||
==== tests/cases/conformance/jsx/Error5.tsx (3 errors) ====
|
||||
let x5 = <div><span>
|
||||
~~~
|
||||
!!! error TS17008: JSX element 'div' has no corresponding closing tag.
|
||||
~~~~
|
||||
!!! error TS17008: JSX element 'span' has no corresponding closing tag.
|
||||
|
||||
|
||||
|
||||
!!! error TS1005: '</' expected.
|
||||
@@ -0,0 +1,49 @@
|
||||
//// [tests/cases/conformance/jsx/jsxParsingError2.tsx] ////
|
||||
|
||||
//// [file.tsx]
|
||||
|
||||
declare module JSX {
|
||||
interface Element { }
|
||||
interface IntrinsicElements {
|
||||
[s: string]: any;
|
||||
}
|
||||
}
|
||||
|
||||
//// [Error1.tsx]
|
||||
// Issue error about missing span closing tag, not missing div closing tag
|
||||
let x1 = <div><span></div>;
|
||||
|
||||
//// [Error2.tsx]
|
||||
let x2 = <div></span>;
|
||||
|
||||
|
||||
//// [Error3.tsx]
|
||||
let x3 = <div>;
|
||||
|
||||
|
||||
//// [Error4.tsx]
|
||||
let x4 = <div><div></span>;
|
||||
|
||||
//// [Error5.tsx]
|
||||
let x5 = <div><span>
|
||||
|
||||
|
||||
|
||||
//// [file.jsx]
|
||||
//// [Error1.jsx]
|
||||
// Issue error about missing span closing tag, not missing div closing tag
|
||||
var x1 = <div><span></div>;
|
||||
</>;
|
||||
//// [Error2.jsx]
|
||||
var x2 = <div></span>;
|
||||
//// [Error3.jsx]
|
||||
var x3 = <div>;
|
||||
|
||||
</>;
|
||||
//// [Error4.jsx]
|
||||
var x4 = <div><div></span>;
|
||||
</>;
|
||||
//// [Error5.jsx]
|
||||
var x5 = <div><span>
|
||||
|
||||
</></>;
|
||||
@@ -4,7 +4,7 @@
|
||||
export class Foo {}
|
||||
|
||||
//// [modulePrologueSystem.js]
|
||||
System.register([], function(exports_1, __moduleName) {
|
||||
System.register([], function(exports_1) {
|
||||
"use strict";
|
||||
var Foo;
|
||||
return {
|
||||
|
||||
@@ -11,7 +11,7 @@ export default function foo() { new Foo(); }
|
||||
|
||||
|
||||
//// [output.js]
|
||||
System.register("b", ["a"], function(exports_1, __moduleName) {
|
||||
System.register("b", ["a"], function(exports_1) {
|
||||
"use strict";
|
||||
var a_1;
|
||||
function foo() { new a_1.default(); }
|
||||
@@ -25,7 +25,7 @@ System.register("b", ["a"], function(exports_1, __moduleName) {
|
||||
}
|
||||
}
|
||||
});
|
||||
System.register("a", ["b"], function(exports_2, __moduleName) {
|
||||
System.register("a", ["b"], function(exports_2) {
|
||||
"use strict";
|
||||
var b_1;
|
||||
var Foo;
|
||||
|
||||
@@ -14,7 +14,7 @@ var __extends = (this && this.__extends) || function (d, b) {
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
System.register("ref/a", [], function(exports_1, __moduleName) {
|
||||
System.register("ref/a", [], function(exports_1) {
|
||||
"use strict";
|
||||
var A;
|
||||
return {
|
||||
@@ -29,7 +29,7 @@ System.register("ref/a", [], function(exports_1, __moduleName) {
|
||||
}
|
||||
}
|
||||
});
|
||||
System.register("b", ["ref/a"], function(exports_2, __moduleName) {
|
||||
System.register("b", ["ref/a"], function(exports_2) {
|
||||
"use strict";
|
||||
var a_1;
|
||||
var B;
|
||||
|
||||
@@ -13,7 +13,7 @@ sourceFile:tests/cases/compiler/ref/a.ts
|
||||
>>> function __() { this.constructor = d; }
|
||||
>>> d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
>>>};
|
||||
>>>System.register("ref/a", [], function(exports_1, __moduleName) {
|
||||
>>>System.register("ref/a", [], function(exports_1) {
|
||||
>>> "use strict";
|
||||
>>> var A;
|
||||
>>> return {
|
||||
@@ -82,7 +82,7 @@ sourceFile:tests/cases/compiler/b.ts
|
||||
>>> }
|
||||
>>> }
|
||||
>>>});
|
||||
>>>System.register("b", ["ref/a"], function(exports_2, __moduleName) {
|
||||
>>>System.register("b", ["ref/a"], function(exports_2) {
|
||||
>>> "use strict";
|
||||
>>> var a_1;
|
||||
>>> var B;
|
||||
|
||||
@@ -31,7 +31,7 @@ if (++y) {
|
||||
}
|
||||
|
||||
//// [prefixUnaryOperatorsOnExportedVariables.js]
|
||||
System.register([], function(exports_1, __moduleName) {
|
||||
System.register([], function(exports_1) {
|
||||
"use strict";
|
||||
var x, y;
|
||||
return {
|
||||
|
||||
@@ -10,7 +10,7 @@ import * as a from "a";
|
||||
|
||||
|
||||
//// [b.js]
|
||||
System.register([], function(exports_1, __moduleName) {
|
||||
System.register([], function(exports_1) {
|
||||
"use strict";
|
||||
return {
|
||||
setters:[],
|
||||
|
||||
@@ -10,7 +10,7 @@ import * as a from "a";
|
||||
|
||||
|
||||
//// [a.js]
|
||||
System.register([], function(exports_1, __moduleName) {
|
||||
System.register([], function(exports_1) {
|
||||
"use strict";
|
||||
var a;
|
||||
return {
|
||||
@@ -21,7 +21,7 @@ System.register([], function(exports_1, __moduleName) {
|
||||
}
|
||||
});
|
||||
//// [b.js]
|
||||
System.register([], function(exports_1, __moduleName) {
|
||||
System.register([], function(exports_1) {
|
||||
"use strict";
|
||||
return {
|
||||
setters:[],
|
||||
|
||||
@@ -12,7 +12,7 @@ import * as a from "a";
|
||||
|
||||
|
||||
//// [b.js]
|
||||
System.register([], function(exports_1, __moduleName) {
|
||||
System.register([], function(exports_1) {
|
||||
"use strict";
|
||||
return {
|
||||
setters:[],
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
export var x = 1;
|
||||
|
||||
//// [systemModule1.js]
|
||||
System.register([], function(exports_1, __moduleName) {
|
||||
System.register([], function(exports_1) {
|
||||
"use strict";
|
||||
var x;
|
||||
return {
|
||||
|
||||
@@ -10,7 +10,7 @@ export {n2}
|
||||
export {n2 as n3}
|
||||
|
||||
//// [systemModule10.js]
|
||||
System.register(['file1', 'file2'], function(exports_1, __moduleName) {
|
||||
System.register(['file1', 'file2'], function(exports_1) {
|
||||
"use strict";
|
||||
var file1_1, n2;
|
||||
return {
|
||||
|
||||
@@ -10,7 +10,7 @@ export {n2}
|
||||
export {n2 as n3}
|
||||
|
||||
//// [systemModule10_ES5.js]
|
||||
System.register(['file1', 'file2'], function(exports_1, __moduleName) {
|
||||
System.register(['file1', 'file2'], function(exports_1) {
|
||||
"use strict";
|
||||
var file1_1, n2;
|
||||
return {
|
||||
|
||||
@@ -42,7 +42,7 @@ export * from 'a';
|
||||
|
||||
//// [file1.js]
|
||||
// set of tests cases that checks generation of local storage for exported names
|
||||
System.register(['bar'], function(exports_1, __moduleName) {
|
||||
System.register(['bar'], function(exports_1) {
|
||||
"use strict";
|
||||
var x;
|
||||
function foo() { }
|
||||
@@ -68,7 +68,7 @@ System.register(['bar'], function(exports_1, __moduleName) {
|
||||
}
|
||||
});
|
||||
//// [file2.js]
|
||||
System.register(['bar'], function(exports_1, __moduleName) {
|
||||
System.register(['bar'], function(exports_1) {
|
||||
"use strict";
|
||||
var x, y;
|
||||
var exportedNames_1 = {
|
||||
@@ -94,7 +94,7 @@ System.register(['bar'], function(exports_1, __moduleName) {
|
||||
}
|
||||
});
|
||||
//// [file3.js]
|
||||
System.register(['a', 'bar'], function(exports_1, __moduleName) {
|
||||
System.register(['a', 'bar'], function(exports_1) {
|
||||
"use strict";
|
||||
function foo() { }
|
||||
exports_1("default", foo);
|
||||
@@ -125,7 +125,7 @@ System.register(['a', 'bar'], function(exports_1, __moduleName) {
|
||||
}
|
||||
});
|
||||
//// [file4.js]
|
||||
System.register(['a'], function(exports_1, __moduleName) {
|
||||
System.register(['a'], function(exports_1) {
|
||||
"use strict";
|
||||
var x, z, z1;
|
||||
function foo() { }
|
||||
@@ -147,7 +147,7 @@ System.register(['a'], function(exports_1, __moduleName) {
|
||||
}
|
||||
});
|
||||
//// [file5.js]
|
||||
System.register(['a'], function(exports_1, __moduleName) {
|
||||
System.register(['a'], function(exports_1) {
|
||||
"use strict";
|
||||
function foo() { }
|
||||
function exportStar_1(m) {
|
||||
|
||||
@@ -5,7 +5,7 @@ import n from 'file1'
|
||||
|
||||
|
||||
//// [systemModule12.js]
|
||||
System.register("NamedModule", [], function(exports_1, __moduleName) {
|
||||
System.register("NamedModule", [], function(exports_1) {
|
||||
"use strict";
|
||||
return {
|
||||
setters:[],
|
||||
|
||||
@@ -5,7 +5,7 @@ export const {a: z0, b: {c: z1}} = {a: true, b: {c: "123"}};
|
||||
for ([x] of [[1]]) {}
|
||||
|
||||
//// [systemModule13.js]
|
||||
System.register([], function(exports_1, __moduleName) {
|
||||
System.register([], function(exports_1) {
|
||||
"use strict";
|
||||
var x, y, z, z0, z1;
|
||||
return {
|
||||
|
||||
@@ -11,7 +11,7 @@ var x = 1;
|
||||
export {foo as b}
|
||||
|
||||
//// [systemModule14.js]
|
||||
System.register(["foo"], function(exports_1, __moduleName) {
|
||||
System.register(["foo"], function(exports_1) {
|
||||
"use strict";
|
||||
var foo_1;
|
||||
var x;
|
||||
|
||||
@@ -34,7 +34,7 @@ export default value;
|
||||
export var value2 = "v";
|
||||
|
||||
//// [file3.js]
|
||||
System.register([], function(exports_1, __moduleName) {
|
||||
System.register([], function(exports_1) {
|
||||
"use strict";
|
||||
var value;
|
||||
return {
|
||||
@@ -46,7 +46,7 @@ System.register([], function(exports_1, __moduleName) {
|
||||
}
|
||||
});
|
||||
//// [file4.js]
|
||||
System.register([], function(exports_1, __moduleName) {
|
||||
System.register([], function(exports_1) {
|
||||
"use strict";
|
||||
var value2;
|
||||
return {
|
||||
@@ -57,7 +57,7 @@ System.register([], function(exports_1, __moduleName) {
|
||||
}
|
||||
});
|
||||
//// [file2.js]
|
||||
System.register(["./file3"], function(exports_1, __moduleName) {
|
||||
System.register(["./file3"], function(exports_1) {
|
||||
"use strict";
|
||||
var moduleCStar, file3_1, file3_2;
|
||||
return {
|
||||
@@ -75,7 +75,7 @@ System.register(["./file3"], function(exports_1, __moduleName) {
|
||||
}
|
||||
});
|
||||
//// [file1.js]
|
||||
System.register(["./file2"], function(exports_1, __moduleName) {
|
||||
System.register(["./file2"], function(exports_1) {
|
||||
"use strict";
|
||||
var moduleB;
|
||||
return {
|
||||
|
||||
@@ -13,7 +13,7 @@ x,y,a1,b1,d1;
|
||||
|
||||
|
||||
//// [systemModule16.js]
|
||||
System.register(["foo", "bar"], function(exports_1, __moduleName) {
|
||||
System.register(["foo", "bar"], function(exports_1) {
|
||||
"use strict";
|
||||
var x, y, foo_1;
|
||||
var exportedNames_1 = {
|
||||
|
||||
@@ -42,7 +42,7 @@ export {II};
|
||||
export {II as II1};
|
||||
|
||||
//// [f1.js]
|
||||
System.register([], function(exports_1, __moduleName) {
|
||||
System.register([], function(exports_1) {
|
||||
"use strict";
|
||||
var A;
|
||||
return {
|
||||
@@ -58,7 +58,7 @@ System.register([], function(exports_1, __moduleName) {
|
||||
}
|
||||
});
|
||||
//// [f2.js]
|
||||
System.register(["f1"], function(exports_1, __moduleName) {
|
||||
System.register(["f1"], function(exports_1) {
|
||||
"use strict";
|
||||
var f1_1;
|
||||
var x, N, IX;
|
||||
|
||||
@@ -4,7 +4,7 @@ var x = 1;
|
||||
export = x;
|
||||
|
||||
//// [systemModule2.js]
|
||||
System.register([], function(exports_1, __moduleName) {
|
||||
System.register([], function(exports_1) {
|
||||
"use strict";
|
||||
var x;
|
||||
return {
|
||||
|
||||
@@ -18,7 +18,7 @@ export default class C {}
|
||||
export default class {}
|
||||
|
||||
//// [file1.js]
|
||||
System.register([], function(exports_1, __moduleName) {
|
||||
System.register([], function(exports_1) {
|
||||
"use strict";
|
||||
function default_1() { }
|
||||
exports_1("default", default_1);
|
||||
@@ -29,7 +29,7 @@ System.register([], function(exports_1, __moduleName) {
|
||||
}
|
||||
});
|
||||
//// [file2.js]
|
||||
System.register([], function(exports_1, __moduleName) {
|
||||
System.register([], function(exports_1) {
|
||||
"use strict";
|
||||
function f() { }
|
||||
exports_1("default", f);
|
||||
@@ -40,7 +40,7 @@ System.register([], function(exports_1, __moduleName) {
|
||||
}
|
||||
});
|
||||
//// [file3.js]
|
||||
System.register([], function(exports_1, __moduleName) {
|
||||
System.register([], function(exports_1) {
|
||||
"use strict";
|
||||
var C;
|
||||
return {
|
||||
@@ -56,7 +56,7 @@ System.register([], function(exports_1, __moduleName) {
|
||||
}
|
||||
});
|
||||
//// [file4.js]
|
||||
System.register([], function(exports_1, __moduleName) {
|
||||
System.register([], function(exports_1) {
|
||||
"use strict";
|
||||
var default_1;
|
||||
return {
|
||||
|
||||
@@ -4,7 +4,7 @@ export var x = 1;
|
||||
export var y;
|
||||
|
||||
//// [systemModule4.js]
|
||||
System.register([], function(exports_1, __moduleName) {
|
||||
System.register([], function(exports_1) {
|
||||
"use strict";
|
||||
var x, y;
|
||||
return {
|
||||
|
||||
@@ -4,7 +4,7 @@ export function foo() {}
|
||||
|
||||
|
||||
//// [systemModule5.js]
|
||||
System.register([], function(exports_1, __moduleName) {
|
||||
System.register([], function(exports_1) {
|
||||
"use strict";
|
||||
function foo() { }
|
||||
exports_1("foo", foo);
|
||||
|
||||
@@ -7,7 +7,7 @@ function foo() {
|
||||
|
||||
|
||||
//// [systemModule6.js]
|
||||
System.register([], function(exports_1, __moduleName) {
|
||||
System.register([], function(exports_1) {
|
||||
"use strict";
|
||||
var C;
|
||||
function foo() {
|
||||
|
||||
@@ -11,7 +11,7 @@ export module M {
|
||||
}
|
||||
|
||||
//// [systemModule7.js]
|
||||
System.register([], function(exports_1, __moduleName) {
|
||||
System.register([], function(exports_1) {
|
||||
"use strict";
|
||||
var M;
|
||||
return {
|
||||
|
||||
@@ -31,7 +31,7 @@ export const {a: z0, b: {c: z1}} = {a: true, b: {c: "123"}};
|
||||
for ([x] of [[1]]) {}
|
||||
|
||||
//// [systemModule8.js]
|
||||
System.register([], function(exports_1, __moduleName) {
|
||||
System.register([], function(exports_1) {
|
||||
"use strict";
|
||||
var x, y, z0, z1;
|
||||
function foo() {
|
||||
|
||||
@@ -22,7 +22,7 @@ export {x};
|
||||
export {y as z};
|
||||
|
||||
//// [systemModule9.js]
|
||||
System.register(['file1', 'file2', 'file3', 'file4', 'file5', 'file6', 'file7'], function(exports_1, __moduleName) {
|
||||
System.register(['file1', 'file2', 'file3', 'file4', 'file5', 'file6', 'file7'], function(exports_1) {
|
||||
"use strict";
|
||||
var ns, file2_1, file3_1, file5_1, ns3;
|
||||
var x, y;
|
||||
|
||||
@@ -29,7 +29,7 @@ export declare module M { var v: number; }
|
||||
|
||||
|
||||
//// [file1.js]
|
||||
System.register([], function(exports_1, __moduleName) {
|
||||
System.register([], function(exports_1) {
|
||||
"use strict";
|
||||
var promise, foo, c, e;
|
||||
return {
|
||||
@@ -44,7 +44,7 @@ System.register([], function(exports_1, __moduleName) {
|
||||
}
|
||||
});
|
||||
//// [file2.js]
|
||||
System.register([], function(exports_1, __moduleName) {
|
||||
System.register([], function(exports_1) {
|
||||
"use strict";
|
||||
return {
|
||||
setters:[],
|
||||
@@ -53,7 +53,7 @@ System.register([], function(exports_1, __moduleName) {
|
||||
}
|
||||
});
|
||||
//// [file3.js]
|
||||
System.register([], function(exports_1, __moduleName) {
|
||||
System.register([], function(exports_1) {
|
||||
"use strict";
|
||||
return {
|
||||
setters:[],
|
||||
@@ -62,7 +62,7 @@ System.register([], function(exports_1, __moduleName) {
|
||||
}
|
||||
});
|
||||
//// [file4.js]
|
||||
System.register([], function(exports_1, __moduleName) {
|
||||
System.register([], function(exports_1) {
|
||||
"use strict";
|
||||
return {
|
||||
setters:[],
|
||||
@@ -71,7 +71,7 @@ System.register([], function(exports_1, __moduleName) {
|
||||
}
|
||||
});
|
||||
//// [file5.js]
|
||||
System.register([], function(exports_1, __moduleName) {
|
||||
System.register([], function(exports_1) {
|
||||
"use strict";
|
||||
return {
|
||||
setters:[],
|
||||
@@ -80,7 +80,7 @@ System.register([], function(exports_1, __moduleName) {
|
||||
}
|
||||
});
|
||||
//// [file6.js]
|
||||
System.register([], function(exports_1, __moduleName) {
|
||||
System.register([], function(exports_1) {
|
||||
"use strict";
|
||||
return {
|
||||
setters:[],
|
||||
|
||||
@@ -13,7 +13,7 @@ module M {
|
||||
}
|
||||
|
||||
//// [systemModuleConstEnums.js]
|
||||
System.register([], function(exports_1, __moduleName) {
|
||||
System.register([], function(exports_1) {
|
||||
"use strict";
|
||||
function foo() {
|
||||
use(0 /* X */);
|
||||
|
||||
@@ -13,7 +13,7 @@ module M {
|
||||
}
|
||||
|
||||
//// [systemModuleConstEnumsSeparateCompilation.js]
|
||||
System.register([], function(exports_1, __moduleName) {
|
||||
System.register([], function(exports_1) {
|
||||
"use strict";
|
||||
var TopLevelConstEnum, M;
|
||||
function foo() {
|
||||
|
||||
@@ -10,7 +10,7 @@ export enum E {}
|
||||
export module E { var x; }
|
||||
|
||||
//// [systemModuleDeclarationMerging.js]
|
||||
System.register([], function(exports_1, __moduleName) {
|
||||
System.register([], function(exports_1) {
|
||||
"use strict";
|
||||
var F, C, E;
|
||||
function F() { }
|
||||
|
||||
@@ -16,7 +16,7 @@ export default class C {}
|
||||
|
||||
|
||||
//// [file1.js]
|
||||
System.register([], function(exports_1, __moduleName) {
|
||||
System.register([], function(exports_1) {
|
||||
"use strict";
|
||||
function default_1() { }
|
||||
exports_1("default", default_1);
|
||||
@@ -27,7 +27,7 @@ System.register([], function(exports_1, __moduleName) {
|
||||
}
|
||||
});
|
||||
//// [file2.js]
|
||||
System.register([], function(exports_1, __moduleName) {
|
||||
System.register([], function(exports_1) {
|
||||
"use strict";
|
||||
function foo() { }
|
||||
exports_1("default", foo);
|
||||
@@ -38,7 +38,7 @@ System.register([], function(exports_1, __moduleName) {
|
||||
}
|
||||
});
|
||||
//// [file3.js]
|
||||
System.register([], function(exports_1, __moduleName) {
|
||||
System.register([], function(exports_1) {
|
||||
"use strict";
|
||||
var default_1;
|
||||
return {
|
||||
@@ -54,7 +54,7 @@ System.register([], function(exports_1, __moduleName) {
|
||||
}
|
||||
});
|
||||
//// [file4.js]
|
||||
System.register([], function(exports_1, __moduleName) {
|
||||
System.register([], function(exports_1) {
|
||||
"use strict";
|
||||
var C;
|
||||
return {
|
||||
|
||||
@@ -13,7 +13,7 @@ export module TopLevelModule2 {
|
||||
}
|
||||
|
||||
//// [systemModuleNonTopLevelModuleMembers.js]
|
||||
System.register([], function(exports_1, __moduleName) {
|
||||
System.register([], function(exports_1) {
|
||||
"use strict";
|
||||
var TopLevelClass, TopLevelModule, TopLevelEnum, TopLevelModule2;
|
||||
function TopLevelFunction() { }
|
||||
|
||||
@@ -13,7 +13,7 @@ export class Bar extends Foo {
|
||||
}
|
||||
|
||||
//// [foo.js]
|
||||
System.register([], function(exports_1, __moduleName) {
|
||||
System.register([], function(exports_1) {
|
||||
"use strict";
|
||||
var Foo;
|
||||
return {
|
||||
@@ -29,7 +29,7 @@ System.register([], function(exports_1, __moduleName) {
|
||||
}
|
||||
});
|
||||
//// [bar.js]
|
||||
System.register(['./foo'], function(exports_1, __moduleName) {
|
||||
System.register(['./foo'], function(exports_1) {
|
||||
"use strict";
|
||||
var __extends = (this && this.__extends) || function (d, b) {
|
||||
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
tests/cases/conformance/jsx/file.tsx(5,11): error TS17008: JSX element 'div' has no corresponding closing tag.
|
||||
tests/cases/conformance/jsx/file.tsx(5,19): error TS1109: Expression expected.
|
||||
tests/cases/conformance/jsx/file.tsx(8,11): error TS2304: Cannot find name 'a'.
|
||||
tests/cases/conformance/jsx/file.tsx(8,12): error TS1005: '}' expected.
|
||||
tests/cases/conformance/jsx/file.tsx(9,1): error TS17002: Expected corresponding JSX closing tag for 'div'.
|
||||
tests/cases/conformance/jsx/file.tsx(9,1): error TS1005: '</' expected.
|
||||
|
||||
|
||||
==== tests/cases/conformance/jsx/file.tsx (4 errors) ====
|
||||
==== tests/cases/conformance/jsx/file.tsx (5 errors) ====
|
||||
|
||||
declare namespace JSX { interface Element { } }
|
||||
|
||||
function foo() {
|
||||
var x = <div> { </div>
|
||||
~~~
|
||||
!!! error TS17008: JSX element 'div' has no corresponding closing tag.
|
||||
~~
|
||||
!!! error TS1109: Expression expected.
|
||||
}
|
||||
@@ -21,4 +24,4 @@ tests/cases/conformance/jsx/file.tsx(9,1): error TS17002: Expected corresponding
|
||||
!!! error TS1005: '}' expected.
|
||||
|
||||
|
||||
!!! error TS17002: Expected corresponding JSX closing tag for 'div'.
|
||||
!!! error TS1005: '</' expected.
|
||||
@@ -75,7 +75,6 @@ function CreateIntegerTypedArraysFromArrayLike(obj:ArrayLike<number>) {
|
||||
return typedArrays;
|
||||
}
|
||||
|
||||
/*
|
||||
function CreateTypedArraysOf(obj) {
|
||||
var typedArrays = [];
|
||||
typedArrays[0] = Int8Array.of(...obj);
|
||||
@@ -90,7 +89,6 @@ function CreateTypedArraysOf(obj) {
|
||||
|
||||
return typedArrays;
|
||||
}
|
||||
*/
|
||||
|
||||
function CreateTypedArraysOf2() {
|
||||
var typedArrays = [];
|
||||
@@ -203,7 +201,6 @@ function CreateIntegerTypedArraysFromArrayLike(obj) {
|
||||
typedArrays[8] = Uint8ClampedArray.from(obj);
|
||||
return typedArrays;
|
||||
}
|
||||
/*
|
||||
function CreateTypedArraysOf(obj) {
|
||||
var typedArrays = [];
|
||||
typedArrays[0] = Int8Array.of(...obj);
|
||||
@@ -215,10 +212,8 @@ function CreateTypedArraysOf(obj) {
|
||||
typedArrays[6] = Float32Array.of(...obj);
|
||||
typedArrays[7] = Float64Array.of(...obj);
|
||||
typedArrays[8] = Uint8ClampedArray.of(...obj);
|
||||
|
||||
return typedArrays;
|
||||
}
|
||||
*/
|
||||
function CreateTypedArraysOf2() {
|
||||
var typedArrays = [];
|
||||
typedArrays[0] = Int8Array.of(1, 2, 3, 4);
|
||||
|
||||
@@ -307,267 +307,324 @@ function CreateIntegerTypedArraysFromArrayLike(obj:ArrayLike<number>) {
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 62, 7))
|
||||
}
|
||||
|
||||
/*
|
||||
function CreateTypedArraysOf(obj) {
|
||||
>CreateTypedArraysOf : Symbol(CreateTypedArraysOf, Decl(typedArrays.ts, 74, 1))
|
||||
>obj : Symbol(obj, Decl(typedArrays.ts, 76, 29))
|
||||
|
||||
var typedArrays = [];
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 77, 7))
|
||||
|
||||
typedArrays[0] = Int8Array.of(...obj);
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 77, 7))
|
||||
>Int8Array.of : Symbol(Int8ArrayConstructor.of, Decl(lib.d.ts, --, --))
|
||||
>Int8Array : Symbol(Int8Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>of : Symbol(Int8ArrayConstructor.of, Decl(lib.d.ts, --, --))
|
||||
>obj : Symbol(obj, Decl(typedArrays.ts, 76, 29))
|
||||
|
||||
typedArrays[1] = Uint8Array.of(...obj);
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 77, 7))
|
||||
>Uint8Array.of : Symbol(Uint8ArrayConstructor.of, Decl(lib.d.ts, --, --))
|
||||
>Uint8Array : Symbol(Uint8Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>of : Symbol(Uint8ArrayConstructor.of, Decl(lib.d.ts, --, --))
|
||||
>obj : Symbol(obj, Decl(typedArrays.ts, 76, 29))
|
||||
|
||||
typedArrays[2] = Int16Array.of(...obj);
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 77, 7))
|
||||
>Int16Array.of : Symbol(Int16ArrayConstructor.of, Decl(lib.d.ts, --, --))
|
||||
>Int16Array : Symbol(Int16Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>of : Symbol(Int16ArrayConstructor.of, Decl(lib.d.ts, --, --))
|
||||
>obj : Symbol(obj, Decl(typedArrays.ts, 76, 29))
|
||||
|
||||
typedArrays[3] = Uint16Array.of(...obj);
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 77, 7))
|
||||
>Uint16Array.of : Symbol(Uint16ArrayConstructor.of, Decl(lib.d.ts, --, --))
|
||||
>Uint16Array : Symbol(Uint16Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>of : Symbol(Uint16ArrayConstructor.of, Decl(lib.d.ts, --, --))
|
||||
>obj : Symbol(obj, Decl(typedArrays.ts, 76, 29))
|
||||
|
||||
typedArrays[4] = Int32Array.of(...obj);
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 77, 7))
|
||||
>Int32Array.of : Symbol(Int32ArrayConstructor.of, Decl(lib.d.ts, --, --))
|
||||
>Int32Array : Symbol(Int32Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>of : Symbol(Int32ArrayConstructor.of, Decl(lib.d.ts, --, --))
|
||||
>obj : Symbol(obj, Decl(typedArrays.ts, 76, 29))
|
||||
|
||||
typedArrays[5] = Uint32Array.of(...obj);
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 77, 7))
|
||||
>Uint32Array.of : Symbol(Uint32ArrayConstructor.of, Decl(lib.d.ts, --, --))
|
||||
>Uint32Array : Symbol(Uint32Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>of : Symbol(Uint32ArrayConstructor.of, Decl(lib.d.ts, --, --))
|
||||
>obj : Symbol(obj, Decl(typedArrays.ts, 76, 29))
|
||||
|
||||
typedArrays[6] = Float32Array.of(...obj);
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 77, 7))
|
||||
>Float32Array.of : Symbol(Float32ArrayConstructor.of, Decl(lib.d.ts, --, --))
|
||||
>Float32Array : Symbol(Float32Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>of : Symbol(Float32ArrayConstructor.of, Decl(lib.d.ts, --, --))
|
||||
>obj : Symbol(obj, Decl(typedArrays.ts, 76, 29))
|
||||
|
||||
typedArrays[7] = Float64Array.of(...obj);
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 77, 7))
|
||||
>Float64Array.of : Symbol(Float64ArrayConstructor.of, Decl(lib.d.ts, --, --))
|
||||
>Float64Array : Symbol(Float64Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>of : Symbol(Float64ArrayConstructor.of, Decl(lib.d.ts, --, --))
|
||||
>obj : Symbol(obj, Decl(typedArrays.ts, 76, 29))
|
||||
|
||||
typedArrays[8] = Uint8ClampedArray.of(...obj);
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 77, 7))
|
||||
>Uint8ClampedArray.of : Symbol(Uint8ClampedArrayConstructor.of, Decl(lib.d.ts, --, --))
|
||||
>Uint8ClampedArray : Symbol(Uint8ClampedArray, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>of : Symbol(Uint8ClampedArrayConstructor.of, Decl(lib.d.ts, --, --))
|
||||
>obj : Symbol(obj, Decl(typedArrays.ts, 76, 29))
|
||||
|
||||
return typedArrays;
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 77, 7))
|
||||
}
|
||||
*/
|
||||
|
||||
function CreateTypedArraysOf2() {
|
||||
>CreateTypedArraysOf2 : Symbol(CreateTypedArraysOf2, Decl(typedArrays.ts, 74, 1))
|
||||
>CreateTypedArraysOf2 : Symbol(CreateTypedArraysOf2, Decl(typedArrays.ts, 89, 1))
|
||||
|
||||
var typedArrays = [];
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 94, 7))
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 92, 7))
|
||||
|
||||
typedArrays[0] = Int8Array.of(1,2,3,4);
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 94, 7))
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 92, 7))
|
||||
>Int8Array.of : Symbol(Int8ArrayConstructor.of, Decl(lib.d.ts, --, --))
|
||||
>Int8Array : Symbol(Int8Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>of : Symbol(Int8ArrayConstructor.of, Decl(lib.d.ts, --, --))
|
||||
|
||||
typedArrays[1] = Uint8Array.of(1,2,3,4);
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 94, 7))
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 92, 7))
|
||||
>Uint8Array.of : Symbol(Uint8ArrayConstructor.of, Decl(lib.d.ts, --, --))
|
||||
>Uint8Array : Symbol(Uint8Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>of : Symbol(Uint8ArrayConstructor.of, Decl(lib.d.ts, --, --))
|
||||
|
||||
typedArrays[2] = Int16Array.of(1,2,3,4);
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 94, 7))
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 92, 7))
|
||||
>Int16Array.of : Symbol(Int16ArrayConstructor.of, Decl(lib.d.ts, --, --))
|
||||
>Int16Array : Symbol(Int16Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>of : Symbol(Int16ArrayConstructor.of, Decl(lib.d.ts, --, --))
|
||||
|
||||
typedArrays[3] = Uint16Array.of(1,2,3,4);
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 94, 7))
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 92, 7))
|
||||
>Uint16Array.of : Symbol(Uint16ArrayConstructor.of, Decl(lib.d.ts, --, --))
|
||||
>Uint16Array : Symbol(Uint16Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>of : Symbol(Uint16ArrayConstructor.of, Decl(lib.d.ts, --, --))
|
||||
|
||||
typedArrays[4] = Int32Array.of(1,2,3,4);
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 94, 7))
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 92, 7))
|
||||
>Int32Array.of : Symbol(Int32ArrayConstructor.of, Decl(lib.d.ts, --, --))
|
||||
>Int32Array : Symbol(Int32Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>of : Symbol(Int32ArrayConstructor.of, Decl(lib.d.ts, --, --))
|
||||
|
||||
typedArrays[5] = Uint32Array.of(1,2,3,4);
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 94, 7))
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 92, 7))
|
||||
>Uint32Array.of : Symbol(Uint32ArrayConstructor.of, Decl(lib.d.ts, --, --))
|
||||
>Uint32Array : Symbol(Uint32Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>of : Symbol(Uint32ArrayConstructor.of, Decl(lib.d.ts, --, --))
|
||||
|
||||
typedArrays[6] = Float32Array.of(1,2,3,4);
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 94, 7))
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 92, 7))
|
||||
>Float32Array.of : Symbol(Float32ArrayConstructor.of, Decl(lib.d.ts, --, --))
|
||||
>Float32Array : Symbol(Float32Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>of : Symbol(Float32ArrayConstructor.of, Decl(lib.d.ts, --, --))
|
||||
|
||||
typedArrays[7] = Float64Array.of(1,2,3,4);
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 94, 7))
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 92, 7))
|
||||
>Float64Array.of : Symbol(Float64ArrayConstructor.of, Decl(lib.d.ts, --, --))
|
||||
>Float64Array : Symbol(Float64Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>of : Symbol(Float64ArrayConstructor.of, Decl(lib.d.ts, --, --))
|
||||
|
||||
typedArrays[8] = Uint8ClampedArray.of(1,2,3,4);
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 94, 7))
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 92, 7))
|
||||
>Uint8ClampedArray.of : Symbol(Uint8ClampedArrayConstructor.of, Decl(lib.d.ts, --, --))
|
||||
>Uint8ClampedArray : Symbol(Uint8ClampedArray, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>of : Symbol(Uint8ClampedArrayConstructor.of, Decl(lib.d.ts, --, --))
|
||||
|
||||
return typedArrays;
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 94, 7))
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 92, 7))
|
||||
}
|
||||
|
||||
function CreateTypedArraysFromMapFn(obj:ArrayLike<number>, mapFn: (n:number, v:number)=> number) {
|
||||
>CreateTypedArraysFromMapFn : Symbol(CreateTypedArraysFromMapFn, Decl(typedArrays.ts, 106, 1))
|
||||
>obj : Symbol(obj, Decl(typedArrays.ts, 108, 36))
|
||||
>CreateTypedArraysFromMapFn : Symbol(CreateTypedArraysFromMapFn, Decl(typedArrays.ts, 104, 1))
|
||||
>obj : Symbol(obj, Decl(typedArrays.ts, 106, 36))
|
||||
>ArrayLike : Symbol(ArrayLike, Decl(lib.d.ts, --, --))
|
||||
>mapFn : Symbol(mapFn, Decl(typedArrays.ts, 108, 58))
|
||||
>n : Symbol(n, Decl(typedArrays.ts, 108, 67))
|
||||
>v : Symbol(v, Decl(typedArrays.ts, 108, 76))
|
||||
>mapFn : Symbol(mapFn, Decl(typedArrays.ts, 106, 58))
|
||||
>n : Symbol(n, Decl(typedArrays.ts, 106, 67))
|
||||
>v : Symbol(v, Decl(typedArrays.ts, 106, 76))
|
||||
|
||||
var typedArrays = [];
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 109, 7))
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 107, 7))
|
||||
|
||||
typedArrays[0] = Int8Array.from(obj, mapFn);
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 109, 7))
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 107, 7))
|
||||
>Int8Array.from : Symbol(Int8ArrayConstructor.from, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>Int8Array : Symbol(Int8Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>from : Symbol(Int8ArrayConstructor.from, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>obj : Symbol(obj, Decl(typedArrays.ts, 108, 36))
|
||||
>mapFn : Symbol(mapFn, Decl(typedArrays.ts, 108, 58))
|
||||
>obj : Symbol(obj, Decl(typedArrays.ts, 106, 36))
|
||||
>mapFn : Symbol(mapFn, Decl(typedArrays.ts, 106, 58))
|
||||
|
||||
typedArrays[1] = Uint8Array.from(obj, mapFn);
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 109, 7))
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 107, 7))
|
||||
>Uint8Array.from : Symbol(Uint8ArrayConstructor.from, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>Uint8Array : Symbol(Uint8Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>from : Symbol(Uint8ArrayConstructor.from, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>obj : Symbol(obj, Decl(typedArrays.ts, 108, 36))
|
||||
>mapFn : Symbol(mapFn, Decl(typedArrays.ts, 108, 58))
|
||||
>obj : Symbol(obj, Decl(typedArrays.ts, 106, 36))
|
||||
>mapFn : Symbol(mapFn, Decl(typedArrays.ts, 106, 58))
|
||||
|
||||
typedArrays[2] = Int16Array.from(obj, mapFn);
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 109, 7))
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 107, 7))
|
||||
>Int16Array.from : Symbol(Int16ArrayConstructor.from, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>Int16Array : Symbol(Int16Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>from : Symbol(Int16ArrayConstructor.from, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>obj : Symbol(obj, Decl(typedArrays.ts, 108, 36))
|
||||
>mapFn : Symbol(mapFn, Decl(typedArrays.ts, 108, 58))
|
||||
>obj : Symbol(obj, Decl(typedArrays.ts, 106, 36))
|
||||
>mapFn : Symbol(mapFn, Decl(typedArrays.ts, 106, 58))
|
||||
|
||||
typedArrays[3] = Uint16Array.from(obj, mapFn);
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 109, 7))
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 107, 7))
|
||||
>Uint16Array.from : Symbol(Uint16ArrayConstructor.from, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>Uint16Array : Symbol(Uint16Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>from : Symbol(Uint16ArrayConstructor.from, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>obj : Symbol(obj, Decl(typedArrays.ts, 108, 36))
|
||||
>mapFn : Symbol(mapFn, Decl(typedArrays.ts, 108, 58))
|
||||
>obj : Symbol(obj, Decl(typedArrays.ts, 106, 36))
|
||||
>mapFn : Symbol(mapFn, Decl(typedArrays.ts, 106, 58))
|
||||
|
||||
typedArrays[4] = Int32Array.from(obj, mapFn);
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 109, 7))
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 107, 7))
|
||||
>Int32Array.from : Symbol(Int32ArrayConstructor.from, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>Int32Array : Symbol(Int32Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>from : Symbol(Int32ArrayConstructor.from, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>obj : Symbol(obj, Decl(typedArrays.ts, 108, 36))
|
||||
>mapFn : Symbol(mapFn, Decl(typedArrays.ts, 108, 58))
|
||||
>obj : Symbol(obj, Decl(typedArrays.ts, 106, 36))
|
||||
>mapFn : Symbol(mapFn, Decl(typedArrays.ts, 106, 58))
|
||||
|
||||
typedArrays[5] = Uint32Array.from(obj, mapFn);
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 109, 7))
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 107, 7))
|
||||
>Uint32Array.from : Symbol(Uint32ArrayConstructor.from, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>Uint32Array : Symbol(Uint32Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>from : Symbol(Uint32ArrayConstructor.from, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>obj : Symbol(obj, Decl(typedArrays.ts, 108, 36))
|
||||
>mapFn : Symbol(mapFn, Decl(typedArrays.ts, 108, 58))
|
||||
>obj : Symbol(obj, Decl(typedArrays.ts, 106, 36))
|
||||
>mapFn : Symbol(mapFn, Decl(typedArrays.ts, 106, 58))
|
||||
|
||||
typedArrays[6] = Float32Array.from(obj, mapFn);
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 109, 7))
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 107, 7))
|
||||
>Float32Array.from : Symbol(Float32ArrayConstructor.from, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>Float32Array : Symbol(Float32Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>from : Symbol(Float32ArrayConstructor.from, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>obj : Symbol(obj, Decl(typedArrays.ts, 108, 36))
|
||||
>mapFn : Symbol(mapFn, Decl(typedArrays.ts, 108, 58))
|
||||
>obj : Symbol(obj, Decl(typedArrays.ts, 106, 36))
|
||||
>mapFn : Symbol(mapFn, Decl(typedArrays.ts, 106, 58))
|
||||
|
||||
typedArrays[7] = Float64Array.from(obj, mapFn);
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 109, 7))
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 107, 7))
|
||||
>Float64Array.from : Symbol(Float64ArrayConstructor.from, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>Float64Array : Symbol(Float64Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>from : Symbol(Float64ArrayConstructor.from, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>obj : Symbol(obj, Decl(typedArrays.ts, 108, 36))
|
||||
>mapFn : Symbol(mapFn, Decl(typedArrays.ts, 108, 58))
|
||||
>obj : Symbol(obj, Decl(typedArrays.ts, 106, 36))
|
||||
>mapFn : Symbol(mapFn, Decl(typedArrays.ts, 106, 58))
|
||||
|
||||
typedArrays[8] = Uint8ClampedArray.from(obj, mapFn);
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 109, 7))
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 107, 7))
|
||||
>Uint8ClampedArray.from : Symbol(Uint8ClampedArrayConstructor.from, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>Uint8ClampedArray : Symbol(Uint8ClampedArray, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>from : Symbol(Uint8ClampedArrayConstructor.from, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>obj : Symbol(obj, Decl(typedArrays.ts, 108, 36))
|
||||
>mapFn : Symbol(mapFn, Decl(typedArrays.ts, 108, 58))
|
||||
>obj : Symbol(obj, Decl(typedArrays.ts, 106, 36))
|
||||
>mapFn : Symbol(mapFn, Decl(typedArrays.ts, 106, 58))
|
||||
|
||||
return typedArrays;
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 109, 7))
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 107, 7))
|
||||
}
|
||||
|
||||
function CreateTypedArraysFromThisObj(obj:ArrayLike<number>, mapFn: (n:number, v:number)=> number, thisArg: {}) {
|
||||
>CreateTypedArraysFromThisObj : Symbol(CreateTypedArraysFromThisObj, Decl(typedArrays.ts, 121, 1))
|
||||
>obj : Symbol(obj, Decl(typedArrays.ts, 123, 38))
|
||||
>CreateTypedArraysFromThisObj : Symbol(CreateTypedArraysFromThisObj, Decl(typedArrays.ts, 119, 1))
|
||||
>obj : Symbol(obj, Decl(typedArrays.ts, 121, 38))
|
||||
>ArrayLike : Symbol(ArrayLike, Decl(lib.d.ts, --, --))
|
||||
>mapFn : Symbol(mapFn, Decl(typedArrays.ts, 123, 60))
|
||||
>n : Symbol(n, Decl(typedArrays.ts, 123, 69))
|
||||
>v : Symbol(v, Decl(typedArrays.ts, 123, 78))
|
||||
>thisArg : Symbol(thisArg, Decl(typedArrays.ts, 123, 98))
|
||||
>mapFn : Symbol(mapFn, Decl(typedArrays.ts, 121, 60))
|
||||
>n : Symbol(n, Decl(typedArrays.ts, 121, 69))
|
||||
>v : Symbol(v, Decl(typedArrays.ts, 121, 78))
|
||||
>thisArg : Symbol(thisArg, Decl(typedArrays.ts, 121, 98))
|
||||
|
||||
var typedArrays = [];
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 124, 7))
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 122, 7))
|
||||
|
||||
typedArrays[0] = Int8Array.from(obj, mapFn, thisArg);
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 124, 7))
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 122, 7))
|
||||
>Int8Array.from : Symbol(Int8ArrayConstructor.from, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>Int8Array : Symbol(Int8Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>from : Symbol(Int8ArrayConstructor.from, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>obj : Symbol(obj, Decl(typedArrays.ts, 123, 38))
|
||||
>mapFn : Symbol(mapFn, Decl(typedArrays.ts, 123, 60))
|
||||
>thisArg : Symbol(thisArg, Decl(typedArrays.ts, 123, 98))
|
||||
>obj : Symbol(obj, Decl(typedArrays.ts, 121, 38))
|
||||
>mapFn : Symbol(mapFn, Decl(typedArrays.ts, 121, 60))
|
||||
>thisArg : Symbol(thisArg, Decl(typedArrays.ts, 121, 98))
|
||||
|
||||
typedArrays[1] = Uint8Array.from(obj, mapFn, thisArg);
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 124, 7))
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 122, 7))
|
||||
>Uint8Array.from : Symbol(Uint8ArrayConstructor.from, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>Uint8Array : Symbol(Uint8Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>from : Symbol(Uint8ArrayConstructor.from, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>obj : Symbol(obj, Decl(typedArrays.ts, 123, 38))
|
||||
>mapFn : Symbol(mapFn, Decl(typedArrays.ts, 123, 60))
|
||||
>thisArg : Symbol(thisArg, Decl(typedArrays.ts, 123, 98))
|
||||
>obj : Symbol(obj, Decl(typedArrays.ts, 121, 38))
|
||||
>mapFn : Symbol(mapFn, Decl(typedArrays.ts, 121, 60))
|
||||
>thisArg : Symbol(thisArg, Decl(typedArrays.ts, 121, 98))
|
||||
|
||||
typedArrays[2] = Int16Array.from(obj, mapFn, thisArg);
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 124, 7))
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 122, 7))
|
||||
>Int16Array.from : Symbol(Int16ArrayConstructor.from, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>Int16Array : Symbol(Int16Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>from : Symbol(Int16ArrayConstructor.from, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>obj : Symbol(obj, Decl(typedArrays.ts, 123, 38))
|
||||
>mapFn : Symbol(mapFn, Decl(typedArrays.ts, 123, 60))
|
||||
>thisArg : Symbol(thisArg, Decl(typedArrays.ts, 123, 98))
|
||||
>obj : Symbol(obj, Decl(typedArrays.ts, 121, 38))
|
||||
>mapFn : Symbol(mapFn, Decl(typedArrays.ts, 121, 60))
|
||||
>thisArg : Symbol(thisArg, Decl(typedArrays.ts, 121, 98))
|
||||
|
||||
typedArrays[3] = Uint16Array.from(obj, mapFn, thisArg);
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 124, 7))
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 122, 7))
|
||||
>Uint16Array.from : Symbol(Uint16ArrayConstructor.from, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>Uint16Array : Symbol(Uint16Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>from : Symbol(Uint16ArrayConstructor.from, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>obj : Symbol(obj, Decl(typedArrays.ts, 123, 38))
|
||||
>mapFn : Symbol(mapFn, Decl(typedArrays.ts, 123, 60))
|
||||
>thisArg : Symbol(thisArg, Decl(typedArrays.ts, 123, 98))
|
||||
>obj : Symbol(obj, Decl(typedArrays.ts, 121, 38))
|
||||
>mapFn : Symbol(mapFn, Decl(typedArrays.ts, 121, 60))
|
||||
>thisArg : Symbol(thisArg, Decl(typedArrays.ts, 121, 98))
|
||||
|
||||
typedArrays[4] = Int32Array.from(obj, mapFn, thisArg);
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 124, 7))
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 122, 7))
|
||||
>Int32Array.from : Symbol(Int32ArrayConstructor.from, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>Int32Array : Symbol(Int32Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>from : Symbol(Int32ArrayConstructor.from, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>obj : Symbol(obj, Decl(typedArrays.ts, 123, 38))
|
||||
>mapFn : Symbol(mapFn, Decl(typedArrays.ts, 123, 60))
|
||||
>thisArg : Symbol(thisArg, Decl(typedArrays.ts, 123, 98))
|
||||
>obj : Symbol(obj, Decl(typedArrays.ts, 121, 38))
|
||||
>mapFn : Symbol(mapFn, Decl(typedArrays.ts, 121, 60))
|
||||
>thisArg : Symbol(thisArg, Decl(typedArrays.ts, 121, 98))
|
||||
|
||||
typedArrays[5] = Uint32Array.from(obj, mapFn, thisArg);
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 124, 7))
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 122, 7))
|
||||
>Uint32Array.from : Symbol(Uint32ArrayConstructor.from, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>Uint32Array : Symbol(Uint32Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>from : Symbol(Uint32ArrayConstructor.from, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>obj : Symbol(obj, Decl(typedArrays.ts, 123, 38))
|
||||
>mapFn : Symbol(mapFn, Decl(typedArrays.ts, 123, 60))
|
||||
>thisArg : Symbol(thisArg, Decl(typedArrays.ts, 123, 98))
|
||||
>obj : Symbol(obj, Decl(typedArrays.ts, 121, 38))
|
||||
>mapFn : Symbol(mapFn, Decl(typedArrays.ts, 121, 60))
|
||||
>thisArg : Symbol(thisArg, Decl(typedArrays.ts, 121, 98))
|
||||
|
||||
typedArrays[6] = Float32Array.from(obj, mapFn, thisArg);
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 124, 7))
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 122, 7))
|
||||
>Float32Array.from : Symbol(Float32ArrayConstructor.from, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>Float32Array : Symbol(Float32Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>from : Symbol(Float32ArrayConstructor.from, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>obj : Symbol(obj, Decl(typedArrays.ts, 123, 38))
|
||||
>mapFn : Symbol(mapFn, Decl(typedArrays.ts, 123, 60))
|
||||
>thisArg : Symbol(thisArg, Decl(typedArrays.ts, 123, 98))
|
||||
>obj : Symbol(obj, Decl(typedArrays.ts, 121, 38))
|
||||
>mapFn : Symbol(mapFn, Decl(typedArrays.ts, 121, 60))
|
||||
>thisArg : Symbol(thisArg, Decl(typedArrays.ts, 121, 98))
|
||||
|
||||
typedArrays[7] = Float64Array.from(obj, mapFn, thisArg);
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 124, 7))
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 122, 7))
|
||||
>Float64Array.from : Symbol(Float64ArrayConstructor.from, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>Float64Array : Symbol(Float64Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>from : Symbol(Float64ArrayConstructor.from, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>obj : Symbol(obj, Decl(typedArrays.ts, 123, 38))
|
||||
>mapFn : Symbol(mapFn, Decl(typedArrays.ts, 123, 60))
|
||||
>thisArg : Symbol(thisArg, Decl(typedArrays.ts, 123, 98))
|
||||
>obj : Symbol(obj, Decl(typedArrays.ts, 121, 38))
|
||||
>mapFn : Symbol(mapFn, Decl(typedArrays.ts, 121, 60))
|
||||
>thisArg : Symbol(thisArg, Decl(typedArrays.ts, 121, 98))
|
||||
|
||||
typedArrays[8] = Uint8ClampedArray.from(obj, mapFn, thisArg);
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 124, 7))
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 122, 7))
|
||||
>Uint8ClampedArray.from : Symbol(Uint8ClampedArrayConstructor.from, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>Uint8ClampedArray : Symbol(Uint8ClampedArray, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>from : Symbol(Uint8ClampedArrayConstructor.from, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>obj : Symbol(obj, Decl(typedArrays.ts, 123, 38))
|
||||
>mapFn : Symbol(mapFn, Decl(typedArrays.ts, 123, 60))
|
||||
>thisArg : Symbol(thisArg, Decl(typedArrays.ts, 123, 98))
|
||||
>obj : Symbol(obj, Decl(typedArrays.ts, 121, 38))
|
||||
>mapFn : Symbol(mapFn, Decl(typedArrays.ts, 121, 60))
|
||||
>thisArg : Symbol(thisArg, Decl(typedArrays.ts, 121, 98))
|
||||
|
||||
return typedArrays;
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 124, 7))
|
||||
>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 122, 7))
|
||||
}
|
||||
|
||||
@@ -483,22 +483,125 @@ function CreateIntegerTypedArraysFromArrayLike(obj:ArrayLike<number>) {
|
||||
>typedArrays : any[]
|
||||
}
|
||||
|
||||
/*
|
||||
function CreateTypedArraysOf(obj) {
|
||||
>CreateTypedArraysOf : (obj: any) => any[]
|
||||
>obj : any
|
||||
|
||||
var typedArrays = [];
|
||||
>typedArrays : any[]
|
||||
>[] : undefined[]
|
||||
|
||||
typedArrays[0] = Int8Array.of(...obj);
|
||||
>typedArrays[0] = Int8Array.of(...obj) : Int8Array
|
||||
>typedArrays[0] : any
|
||||
>typedArrays : any[]
|
||||
>0 : number
|
||||
>Int8Array.of(...obj) : Int8Array
|
||||
>Int8Array.of : (...items: number[]) => Int8Array
|
||||
>Int8Array : Int8ArrayConstructor
|
||||
>of : (...items: number[]) => Int8Array
|
||||
>...obj : any
|
||||
>obj : any
|
||||
|
||||
typedArrays[1] = Uint8Array.of(...obj);
|
||||
>typedArrays[1] = Uint8Array.of(...obj) : Uint8Array
|
||||
>typedArrays[1] : any
|
||||
>typedArrays : any[]
|
||||
>1 : number
|
||||
>Uint8Array.of(...obj) : Uint8Array
|
||||
>Uint8Array.of : (...items: number[]) => Uint8Array
|
||||
>Uint8Array : Uint8ArrayConstructor
|
||||
>of : (...items: number[]) => Uint8Array
|
||||
>...obj : any
|
||||
>obj : any
|
||||
|
||||
typedArrays[2] = Int16Array.of(...obj);
|
||||
>typedArrays[2] = Int16Array.of(...obj) : Int16Array
|
||||
>typedArrays[2] : any
|
||||
>typedArrays : any[]
|
||||
>2 : number
|
||||
>Int16Array.of(...obj) : Int16Array
|
||||
>Int16Array.of : (...items: number[]) => Int16Array
|
||||
>Int16Array : Int16ArrayConstructor
|
||||
>of : (...items: number[]) => Int16Array
|
||||
>...obj : any
|
||||
>obj : any
|
||||
|
||||
typedArrays[3] = Uint16Array.of(...obj);
|
||||
>typedArrays[3] = Uint16Array.of(...obj) : Uint16Array
|
||||
>typedArrays[3] : any
|
||||
>typedArrays : any[]
|
||||
>3 : number
|
||||
>Uint16Array.of(...obj) : Uint16Array
|
||||
>Uint16Array.of : (...items: number[]) => Uint16Array
|
||||
>Uint16Array : Uint16ArrayConstructor
|
||||
>of : (...items: number[]) => Uint16Array
|
||||
>...obj : any
|
||||
>obj : any
|
||||
|
||||
typedArrays[4] = Int32Array.of(...obj);
|
||||
>typedArrays[4] = Int32Array.of(...obj) : Int32Array
|
||||
>typedArrays[4] : any
|
||||
>typedArrays : any[]
|
||||
>4 : number
|
||||
>Int32Array.of(...obj) : Int32Array
|
||||
>Int32Array.of : (...items: number[]) => Int32Array
|
||||
>Int32Array : Int32ArrayConstructor
|
||||
>of : (...items: number[]) => Int32Array
|
||||
>...obj : any
|
||||
>obj : any
|
||||
|
||||
typedArrays[5] = Uint32Array.of(...obj);
|
||||
>typedArrays[5] = Uint32Array.of(...obj) : Uint32Array
|
||||
>typedArrays[5] : any
|
||||
>typedArrays : any[]
|
||||
>5 : number
|
||||
>Uint32Array.of(...obj) : Uint32Array
|
||||
>Uint32Array.of : (...items: number[]) => Uint32Array
|
||||
>Uint32Array : Uint32ArrayConstructor
|
||||
>of : (...items: number[]) => Uint32Array
|
||||
>...obj : any
|
||||
>obj : any
|
||||
|
||||
typedArrays[6] = Float32Array.of(...obj);
|
||||
>typedArrays[6] = Float32Array.of(...obj) : Float32Array
|
||||
>typedArrays[6] : any
|
||||
>typedArrays : any[]
|
||||
>6 : number
|
||||
>Float32Array.of(...obj) : Float32Array
|
||||
>Float32Array.of : (...items: number[]) => Float32Array
|
||||
>Float32Array : Float32ArrayConstructor
|
||||
>of : (...items: number[]) => Float32Array
|
||||
>...obj : any
|
||||
>obj : any
|
||||
|
||||
typedArrays[7] = Float64Array.of(...obj);
|
||||
>typedArrays[7] = Float64Array.of(...obj) : Float64Array
|
||||
>typedArrays[7] : any
|
||||
>typedArrays : any[]
|
||||
>7 : number
|
||||
>Float64Array.of(...obj) : Float64Array
|
||||
>Float64Array.of : (...items: number[]) => Float64Array
|
||||
>Float64Array : Float64ArrayConstructor
|
||||
>of : (...items: number[]) => Float64Array
|
||||
>...obj : any
|
||||
>obj : any
|
||||
|
||||
typedArrays[8] = Uint8ClampedArray.of(...obj);
|
||||
>typedArrays[8] = Uint8ClampedArray.of(...obj) : Uint8ClampedArray
|
||||
>typedArrays[8] : any
|
||||
>typedArrays : any[]
|
||||
>8 : number
|
||||
>Uint8ClampedArray.of(...obj) : Uint8ClampedArray
|
||||
>Uint8ClampedArray.of : (...items: number[]) => Uint8ClampedArray
|
||||
>Uint8ClampedArray : Uint8ClampedArrayConstructor
|
||||
>of : (...items: number[]) => Uint8ClampedArray
|
||||
>...obj : any
|
||||
>obj : any
|
||||
|
||||
return typedArrays;
|
||||
>typedArrays : any[]
|
||||
}
|
||||
*/
|
||||
|
||||
function CreateTypedArraysOf2() {
|
||||
>CreateTypedArraysOf2 : () => any[]
|
||||
|
||||
@@ -0,0 +1,545 @@
|
||||
tests/cases/compiler/typedArraysCrossAssignability01.ts(14,5): error TS2322: Type 'Uint8Array' is not assignable to type 'Int8Array'.
|
||||
Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
Type '"UInt8Array"' is not assignable to type '"Int8Array"'.
|
||||
tests/cases/compiler/typedArraysCrossAssignability01.ts(15,5): error TS2322: Type 'Int16Array' is not assignable to type 'Int8Array'.
|
||||
Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
Type '"Int16Array"' is not assignable to type '"Int8Array"'.
|
||||
tests/cases/compiler/typedArraysCrossAssignability01.ts(16,5): error TS2322: Type 'Uint16Array' is not assignable to type 'Int8Array'.
|
||||
Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
Type '"Uint16Array"' is not assignable to type '"Int8Array"'.
|
||||
tests/cases/compiler/typedArraysCrossAssignability01.ts(17,5): error TS2322: Type 'Int32Array' is not assignable to type 'Int8Array'.
|
||||
Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
Type '"Int32Array"' is not assignable to type '"Int8Array"'.
|
||||
tests/cases/compiler/typedArraysCrossAssignability01.ts(18,5): error TS2322: Type 'Uint32Array' is not assignable to type 'Int8Array'.
|
||||
Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
Type '"Uint32Array"' is not assignable to type '"Int8Array"'.
|
||||
tests/cases/compiler/typedArraysCrossAssignability01.ts(19,5): error TS2322: Type 'Float32Array' is not assignable to type 'Int8Array'.
|
||||
Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
Type '"Float32Array"' is not assignable to type '"Int8Array"'.
|
||||
tests/cases/compiler/typedArraysCrossAssignability01.ts(20,5): error TS2322: Type 'Float64Array' is not assignable to type 'Int8Array'.
|
||||
Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
Type '"Float64Array"' is not assignable to type '"Int8Array"'.
|
||||
tests/cases/compiler/typedArraysCrossAssignability01.ts(21,5): error TS2322: Type 'Uint8ClampedArray' is not assignable to type 'Int8Array'.
|
||||
Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
Type '"Uint8ClampedArray"' is not assignable to type '"Int8Array"'.
|
||||
tests/cases/compiler/typedArraysCrossAssignability01.ts(23,5): error TS2322: Type 'Int8Array' is not assignable to type 'Uint8Array'.
|
||||
Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
Type '"Int8Array"' is not assignable to type '"UInt8Array"'.
|
||||
tests/cases/compiler/typedArraysCrossAssignability01.ts(25,5): error TS2322: Type 'Int16Array' is not assignable to type 'Uint8Array'.
|
||||
Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
Type '"Int16Array"' is not assignable to type '"UInt8Array"'.
|
||||
tests/cases/compiler/typedArraysCrossAssignability01.ts(26,5): error TS2322: Type 'Uint16Array' is not assignable to type 'Uint8Array'.
|
||||
Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
Type '"Uint16Array"' is not assignable to type '"UInt8Array"'.
|
||||
tests/cases/compiler/typedArraysCrossAssignability01.ts(27,5): error TS2322: Type 'Int32Array' is not assignable to type 'Uint8Array'.
|
||||
Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
Type '"Int32Array"' is not assignable to type '"UInt8Array"'.
|
||||
tests/cases/compiler/typedArraysCrossAssignability01.ts(28,5): error TS2322: Type 'Uint32Array' is not assignable to type 'Uint8Array'.
|
||||
Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
Type '"Uint32Array"' is not assignable to type '"UInt8Array"'.
|
||||
tests/cases/compiler/typedArraysCrossAssignability01.ts(29,5): error TS2322: Type 'Float32Array' is not assignable to type 'Uint8Array'.
|
||||
Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
Type '"Float32Array"' is not assignable to type '"UInt8Array"'.
|
||||
tests/cases/compiler/typedArraysCrossAssignability01.ts(30,5): error TS2322: Type 'Float64Array' is not assignable to type 'Uint8Array'.
|
||||
Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
Type '"Float64Array"' is not assignable to type '"UInt8Array"'.
|
||||
tests/cases/compiler/typedArraysCrossAssignability01.ts(31,5): error TS2322: Type 'Uint8ClampedArray' is not assignable to type 'Uint8Array'.
|
||||
Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
Type '"Uint8ClampedArray"' is not assignable to type '"UInt8Array"'.
|
||||
tests/cases/compiler/typedArraysCrossAssignability01.ts(33,5): error TS2322: Type 'Int8Array' is not assignable to type 'Int16Array'.
|
||||
Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
Type '"Int8Array"' is not assignable to type '"Int16Array"'.
|
||||
tests/cases/compiler/typedArraysCrossAssignability01.ts(34,5): error TS2322: Type 'Uint8Array' is not assignable to type 'Int16Array'.
|
||||
Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
Type '"UInt8Array"' is not assignable to type '"Int16Array"'.
|
||||
tests/cases/compiler/typedArraysCrossAssignability01.ts(36,5): error TS2322: Type 'Uint16Array' is not assignable to type 'Int16Array'.
|
||||
Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
Type '"Uint16Array"' is not assignable to type '"Int16Array"'.
|
||||
tests/cases/compiler/typedArraysCrossAssignability01.ts(37,5): error TS2322: Type 'Int32Array' is not assignable to type 'Int16Array'.
|
||||
Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
Type '"Int32Array"' is not assignable to type '"Int16Array"'.
|
||||
tests/cases/compiler/typedArraysCrossAssignability01.ts(38,5): error TS2322: Type 'Uint32Array' is not assignable to type 'Int16Array'.
|
||||
Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
Type '"Uint32Array"' is not assignable to type '"Int16Array"'.
|
||||
tests/cases/compiler/typedArraysCrossAssignability01.ts(39,5): error TS2322: Type 'Float32Array' is not assignable to type 'Int16Array'.
|
||||
Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
Type '"Float32Array"' is not assignable to type '"Int16Array"'.
|
||||
tests/cases/compiler/typedArraysCrossAssignability01.ts(40,5): error TS2322: Type 'Float64Array' is not assignable to type 'Int16Array'.
|
||||
Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
Type '"Float64Array"' is not assignable to type '"Int16Array"'.
|
||||
tests/cases/compiler/typedArraysCrossAssignability01.ts(41,5): error TS2322: Type 'Uint8ClampedArray' is not assignable to type 'Int16Array'.
|
||||
Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
Type '"Uint8ClampedArray"' is not assignable to type '"Int16Array"'.
|
||||
tests/cases/compiler/typedArraysCrossAssignability01.ts(43,5): error TS2322: Type 'Int8Array' is not assignable to type 'Uint16Array'.
|
||||
Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
Type '"Int8Array"' is not assignable to type '"Uint16Array"'.
|
||||
tests/cases/compiler/typedArraysCrossAssignability01.ts(44,5): error TS2322: Type 'Uint8Array' is not assignable to type 'Uint16Array'.
|
||||
Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
Type '"UInt8Array"' is not assignable to type '"Uint16Array"'.
|
||||
tests/cases/compiler/typedArraysCrossAssignability01.ts(45,5): error TS2322: Type 'Int16Array' is not assignable to type 'Uint16Array'.
|
||||
Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
Type '"Int16Array"' is not assignable to type '"Uint16Array"'.
|
||||
tests/cases/compiler/typedArraysCrossAssignability01.ts(47,5): error TS2322: Type 'Int32Array' is not assignable to type 'Uint16Array'.
|
||||
Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
Type '"Int32Array"' is not assignable to type '"Uint16Array"'.
|
||||
tests/cases/compiler/typedArraysCrossAssignability01.ts(48,5): error TS2322: Type 'Uint32Array' is not assignable to type 'Uint16Array'.
|
||||
Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
Type '"Uint32Array"' is not assignable to type '"Uint16Array"'.
|
||||
tests/cases/compiler/typedArraysCrossAssignability01.ts(49,5): error TS2322: Type 'Float32Array' is not assignable to type 'Uint16Array'.
|
||||
Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
Type '"Float32Array"' is not assignable to type '"Uint16Array"'.
|
||||
tests/cases/compiler/typedArraysCrossAssignability01.ts(50,5): error TS2322: Type 'Float64Array' is not assignable to type 'Uint16Array'.
|
||||
Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
Type '"Float64Array"' is not assignable to type '"Uint16Array"'.
|
||||
tests/cases/compiler/typedArraysCrossAssignability01.ts(51,5): error TS2322: Type 'Uint8ClampedArray' is not assignable to type 'Uint16Array'.
|
||||
Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
Type '"Uint8ClampedArray"' is not assignable to type '"Uint16Array"'.
|
||||
tests/cases/compiler/typedArraysCrossAssignability01.ts(53,5): error TS2322: Type 'Int8Array' is not assignable to type 'Int32Array'.
|
||||
Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
Type '"Int8Array"' is not assignable to type '"Int32Array"'.
|
||||
tests/cases/compiler/typedArraysCrossAssignability01.ts(54,5): error TS2322: Type 'Uint8Array' is not assignable to type 'Int32Array'.
|
||||
Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
Type '"UInt8Array"' is not assignable to type '"Int32Array"'.
|
||||
tests/cases/compiler/typedArraysCrossAssignability01.ts(55,5): error TS2322: Type 'Int16Array' is not assignable to type 'Int32Array'.
|
||||
Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
Type '"Int16Array"' is not assignable to type '"Int32Array"'.
|
||||
tests/cases/compiler/typedArraysCrossAssignability01.ts(56,5): error TS2322: Type 'Uint16Array' is not assignable to type 'Int32Array'.
|
||||
Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
Type '"Uint16Array"' is not assignable to type '"Int32Array"'.
|
||||
tests/cases/compiler/typedArraysCrossAssignability01.ts(58,5): error TS2322: Type 'Uint32Array' is not assignable to type 'Int32Array'.
|
||||
Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
Type '"Uint32Array"' is not assignable to type '"Int32Array"'.
|
||||
tests/cases/compiler/typedArraysCrossAssignability01.ts(59,5): error TS2322: Type 'Float32Array' is not assignable to type 'Int32Array'.
|
||||
Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
Type '"Float32Array"' is not assignable to type '"Int32Array"'.
|
||||
tests/cases/compiler/typedArraysCrossAssignability01.ts(60,5): error TS2322: Type 'Float64Array' is not assignable to type 'Int32Array'.
|
||||
Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
Type '"Float64Array"' is not assignable to type '"Int32Array"'.
|
||||
tests/cases/compiler/typedArraysCrossAssignability01.ts(61,5): error TS2322: Type 'Uint8ClampedArray' is not assignable to type 'Int32Array'.
|
||||
Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
Type '"Uint8ClampedArray"' is not assignable to type '"Int32Array"'.
|
||||
tests/cases/compiler/typedArraysCrossAssignability01.ts(63,5): error TS2322: Type 'Int8Array' is not assignable to type 'Float32Array'.
|
||||
Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
Type '"Int8Array"' is not assignable to type '"Float32Array"'.
|
||||
tests/cases/compiler/typedArraysCrossAssignability01.ts(64,5): error TS2322: Type 'Uint8Array' is not assignable to type 'Float32Array'.
|
||||
Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
Type '"UInt8Array"' is not assignable to type '"Float32Array"'.
|
||||
tests/cases/compiler/typedArraysCrossAssignability01.ts(65,5): error TS2322: Type 'Int16Array' is not assignable to type 'Float32Array'.
|
||||
Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
Type '"Int16Array"' is not assignable to type '"Float32Array"'.
|
||||
tests/cases/compiler/typedArraysCrossAssignability01.ts(66,5): error TS2322: Type 'Uint16Array' is not assignable to type 'Float32Array'.
|
||||
Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
Type '"Uint16Array"' is not assignable to type '"Float32Array"'.
|
||||
tests/cases/compiler/typedArraysCrossAssignability01.ts(67,5): error TS2322: Type 'Int32Array' is not assignable to type 'Float32Array'.
|
||||
Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
Type '"Int32Array"' is not assignable to type '"Float32Array"'.
|
||||
tests/cases/compiler/typedArraysCrossAssignability01.ts(68,5): error TS2322: Type 'Uint32Array' is not assignable to type 'Float32Array'.
|
||||
Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
Type '"Uint32Array"' is not assignable to type '"Float32Array"'.
|
||||
tests/cases/compiler/typedArraysCrossAssignability01.ts(70,5): error TS2322: Type 'Float64Array' is not assignable to type 'Float32Array'.
|
||||
Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
Type '"Float64Array"' is not assignable to type '"Float32Array"'.
|
||||
tests/cases/compiler/typedArraysCrossAssignability01.ts(71,5): error TS2322: Type 'Uint8ClampedArray' is not assignable to type 'Float32Array'.
|
||||
Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
Type '"Uint8ClampedArray"' is not assignable to type '"Float32Array"'.
|
||||
tests/cases/compiler/typedArraysCrossAssignability01.ts(73,5): error TS2322: Type 'Int8Array' is not assignable to type 'Float64Array'.
|
||||
Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
Type '"Int8Array"' is not assignable to type '"Float64Array"'.
|
||||
tests/cases/compiler/typedArraysCrossAssignability01.ts(74,5): error TS2322: Type 'Uint8Array' is not assignable to type 'Float64Array'.
|
||||
Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
Type '"UInt8Array"' is not assignable to type '"Float64Array"'.
|
||||
tests/cases/compiler/typedArraysCrossAssignability01.ts(75,5): error TS2322: Type 'Int16Array' is not assignable to type 'Float64Array'.
|
||||
Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
Type '"Int16Array"' is not assignable to type '"Float64Array"'.
|
||||
tests/cases/compiler/typedArraysCrossAssignability01.ts(76,5): error TS2322: Type 'Uint16Array' is not assignable to type 'Float64Array'.
|
||||
Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
Type '"Uint16Array"' is not assignable to type '"Float64Array"'.
|
||||
tests/cases/compiler/typedArraysCrossAssignability01.ts(77,5): error TS2322: Type 'Int32Array' is not assignable to type 'Float64Array'.
|
||||
Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
Type '"Int32Array"' is not assignable to type '"Float64Array"'.
|
||||
tests/cases/compiler/typedArraysCrossAssignability01.ts(78,5): error TS2322: Type 'Uint32Array' is not assignable to type 'Float64Array'.
|
||||
Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
Type '"Uint32Array"' is not assignable to type '"Float64Array"'.
|
||||
tests/cases/compiler/typedArraysCrossAssignability01.ts(79,5): error TS2322: Type 'Float32Array' is not assignable to type 'Float64Array'.
|
||||
Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
Type '"Float32Array"' is not assignable to type '"Float64Array"'.
|
||||
tests/cases/compiler/typedArraysCrossAssignability01.ts(81,5): error TS2322: Type 'Uint8ClampedArray' is not assignable to type 'Float64Array'.
|
||||
Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
Type '"Uint8ClampedArray"' is not assignable to type '"Float64Array"'.
|
||||
tests/cases/compiler/typedArraysCrossAssignability01.ts(83,5): error TS2322: Type 'Int8Array' is not assignable to type 'Uint8ClampedArray'.
|
||||
Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
Type '"Int8Array"' is not assignable to type '"Uint8ClampedArray"'.
|
||||
tests/cases/compiler/typedArraysCrossAssignability01.ts(84,5): error TS2322: Type 'Uint8Array' is not assignable to type 'Uint8ClampedArray'.
|
||||
Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
Type '"UInt8Array"' is not assignable to type '"Uint8ClampedArray"'.
|
||||
tests/cases/compiler/typedArraysCrossAssignability01.ts(85,5): error TS2322: Type 'Int16Array' is not assignable to type 'Uint8ClampedArray'.
|
||||
Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
Type '"Int16Array"' is not assignable to type '"Uint8ClampedArray"'.
|
||||
tests/cases/compiler/typedArraysCrossAssignability01.ts(86,5): error TS2322: Type 'Uint16Array' is not assignable to type 'Uint8ClampedArray'.
|
||||
Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
Type '"Uint16Array"' is not assignable to type '"Uint8ClampedArray"'.
|
||||
tests/cases/compiler/typedArraysCrossAssignability01.ts(87,5): error TS2322: Type 'Int32Array' is not assignable to type 'Uint8ClampedArray'.
|
||||
Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
Type '"Int32Array"' is not assignable to type '"Uint8ClampedArray"'.
|
||||
tests/cases/compiler/typedArraysCrossAssignability01.ts(88,5): error TS2322: Type 'Uint32Array' is not assignable to type 'Uint8ClampedArray'.
|
||||
Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
Type '"Uint32Array"' is not assignable to type '"Uint8ClampedArray"'.
|
||||
tests/cases/compiler/typedArraysCrossAssignability01.ts(89,5): error TS2322: Type 'Float32Array' is not assignable to type 'Uint8ClampedArray'.
|
||||
Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
Type '"Float32Array"' is not assignable to type '"Uint8ClampedArray"'.
|
||||
tests/cases/compiler/typedArraysCrossAssignability01.ts(90,5): error TS2322: Type 'Float64Array' is not assignable to type 'Uint8ClampedArray'.
|
||||
Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
Type '"Float64Array"' is not assignable to type '"Uint8ClampedArray"'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/typedArraysCrossAssignability01.ts (64 errors) ====
|
||||
|
||||
function CheckAssignability() {
|
||||
let arr_Int8Array = new Int8Array(1);
|
||||
let arr_Uint8Array = new Uint8Array(1);
|
||||
let arr_Int16Array = new Int16Array(1);
|
||||
let arr_Uint16Array = new Uint16Array(1);
|
||||
let arr_Int32Array = new Int32Array(1);
|
||||
let arr_Uint32Array = new Uint32Array(1);
|
||||
let arr_Float32Array = new Float32Array(1);
|
||||
let arr_Float64Array = new Float64Array(1);
|
||||
let arr_Uint8ClampedArray = new Uint8ClampedArray(1);
|
||||
|
||||
arr_Int8Array = arr_Int8Array;
|
||||
arr_Int8Array = arr_Uint8Array;
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'Uint8Array' is not assignable to type 'Int8Array'.
|
||||
!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
!!! error TS2322: Type '"UInt8Array"' is not assignable to type '"Int8Array"'.
|
||||
arr_Int8Array = arr_Int16Array;
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'Int16Array' is not assignable to type 'Int8Array'.
|
||||
!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
!!! error TS2322: Type '"Int16Array"' is not assignable to type '"Int8Array"'.
|
||||
arr_Int8Array = arr_Uint16Array;
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'Uint16Array' is not assignable to type 'Int8Array'.
|
||||
!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
!!! error TS2322: Type '"Uint16Array"' is not assignable to type '"Int8Array"'.
|
||||
arr_Int8Array = arr_Int32Array;
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'Int32Array' is not assignable to type 'Int8Array'.
|
||||
!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
!!! error TS2322: Type '"Int32Array"' is not assignable to type '"Int8Array"'.
|
||||
arr_Int8Array = arr_Uint32Array;
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'Uint32Array' is not assignable to type 'Int8Array'.
|
||||
!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
!!! error TS2322: Type '"Uint32Array"' is not assignable to type '"Int8Array"'.
|
||||
arr_Int8Array = arr_Float32Array;
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'Float32Array' is not assignable to type 'Int8Array'.
|
||||
!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
!!! error TS2322: Type '"Float32Array"' is not assignable to type '"Int8Array"'.
|
||||
arr_Int8Array = arr_Float64Array;
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'Float64Array' is not assignable to type 'Int8Array'.
|
||||
!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
!!! error TS2322: Type '"Float64Array"' is not assignable to type '"Int8Array"'.
|
||||
arr_Int8Array = arr_Uint8ClampedArray;
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'Uint8ClampedArray' is not assignable to type 'Int8Array'.
|
||||
!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
!!! error TS2322: Type '"Uint8ClampedArray"' is not assignable to type '"Int8Array"'.
|
||||
|
||||
arr_Uint8Array = arr_Int8Array;
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'Int8Array' is not assignable to type 'Uint8Array'.
|
||||
!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
!!! error TS2322: Type '"Int8Array"' is not assignable to type '"UInt8Array"'.
|
||||
arr_Uint8Array = arr_Uint8Array;
|
||||
arr_Uint8Array = arr_Int16Array;
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'Int16Array' is not assignable to type 'Uint8Array'.
|
||||
!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
!!! error TS2322: Type '"Int16Array"' is not assignable to type '"UInt8Array"'.
|
||||
arr_Uint8Array = arr_Uint16Array;
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'Uint16Array' is not assignable to type 'Uint8Array'.
|
||||
!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
!!! error TS2322: Type '"Uint16Array"' is not assignable to type '"UInt8Array"'.
|
||||
arr_Uint8Array = arr_Int32Array;
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'Int32Array' is not assignable to type 'Uint8Array'.
|
||||
!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
!!! error TS2322: Type '"Int32Array"' is not assignable to type '"UInt8Array"'.
|
||||
arr_Uint8Array = arr_Uint32Array;
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'Uint32Array' is not assignable to type 'Uint8Array'.
|
||||
!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
!!! error TS2322: Type '"Uint32Array"' is not assignable to type '"UInt8Array"'.
|
||||
arr_Uint8Array = arr_Float32Array;
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'Float32Array' is not assignable to type 'Uint8Array'.
|
||||
!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
!!! error TS2322: Type '"Float32Array"' is not assignable to type '"UInt8Array"'.
|
||||
arr_Uint8Array = arr_Float64Array;
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'Float64Array' is not assignable to type 'Uint8Array'.
|
||||
!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
!!! error TS2322: Type '"Float64Array"' is not assignable to type '"UInt8Array"'.
|
||||
arr_Uint8Array = arr_Uint8ClampedArray;
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'Uint8ClampedArray' is not assignable to type 'Uint8Array'.
|
||||
!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
!!! error TS2322: Type '"Uint8ClampedArray"' is not assignable to type '"UInt8Array"'.
|
||||
|
||||
arr_Int16Array = arr_Int8Array;
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'Int8Array' is not assignable to type 'Int16Array'.
|
||||
!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
!!! error TS2322: Type '"Int8Array"' is not assignable to type '"Int16Array"'.
|
||||
arr_Int16Array = arr_Uint8Array;
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'Uint8Array' is not assignable to type 'Int16Array'.
|
||||
!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
!!! error TS2322: Type '"UInt8Array"' is not assignable to type '"Int16Array"'.
|
||||
arr_Int16Array = arr_Int16Array;
|
||||
arr_Int16Array = arr_Uint16Array;
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'Uint16Array' is not assignable to type 'Int16Array'.
|
||||
!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
!!! error TS2322: Type '"Uint16Array"' is not assignable to type '"Int16Array"'.
|
||||
arr_Int16Array = arr_Int32Array;
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'Int32Array' is not assignable to type 'Int16Array'.
|
||||
!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
!!! error TS2322: Type '"Int32Array"' is not assignable to type '"Int16Array"'.
|
||||
arr_Int16Array = arr_Uint32Array;
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'Uint32Array' is not assignable to type 'Int16Array'.
|
||||
!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
!!! error TS2322: Type '"Uint32Array"' is not assignable to type '"Int16Array"'.
|
||||
arr_Int16Array = arr_Float32Array;
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'Float32Array' is not assignable to type 'Int16Array'.
|
||||
!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
!!! error TS2322: Type '"Float32Array"' is not assignable to type '"Int16Array"'.
|
||||
arr_Int16Array = arr_Float64Array;
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'Float64Array' is not assignable to type 'Int16Array'.
|
||||
!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
!!! error TS2322: Type '"Float64Array"' is not assignable to type '"Int16Array"'.
|
||||
arr_Int16Array = arr_Uint8ClampedArray;
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'Uint8ClampedArray' is not assignable to type 'Int16Array'.
|
||||
!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
!!! error TS2322: Type '"Uint8ClampedArray"' is not assignable to type '"Int16Array"'.
|
||||
|
||||
arr_Uint16Array = arr_Int8Array;
|
||||
~~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'Int8Array' is not assignable to type 'Uint16Array'.
|
||||
!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
!!! error TS2322: Type '"Int8Array"' is not assignable to type '"Uint16Array"'.
|
||||
arr_Uint16Array = arr_Uint8Array;
|
||||
~~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'Uint8Array' is not assignable to type 'Uint16Array'.
|
||||
!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
!!! error TS2322: Type '"UInt8Array"' is not assignable to type '"Uint16Array"'.
|
||||
arr_Uint16Array = arr_Int16Array;
|
||||
~~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'Int16Array' is not assignable to type 'Uint16Array'.
|
||||
!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
!!! error TS2322: Type '"Int16Array"' is not assignable to type '"Uint16Array"'.
|
||||
arr_Uint16Array = arr_Uint16Array;
|
||||
arr_Uint16Array = arr_Int32Array;
|
||||
~~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'Int32Array' is not assignable to type 'Uint16Array'.
|
||||
!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
!!! error TS2322: Type '"Int32Array"' is not assignable to type '"Uint16Array"'.
|
||||
arr_Uint16Array = arr_Uint32Array;
|
||||
~~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'Uint32Array' is not assignable to type 'Uint16Array'.
|
||||
!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
!!! error TS2322: Type '"Uint32Array"' is not assignable to type '"Uint16Array"'.
|
||||
arr_Uint16Array = arr_Float32Array;
|
||||
~~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'Float32Array' is not assignable to type 'Uint16Array'.
|
||||
!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
!!! error TS2322: Type '"Float32Array"' is not assignable to type '"Uint16Array"'.
|
||||
arr_Uint16Array = arr_Float64Array;
|
||||
~~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'Float64Array' is not assignable to type 'Uint16Array'.
|
||||
!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
!!! error TS2322: Type '"Float64Array"' is not assignable to type '"Uint16Array"'.
|
||||
arr_Uint16Array = arr_Uint8ClampedArray;
|
||||
~~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'Uint8ClampedArray' is not assignable to type 'Uint16Array'.
|
||||
!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
!!! error TS2322: Type '"Uint8ClampedArray"' is not assignable to type '"Uint16Array"'.
|
||||
|
||||
arr_Int32Array = arr_Int8Array;
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'Int8Array' is not assignable to type 'Int32Array'.
|
||||
!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
!!! error TS2322: Type '"Int8Array"' is not assignable to type '"Int32Array"'.
|
||||
arr_Int32Array = arr_Uint8Array;
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'Uint8Array' is not assignable to type 'Int32Array'.
|
||||
!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
!!! error TS2322: Type '"UInt8Array"' is not assignable to type '"Int32Array"'.
|
||||
arr_Int32Array = arr_Int16Array;
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'Int16Array' is not assignable to type 'Int32Array'.
|
||||
!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
!!! error TS2322: Type '"Int16Array"' is not assignable to type '"Int32Array"'.
|
||||
arr_Int32Array = arr_Uint16Array;
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'Uint16Array' is not assignable to type 'Int32Array'.
|
||||
!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
!!! error TS2322: Type '"Uint16Array"' is not assignable to type '"Int32Array"'.
|
||||
arr_Int32Array = arr_Int32Array;
|
||||
arr_Int32Array = arr_Uint32Array;
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'Uint32Array' is not assignable to type 'Int32Array'.
|
||||
!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
!!! error TS2322: Type '"Uint32Array"' is not assignable to type '"Int32Array"'.
|
||||
arr_Int32Array = arr_Float32Array;
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'Float32Array' is not assignable to type 'Int32Array'.
|
||||
!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
!!! error TS2322: Type '"Float32Array"' is not assignable to type '"Int32Array"'.
|
||||
arr_Int32Array = arr_Float64Array;
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'Float64Array' is not assignable to type 'Int32Array'.
|
||||
!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
!!! error TS2322: Type '"Float64Array"' is not assignable to type '"Int32Array"'.
|
||||
arr_Int32Array = arr_Uint8ClampedArray;
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'Uint8ClampedArray' is not assignable to type 'Int32Array'.
|
||||
!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
!!! error TS2322: Type '"Uint8ClampedArray"' is not assignable to type '"Int32Array"'.
|
||||
|
||||
arr_Float32Array = arr_Int8Array;
|
||||
~~~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'Int8Array' is not assignable to type 'Float32Array'.
|
||||
!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
!!! error TS2322: Type '"Int8Array"' is not assignable to type '"Float32Array"'.
|
||||
arr_Float32Array = arr_Uint8Array;
|
||||
~~~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'Uint8Array' is not assignable to type 'Float32Array'.
|
||||
!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
!!! error TS2322: Type '"UInt8Array"' is not assignable to type '"Float32Array"'.
|
||||
arr_Float32Array = arr_Int16Array;
|
||||
~~~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'Int16Array' is not assignable to type 'Float32Array'.
|
||||
!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
!!! error TS2322: Type '"Int16Array"' is not assignable to type '"Float32Array"'.
|
||||
arr_Float32Array = arr_Uint16Array;
|
||||
~~~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'Uint16Array' is not assignable to type 'Float32Array'.
|
||||
!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
!!! error TS2322: Type '"Uint16Array"' is not assignable to type '"Float32Array"'.
|
||||
arr_Float32Array = arr_Int32Array;
|
||||
~~~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'Int32Array' is not assignable to type 'Float32Array'.
|
||||
!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
!!! error TS2322: Type '"Int32Array"' is not assignable to type '"Float32Array"'.
|
||||
arr_Float32Array = arr_Uint32Array;
|
||||
~~~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'Uint32Array' is not assignable to type 'Float32Array'.
|
||||
!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
!!! error TS2322: Type '"Uint32Array"' is not assignable to type '"Float32Array"'.
|
||||
arr_Float32Array = arr_Float32Array;
|
||||
arr_Float32Array = arr_Float64Array;
|
||||
~~~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'Float64Array' is not assignable to type 'Float32Array'.
|
||||
!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
!!! error TS2322: Type '"Float64Array"' is not assignable to type '"Float32Array"'.
|
||||
arr_Float32Array = arr_Uint8ClampedArray;
|
||||
~~~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'Uint8ClampedArray' is not assignable to type 'Float32Array'.
|
||||
!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
!!! error TS2322: Type '"Uint8ClampedArray"' is not assignable to type '"Float32Array"'.
|
||||
|
||||
arr_Float64Array = arr_Int8Array;
|
||||
~~~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'Int8Array' is not assignable to type 'Float64Array'.
|
||||
!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
!!! error TS2322: Type '"Int8Array"' is not assignable to type '"Float64Array"'.
|
||||
arr_Float64Array = arr_Uint8Array;
|
||||
~~~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'Uint8Array' is not assignable to type 'Float64Array'.
|
||||
!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
!!! error TS2322: Type '"UInt8Array"' is not assignable to type '"Float64Array"'.
|
||||
arr_Float64Array = arr_Int16Array;
|
||||
~~~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'Int16Array' is not assignable to type 'Float64Array'.
|
||||
!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
!!! error TS2322: Type '"Int16Array"' is not assignable to type '"Float64Array"'.
|
||||
arr_Float64Array = arr_Uint16Array;
|
||||
~~~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'Uint16Array' is not assignable to type 'Float64Array'.
|
||||
!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
!!! error TS2322: Type '"Uint16Array"' is not assignable to type '"Float64Array"'.
|
||||
arr_Float64Array = arr_Int32Array;
|
||||
~~~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'Int32Array' is not assignable to type 'Float64Array'.
|
||||
!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
!!! error TS2322: Type '"Int32Array"' is not assignable to type '"Float64Array"'.
|
||||
arr_Float64Array = arr_Uint32Array;
|
||||
~~~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'Uint32Array' is not assignable to type 'Float64Array'.
|
||||
!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
!!! error TS2322: Type '"Uint32Array"' is not assignable to type '"Float64Array"'.
|
||||
arr_Float64Array = arr_Float32Array;
|
||||
~~~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'Float32Array' is not assignable to type 'Float64Array'.
|
||||
!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
!!! error TS2322: Type '"Float32Array"' is not assignable to type '"Float64Array"'.
|
||||
arr_Float64Array = arr_Float64Array;
|
||||
arr_Float64Array = arr_Uint8ClampedArray;
|
||||
~~~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'Uint8ClampedArray' is not assignable to type 'Float64Array'.
|
||||
!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
!!! error TS2322: Type '"Uint8ClampedArray"' is not assignable to type '"Float64Array"'.
|
||||
|
||||
arr_Uint8ClampedArray = arr_Int8Array;
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'Int8Array' is not assignable to type 'Uint8ClampedArray'.
|
||||
!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
!!! error TS2322: Type '"Int8Array"' is not assignable to type '"Uint8ClampedArray"'.
|
||||
arr_Uint8ClampedArray = arr_Uint8Array;
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'Uint8Array' is not assignable to type 'Uint8ClampedArray'.
|
||||
!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
!!! error TS2322: Type '"UInt8Array"' is not assignable to type '"Uint8ClampedArray"'.
|
||||
arr_Uint8ClampedArray = arr_Int16Array;
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'Int16Array' is not assignable to type 'Uint8ClampedArray'.
|
||||
!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
!!! error TS2322: Type '"Int16Array"' is not assignable to type '"Uint8ClampedArray"'.
|
||||
arr_Uint8ClampedArray = arr_Uint16Array;
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'Uint16Array' is not assignable to type 'Uint8ClampedArray'.
|
||||
!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
!!! error TS2322: Type '"Uint16Array"' is not assignable to type '"Uint8ClampedArray"'.
|
||||
arr_Uint8ClampedArray = arr_Int32Array;
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'Int32Array' is not assignable to type 'Uint8ClampedArray'.
|
||||
!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
!!! error TS2322: Type '"Int32Array"' is not assignable to type '"Uint8ClampedArray"'.
|
||||
arr_Uint8ClampedArray = arr_Uint32Array;
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'Uint32Array' is not assignable to type 'Uint8ClampedArray'.
|
||||
!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
!!! error TS2322: Type '"Uint32Array"' is not assignable to type '"Uint8ClampedArray"'.
|
||||
arr_Uint8ClampedArray = arr_Float32Array;
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'Float32Array' is not assignable to type 'Uint8ClampedArray'.
|
||||
!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
!!! error TS2322: Type '"Float32Array"' is not assignable to type '"Uint8ClampedArray"'.
|
||||
arr_Uint8ClampedArray = arr_Float64Array;
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'Float64Array' is not assignable to type 'Uint8ClampedArray'.
|
||||
!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible.
|
||||
!!! error TS2322: Type '"Float64Array"' is not assignable to type '"Uint8ClampedArray"'.
|
||||
arr_Uint8ClampedArray = arr_Uint8ClampedArray;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,180 @@
|
||||
//// [typedArraysCrossAssignability01.ts]
|
||||
|
||||
function CheckAssignability() {
|
||||
let arr_Int8Array = new Int8Array(1);
|
||||
let arr_Uint8Array = new Uint8Array(1);
|
||||
let arr_Int16Array = new Int16Array(1);
|
||||
let arr_Uint16Array = new Uint16Array(1);
|
||||
let arr_Int32Array = new Int32Array(1);
|
||||
let arr_Uint32Array = new Uint32Array(1);
|
||||
let arr_Float32Array = new Float32Array(1);
|
||||
let arr_Float64Array = new Float64Array(1);
|
||||
let arr_Uint8ClampedArray = new Uint8ClampedArray(1);
|
||||
|
||||
arr_Int8Array = arr_Int8Array;
|
||||
arr_Int8Array = arr_Uint8Array;
|
||||
arr_Int8Array = arr_Int16Array;
|
||||
arr_Int8Array = arr_Uint16Array;
|
||||
arr_Int8Array = arr_Int32Array;
|
||||
arr_Int8Array = arr_Uint32Array;
|
||||
arr_Int8Array = arr_Float32Array;
|
||||
arr_Int8Array = arr_Float64Array;
|
||||
arr_Int8Array = arr_Uint8ClampedArray;
|
||||
|
||||
arr_Uint8Array = arr_Int8Array;
|
||||
arr_Uint8Array = arr_Uint8Array;
|
||||
arr_Uint8Array = arr_Int16Array;
|
||||
arr_Uint8Array = arr_Uint16Array;
|
||||
arr_Uint8Array = arr_Int32Array;
|
||||
arr_Uint8Array = arr_Uint32Array;
|
||||
arr_Uint8Array = arr_Float32Array;
|
||||
arr_Uint8Array = arr_Float64Array;
|
||||
arr_Uint8Array = arr_Uint8ClampedArray;
|
||||
|
||||
arr_Int16Array = arr_Int8Array;
|
||||
arr_Int16Array = arr_Uint8Array;
|
||||
arr_Int16Array = arr_Int16Array;
|
||||
arr_Int16Array = arr_Uint16Array;
|
||||
arr_Int16Array = arr_Int32Array;
|
||||
arr_Int16Array = arr_Uint32Array;
|
||||
arr_Int16Array = arr_Float32Array;
|
||||
arr_Int16Array = arr_Float64Array;
|
||||
arr_Int16Array = arr_Uint8ClampedArray;
|
||||
|
||||
arr_Uint16Array = arr_Int8Array;
|
||||
arr_Uint16Array = arr_Uint8Array;
|
||||
arr_Uint16Array = arr_Int16Array;
|
||||
arr_Uint16Array = arr_Uint16Array;
|
||||
arr_Uint16Array = arr_Int32Array;
|
||||
arr_Uint16Array = arr_Uint32Array;
|
||||
arr_Uint16Array = arr_Float32Array;
|
||||
arr_Uint16Array = arr_Float64Array;
|
||||
arr_Uint16Array = arr_Uint8ClampedArray;
|
||||
|
||||
arr_Int32Array = arr_Int8Array;
|
||||
arr_Int32Array = arr_Uint8Array;
|
||||
arr_Int32Array = arr_Int16Array;
|
||||
arr_Int32Array = arr_Uint16Array;
|
||||
arr_Int32Array = arr_Int32Array;
|
||||
arr_Int32Array = arr_Uint32Array;
|
||||
arr_Int32Array = arr_Float32Array;
|
||||
arr_Int32Array = arr_Float64Array;
|
||||
arr_Int32Array = arr_Uint8ClampedArray;
|
||||
|
||||
arr_Float32Array = arr_Int8Array;
|
||||
arr_Float32Array = arr_Uint8Array;
|
||||
arr_Float32Array = arr_Int16Array;
|
||||
arr_Float32Array = arr_Uint16Array;
|
||||
arr_Float32Array = arr_Int32Array;
|
||||
arr_Float32Array = arr_Uint32Array;
|
||||
arr_Float32Array = arr_Float32Array;
|
||||
arr_Float32Array = arr_Float64Array;
|
||||
arr_Float32Array = arr_Uint8ClampedArray;
|
||||
|
||||
arr_Float64Array = arr_Int8Array;
|
||||
arr_Float64Array = arr_Uint8Array;
|
||||
arr_Float64Array = arr_Int16Array;
|
||||
arr_Float64Array = arr_Uint16Array;
|
||||
arr_Float64Array = arr_Int32Array;
|
||||
arr_Float64Array = arr_Uint32Array;
|
||||
arr_Float64Array = arr_Float32Array;
|
||||
arr_Float64Array = arr_Float64Array;
|
||||
arr_Float64Array = arr_Uint8ClampedArray;
|
||||
|
||||
arr_Uint8ClampedArray = arr_Int8Array;
|
||||
arr_Uint8ClampedArray = arr_Uint8Array;
|
||||
arr_Uint8ClampedArray = arr_Int16Array;
|
||||
arr_Uint8ClampedArray = arr_Uint16Array;
|
||||
arr_Uint8ClampedArray = arr_Int32Array;
|
||||
arr_Uint8ClampedArray = arr_Uint32Array;
|
||||
arr_Uint8ClampedArray = arr_Float32Array;
|
||||
arr_Uint8ClampedArray = arr_Float64Array;
|
||||
arr_Uint8ClampedArray = arr_Uint8ClampedArray;
|
||||
|
||||
}
|
||||
|
||||
|
||||
//// [typedArraysCrossAssignability01.js]
|
||||
function CheckAssignability() {
|
||||
let arr_Int8Array = new Int8Array(1);
|
||||
let arr_Uint8Array = new Uint8Array(1);
|
||||
let arr_Int16Array = new Int16Array(1);
|
||||
let arr_Uint16Array = new Uint16Array(1);
|
||||
let arr_Int32Array = new Int32Array(1);
|
||||
let arr_Uint32Array = new Uint32Array(1);
|
||||
let arr_Float32Array = new Float32Array(1);
|
||||
let arr_Float64Array = new Float64Array(1);
|
||||
let arr_Uint8ClampedArray = new Uint8ClampedArray(1);
|
||||
arr_Int8Array = arr_Int8Array;
|
||||
arr_Int8Array = arr_Uint8Array;
|
||||
arr_Int8Array = arr_Int16Array;
|
||||
arr_Int8Array = arr_Uint16Array;
|
||||
arr_Int8Array = arr_Int32Array;
|
||||
arr_Int8Array = arr_Uint32Array;
|
||||
arr_Int8Array = arr_Float32Array;
|
||||
arr_Int8Array = arr_Float64Array;
|
||||
arr_Int8Array = arr_Uint8ClampedArray;
|
||||
arr_Uint8Array = arr_Int8Array;
|
||||
arr_Uint8Array = arr_Uint8Array;
|
||||
arr_Uint8Array = arr_Int16Array;
|
||||
arr_Uint8Array = arr_Uint16Array;
|
||||
arr_Uint8Array = arr_Int32Array;
|
||||
arr_Uint8Array = arr_Uint32Array;
|
||||
arr_Uint8Array = arr_Float32Array;
|
||||
arr_Uint8Array = arr_Float64Array;
|
||||
arr_Uint8Array = arr_Uint8ClampedArray;
|
||||
arr_Int16Array = arr_Int8Array;
|
||||
arr_Int16Array = arr_Uint8Array;
|
||||
arr_Int16Array = arr_Int16Array;
|
||||
arr_Int16Array = arr_Uint16Array;
|
||||
arr_Int16Array = arr_Int32Array;
|
||||
arr_Int16Array = arr_Uint32Array;
|
||||
arr_Int16Array = arr_Float32Array;
|
||||
arr_Int16Array = arr_Float64Array;
|
||||
arr_Int16Array = arr_Uint8ClampedArray;
|
||||
arr_Uint16Array = arr_Int8Array;
|
||||
arr_Uint16Array = arr_Uint8Array;
|
||||
arr_Uint16Array = arr_Int16Array;
|
||||
arr_Uint16Array = arr_Uint16Array;
|
||||
arr_Uint16Array = arr_Int32Array;
|
||||
arr_Uint16Array = arr_Uint32Array;
|
||||
arr_Uint16Array = arr_Float32Array;
|
||||
arr_Uint16Array = arr_Float64Array;
|
||||
arr_Uint16Array = arr_Uint8ClampedArray;
|
||||
arr_Int32Array = arr_Int8Array;
|
||||
arr_Int32Array = arr_Uint8Array;
|
||||
arr_Int32Array = arr_Int16Array;
|
||||
arr_Int32Array = arr_Uint16Array;
|
||||
arr_Int32Array = arr_Int32Array;
|
||||
arr_Int32Array = arr_Uint32Array;
|
||||
arr_Int32Array = arr_Float32Array;
|
||||
arr_Int32Array = arr_Float64Array;
|
||||
arr_Int32Array = arr_Uint8ClampedArray;
|
||||
arr_Float32Array = arr_Int8Array;
|
||||
arr_Float32Array = arr_Uint8Array;
|
||||
arr_Float32Array = arr_Int16Array;
|
||||
arr_Float32Array = arr_Uint16Array;
|
||||
arr_Float32Array = arr_Int32Array;
|
||||
arr_Float32Array = arr_Uint32Array;
|
||||
arr_Float32Array = arr_Float32Array;
|
||||
arr_Float32Array = arr_Float64Array;
|
||||
arr_Float32Array = arr_Uint8ClampedArray;
|
||||
arr_Float64Array = arr_Int8Array;
|
||||
arr_Float64Array = arr_Uint8Array;
|
||||
arr_Float64Array = arr_Int16Array;
|
||||
arr_Float64Array = arr_Uint16Array;
|
||||
arr_Float64Array = arr_Int32Array;
|
||||
arr_Float64Array = arr_Uint32Array;
|
||||
arr_Float64Array = arr_Float32Array;
|
||||
arr_Float64Array = arr_Float64Array;
|
||||
arr_Float64Array = arr_Uint8ClampedArray;
|
||||
arr_Uint8ClampedArray = arr_Int8Array;
|
||||
arr_Uint8ClampedArray = arr_Uint8Array;
|
||||
arr_Uint8ClampedArray = arr_Int16Array;
|
||||
arr_Uint8ClampedArray = arr_Uint16Array;
|
||||
arr_Uint8ClampedArray = arr_Int32Array;
|
||||
arr_Uint8ClampedArray = arr_Uint32Array;
|
||||
arr_Uint8ClampedArray = arr_Float32Array;
|
||||
arr_Uint8ClampedArray = arr_Float64Array;
|
||||
arr_Uint8ClampedArray = arr_Uint8ClampedArray;
|
||||
}
|
||||
@@ -75,7 +75,6 @@ function CreateIntegerTypedArraysFromArrayLike(obj:ArrayLike<number>) {
|
||||
return typedArrays;
|
||||
}
|
||||
|
||||
/*
|
||||
function CreateTypedArraysOf(obj) {
|
||||
var typedArrays = [];
|
||||
typedArrays[0] = Int8Array.of(...obj);
|
||||
@@ -90,7 +89,6 @@ function CreateTypedArraysOf(obj) {
|
||||
|
||||
return typedArrays;
|
||||
}
|
||||
*/
|
||||
|
||||
function CreateTypedArraysOf2() {
|
||||
var typedArrays = [];
|
||||
|
||||
@@ -0,0 +1,94 @@
|
||||
// @target: ES6
|
||||
|
||||
function CheckAssignability() {
|
||||
let arr_Int8Array = new Int8Array(1);
|
||||
let arr_Uint8Array = new Uint8Array(1);
|
||||
let arr_Int16Array = new Int16Array(1);
|
||||
let arr_Uint16Array = new Uint16Array(1);
|
||||
let arr_Int32Array = new Int32Array(1);
|
||||
let arr_Uint32Array = new Uint32Array(1);
|
||||
let arr_Float32Array = new Float32Array(1);
|
||||
let arr_Float64Array = new Float64Array(1);
|
||||
let arr_Uint8ClampedArray = new Uint8ClampedArray(1);
|
||||
|
||||
arr_Int8Array = arr_Int8Array;
|
||||
arr_Int8Array = arr_Uint8Array;
|
||||
arr_Int8Array = arr_Int16Array;
|
||||
arr_Int8Array = arr_Uint16Array;
|
||||
arr_Int8Array = arr_Int32Array;
|
||||
arr_Int8Array = arr_Uint32Array;
|
||||
arr_Int8Array = arr_Float32Array;
|
||||
arr_Int8Array = arr_Float64Array;
|
||||
arr_Int8Array = arr_Uint8ClampedArray;
|
||||
|
||||
arr_Uint8Array = arr_Int8Array;
|
||||
arr_Uint8Array = arr_Uint8Array;
|
||||
arr_Uint8Array = arr_Int16Array;
|
||||
arr_Uint8Array = arr_Uint16Array;
|
||||
arr_Uint8Array = arr_Int32Array;
|
||||
arr_Uint8Array = arr_Uint32Array;
|
||||
arr_Uint8Array = arr_Float32Array;
|
||||
arr_Uint8Array = arr_Float64Array;
|
||||
arr_Uint8Array = arr_Uint8ClampedArray;
|
||||
|
||||
arr_Int16Array = arr_Int8Array;
|
||||
arr_Int16Array = arr_Uint8Array;
|
||||
arr_Int16Array = arr_Int16Array;
|
||||
arr_Int16Array = arr_Uint16Array;
|
||||
arr_Int16Array = arr_Int32Array;
|
||||
arr_Int16Array = arr_Uint32Array;
|
||||
arr_Int16Array = arr_Float32Array;
|
||||
arr_Int16Array = arr_Float64Array;
|
||||
arr_Int16Array = arr_Uint8ClampedArray;
|
||||
|
||||
arr_Uint16Array = arr_Int8Array;
|
||||
arr_Uint16Array = arr_Uint8Array;
|
||||
arr_Uint16Array = arr_Int16Array;
|
||||
arr_Uint16Array = arr_Uint16Array;
|
||||
arr_Uint16Array = arr_Int32Array;
|
||||
arr_Uint16Array = arr_Uint32Array;
|
||||
arr_Uint16Array = arr_Float32Array;
|
||||
arr_Uint16Array = arr_Float64Array;
|
||||
arr_Uint16Array = arr_Uint8ClampedArray;
|
||||
|
||||
arr_Int32Array = arr_Int8Array;
|
||||
arr_Int32Array = arr_Uint8Array;
|
||||
arr_Int32Array = arr_Int16Array;
|
||||
arr_Int32Array = arr_Uint16Array;
|
||||
arr_Int32Array = arr_Int32Array;
|
||||
arr_Int32Array = arr_Uint32Array;
|
||||
arr_Int32Array = arr_Float32Array;
|
||||
arr_Int32Array = arr_Float64Array;
|
||||
arr_Int32Array = arr_Uint8ClampedArray;
|
||||
|
||||
arr_Float32Array = arr_Int8Array;
|
||||
arr_Float32Array = arr_Uint8Array;
|
||||
arr_Float32Array = arr_Int16Array;
|
||||
arr_Float32Array = arr_Uint16Array;
|
||||
arr_Float32Array = arr_Int32Array;
|
||||
arr_Float32Array = arr_Uint32Array;
|
||||
arr_Float32Array = arr_Float32Array;
|
||||
arr_Float32Array = arr_Float64Array;
|
||||
arr_Float32Array = arr_Uint8ClampedArray;
|
||||
|
||||
arr_Float64Array = arr_Int8Array;
|
||||
arr_Float64Array = arr_Uint8Array;
|
||||
arr_Float64Array = arr_Int16Array;
|
||||
arr_Float64Array = arr_Uint16Array;
|
||||
arr_Float64Array = arr_Int32Array;
|
||||
arr_Float64Array = arr_Uint32Array;
|
||||
arr_Float64Array = arr_Float32Array;
|
||||
arr_Float64Array = arr_Float64Array;
|
||||
arr_Float64Array = arr_Uint8ClampedArray;
|
||||
|
||||
arr_Uint8ClampedArray = arr_Int8Array;
|
||||
arr_Uint8ClampedArray = arr_Uint8Array;
|
||||
arr_Uint8ClampedArray = arr_Int16Array;
|
||||
arr_Uint8ClampedArray = arr_Uint16Array;
|
||||
arr_Uint8ClampedArray = arr_Int32Array;
|
||||
arr_Uint8ClampedArray = arr_Uint32Array;
|
||||
arr_Uint8ClampedArray = arr_Float32Array;
|
||||
arr_Uint8ClampedArray = arr_Float64Array;
|
||||
arr_Uint8ClampedArray = arr_Uint8ClampedArray;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
//@jsx: preserve
|
||||
|
||||
//@filename: file.tsx
|
||||
declare module JSX {
|
||||
interface Element { }
|
||||
interface IntrinsicElements {
|
||||
[s: string]: any;
|
||||
}
|
||||
}
|
||||
|
||||
// @filename: Error1.tsx
|
||||
// Issue error about missing span closing tag, not missing div closing tag
|
||||
let x1 = <div><span></div>;
|
||||
|
||||
// @filename: Error2.tsx
|
||||
let x2 = <div></span>;
|
||||
|
||||
|
||||
// @filename: Error3.tsx
|
||||
let x3 = <div>;
|
||||
|
||||
|
||||
// @filename: Error4.tsx
|
||||
let x4 = <div><div></span>;
|
||||
|
||||
// @filename: Error5.tsx
|
||||
let x5 = <div><span>
|
||||
|
||||
@@ -26,15 +26,36 @@ module ts {
|
||||
content?: string
|
||||
}
|
||||
|
||||
function createModuleResolutionHost(...files: File[]): ModuleResolutionHost {
|
||||
function createModuleResolutionHost(hasDirectoryExists: boolean, ...files: File[]): ModuleResolutionHost {
|
||||
let map = arrayToMap(files, f => f.name);
|
||||
|
||||
return { fileExists, readFile };
|
||||
|
||||
function fileExists(path: string): boolean {
|
||||
return hasProperty(map, path);
|
||||
if (hasDirectoryExists) {
|
||||
const directories: Map<string> = {};
|
||||
for (const f of files) {
|
||||
let name = getDirectoryPath(f.name);
|
||||
while (true) {
|
||||
directories[name] = name;
|
||||
let baseName = getDirectoryPath(name);
|
||||
if (baseName === name) {
|
||||
break;
|
||||
}
|
||||
name = baseName;
|
||||
}
|
||||
}
|
||||
return {
|
||||
readFile,
|
||||
directoryExists: path => {
|
||||
return hasProperty(directories, path);
|
||||
},
|
||||
fileExists: path => {
|
||||
assert.isTrue(hasProperty(directories, getDirectoryPath(path)), "'fileExists' request in non-existing directory");
|
||||
return hasProperty(map, path);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
return { readFile, fileExists: path => hasProperty(map, path), };
|
||||
}
|
||||
|
||||
function readFile(path: string): string {
|
||||
return hasProperty(map, path) ? map[path].content : undefined;
|
||||
}
|
||||
@@ -51,9 +72,14 @@ module ts {
|
||||
|
||||
function testLoadAsFile(containingFileName: string, moduleFileNameNoExt: string, moduleName: string): void {
|
||||
for (let ext of supportedTypeScriptExtensions) {
|
||||
test(ext, /*hasDirectoryExists*/ false);
|
||||
test(ext, /*hasDirectoryExists*/ true);
|
||||
}
|
||||
|
||||
function test(ext: string, hasDirectoryExists: boolean) {
|
||||
let containingFile = { name: containingFileName }
|
||||
let moduleFile = { name: moduleFileNameNoExt + ext }
|
||||
let resolution = nodeModuleNameResolver(moduleName, containingFile.name, {}, createModuleResolutionHost(containingFile, moduleFile));
|
||||
let resolution = nodeModuleNameResolver(moduleName, containingFile.name, {}, createModuleResolutionHost(hasDirectoryExists, containingFile, moduleFile));
|
||||
assert.equal(resolution.resolvedModule.resolvedFileName, moduleFile.name);
|
||||
assert.equal(!!resolution.resolvedModule.isExternalLibraryImport, false);
|
||||
|
||||
@@ -69,6 +95,7 @@ module ts {
|
||||
}
|
||||
|
||||
assert.deepEqual(resolution.failedLookupLocations, failedLookupLocations);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,14 +116,19 @@ module ts {
|
||||
});
|
||||
|
||||
function testLoadingFromPackageJson(containingFileName: string, packageJsonFileName: string, fieldRef: string, moduleFileName: string, moduleName: string): void {
|
||||
let containingFile = { name: containingFileName };
|
||||
let packageJson = { name: packageJsonFileName, content: JSON.stringify({ "typings": fieldRef }) };
|
||||
let moduleFile = { name: moduleFileName };
|
||||
let resolution = nodeModuleNameResolver(moduleName, containingFile.name, {}, createModuleResolutionHost(containingFile, packageJson, moduleFile));
|
||||
assert.equal(resolution.resolvedModule.resolvedFileName, moduleFile.name);
|
||||
assert.equal(!!resolution.resolvedModule.isExternalLibraryImport, false);
|
||||
// expect three failed lookup location - attempt to load module as file with all supported extensions
|
||||
assert.equal(resolution.failedLookupLocations.length, supportedTypeScriptExtensions.length);
|
||||
test(/*hasDirectoryExists*/ false);
|
||||
test(/*hasDirectoryExists*/ true);
|
||||
|
||||
function test(hasDirectoryExists: boolean) {
|
||||
let containingFile = { name: containingFileName };
|
||||
let packageJson = { name: packageJsonFileName, content: JSON.stringify({ "typings": fieldRef }) };
|
||||
let moduleFile = { name: moduleFileName };
|
||||
let resolution = nodeModuleNameResolver(moduleName, containingFile.name, {}, createModuleResolutionHost(hasDirectoryExists, containingFile, packageJson, moduleFile));
|
||||
assert.equal(resolution.resolvedModule.resolvedFileName, moduleFile.name);
|
||||
assert.equal(!!resolution.resolvedModule.isExternalLibraryImport, false);
|
||||
// expect three failed lookup location - attempt to load module as file with all supported extensions
|
||||
assert.equal(resolution.failedLookupLocations.length, supportedTypeScriptExtensions.length);
|
||||
}
|
||||
}
|
||||
|
||||
it("module name as directory - load from 'typings'", () => {
|
||||
@@ -107,16 +139,21 @@ module ts {
|
||||
});
|
||||
|
||||
function testTypingsIgnored(typings: any): void {
|
||||
let containingFile = { name: "/a/b.ts" };
|
||||
let packageJson = { name: "/node_modules/b/package.json", content: JSON.stringify({ "typings": typings }) };
|
||||
let moduleFile = { name: "/a/b.d.ts" };
|
||||
test(/*hasDirectoryExists*/ false);
|
||||
test(/*hasDirectoryExists*/ true);
|
||||
|
||||
let indexPath = "/node_modules/b/index.d.ts";
|
||||
let indexFile = { name: indexPath }
|
||||
function test(hasDirectoryExists: boolean) {
|
||||
let containingFile = { name: "/a/b.ts" };
|
||||
let packageJson = { name: "/node_modules/b/package.json", content: JSON.stringify({ "typings": typings }) };
|
||||
let moduleFile = { name: "/a/b.d.ts" };
|
||||
|
||||
let resolution = nodeModuleNameResolver("b", containingFile.name, {}, createModuleResolutionHost(containingFile, packageJson, moduleFile, indexFile));
|
||||
let indexPath = "/node_modules/b/index.d.ts";
|
||||
let indexFile = { name: indexPath }
|
||||
|
||||
assert.equal(resolution.resolvedModule.resolvedFileName, indexPath);
|
||||
let resolution = nodeModuleNameResolver("b", containingFile.name, {}, createModuleResolutionHost(hasDirectoryExists, containingFile, packageJson, moduleFile, indexFile));
|
||||
|
||||
assert.equal(resolution.resolvedModule.resolvedFileName, indexPath);
|
||||
}
|
||||
}
|
||||
|
||||
it("module name as directory - handle invalid 'typings'", () => {
|
||||
@@ -128,89 +165,110 @@ module ts {
|
||||
});
|
||||
|
||||
it("module name as directory - load index.d.ts", () => {
|
||||
let containingFile = { name: "/a/b/c.ts" };
|
||||
let packageJson = { name: "/a/b/foo/package.json", content: JSON.stringify({ main: "/c/d" }) };
|
||||
let indexFile = { name: "/a/b/foo/index.d.ts" };
|
||||
let resolution = nodeModuleNameResolver("./foo", containingFile.name, {}, createModuleResolutionHost(containingFile, packageJson, indexFile));
|
||||
assert.equal(resolution.resolvedModule.resolvedFileName, indexFile.name);
|
||||
assert.equal(!!resolution.resolvedModule.isExternalLibraryImport, false);
|
||||
assert.deepEqual(resolution.failedLookupLocations, [
|
||||
"/a/b/foo.ts",
|
||||
"/a/b/foo.tsx",
|
||||
"/a/b/foo.d.ts",
|
||||
"/a/b/foo/index.ts",
|
||||
"/a/b/foo/index.tsx",
|
||||
]);
|
||||
test(/*hasDirectoryExists*/ false);
|
||||
test(/*hasDirectoryExists*/ true);
|
||||
|
||||
function test(hasDirectoryExists: boolean) {
|
||||
let containingFile = { name: "/a/b/c.ts" };
|
||||
let packageJson = { name: "/a/b/foo/package.json", content: JSON.stringify({ main: "/c/d" }) };
|
||||
let indexFile = { name: "/a/b/foo/index.d.ts" };
|
||||
let resolution = nodeModuleNameResolver("./foo", containingFile.name, {}, createModuleResolutionHost(hasDirectoryExists, containingFile, packageJson, indexFile));
|
||||
assert.equal(resolution.resolvedModule.resolvedFileName, indexFile.name);
|
||||
assert.equal(!!resolution.resolvedModule.isExternalLibraryImport, false);
|
||||
assert.deepEqual(resolution.failedLookupLocations, [
|
||||
"/a/b/foo.ts",
|
||||
"/a/b/foo.tsx",
|
||||
"/a/b/foo.d.ts",
|
||||
"/a/b/foo/index.ts",
|
||||
"/a/b/foo/index.tsx",
|
||||
]);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
describe("Node module resolution - non-relative paths", () => {
|
||||
it("load module as file - ts files not loaded", () => {
|
||||
let containingFile = { name: "/a/b/c/d/e.ts" };
|
||||
let moduleFile = { name: "/a/b/node_modules/foo.ts" };
|
||||
let resolution = nodeModuleNameResolver("foo", containingFile.name, {}, createModuleResolutionHost(containingFile, moduleFile));
|
||||
assert.equal(resolution.resolvedModule.resolvedFileName, moduleFile.name);
|
||||
assert.deepEqual(resolution.failedLookupLocations, [
|
||||
"/a/b/c/d/node_modules/foo.ts",
|
||||
"/a/b/c/d/node_modules/foo.tsx",
|
||||
"/a/b/c/d/node_modules/foo.d.ts",
|
||||
"/a/b/c/d/node_modules/foo/package.json",
|
||||
"/a/b/c/d/node_modules/foo/index.ts",
|
||||
"/a/b/c/d/node_modules/foo/index.tsx",
|
||||
"/a/b/c/d/node_modules/foo/index.d.ts",
|
||||
"/a/b/c/node_modules/foo.ts",
|
||||
"/a/b/c/node_modules/foo.tsx",
|
||||
"/a/b/c/node_modules/foo.d.ts",
|
||||
"/a/b/c/node_modules/foo/package.json",
|
||||
"/a/b/c/node_modules/foo/index.ts",
|
||||
"/a/b/c/node_modules/foo/index.tsx",
|
||||
"/a/b/c/node_modules/foo/index.d.ts",
|
||||
])
|
||||
test(/*hasDirectoryExists*/ false);
|
||||
test(/*hasDirectoryExists*/ true);
|
||||
|
||||
function test(hasDirectoryExists: boolean) {
|
||||
let containingFile = { name: "/a/b/c/d/e.ts" };
|
||||
let moduleFile = { name: "/a/b/node_modules/foo.ts" };
|
||||
let resolution = nodeModuleNameResolver("foo", containingFile.name, {}, createModuleResolutionHost(hasDirectoryExists, containingFile, moduleFile));
|
||||
assert.equal(resolution.resolvedModule.resolvedFileName, moduleFile.name);
|
||||
assert.deepEqual(resolution.failedLookupLocations, [
|
||||
"/a/b/c/d/node_modules/foo.ts",
|
||||
"/a/b/c/d/node_modules/foo.tsx",
|
||||
"/a/b/c/d/node_modules/foo.d.ts",
|
||||
"/a/b/c/d/node_modules/foo/package.json",
|
||||
"/a/b/c/d/node_modules/foo/index.ts",
|
||||
"/a/b/c/d/node_modules/foo/index.tsx",
|
||||
"/a/b/c/d/node_modules/foo/index.d.ts",
|
||||
"/a/b/c/node_modules/foo.ts",
|
||||
"/a/b/c/node_modules/foo.tsx",
|
||||
"/a/b/c/node_modules/foo.d.ts",
|
||||
"/a/b/c/node_modules/foo/package.json",
|
||||
"/a/b/c/node_modules/foo/index.ts",
|
||||
"/a/b/c/node_modules/foo/index.tsx",
|
||||
"/a/b/c/node_modules/foo/index.d.ts",
|
||||
])
|
||||
}
|
||||
});
|
||||
|
||||
it("load module as file", () => {
|
||||
let containingFile = { name: "/a/b/c/d/e.ts" };
|
||||
let moduleFile = { name: "/a/b/node_modules/foo.d.ts" };
|
||||
let resolution = nodeModuleNameResolver("foo", containingFile.name, {}, createModuleResolutionHost(containingFile, moduleFile));
|
||||
assert.equal(resolution.resolvedModule.resolvedFileName, moduleFile.name);
|
||||
assert.equal(resolution.resolvedModule.isExternalLibraryImport, true);
|
||||
test(/*hasDirectoryExists*/ false);
|
||||
test(/*hasDirectoryExists*/ true);
|
||||
|
||||
function test(hasDirectoryExists: boolean) {
|
||||
let containingFile = { name: "/a/b/c/d/e.ts" };
|
||||
let moduleFile = { name: "/a/b/node_modules/foo.d.ts" };
|
||||
let resolution = nodeModuleNameResolver("foo", containingFile.name, {}, createModuleResolutionHost(hasDirectoryExists, containingFile, moduleFile));
|
||||
assert.equal(resolution.resolvedModule.resolvedFileName, moduleFile.name);
|
||||
assert.equal(resolution.resolvedModule.isExternalLibraryImport, true);
|
||||
}
|
||||
});
|
||||
|
||||
it("load module as directory", () => {
|
||||
let containingFile = { name: "/a/node_modules/b/c/node_modules/d/e.ts" };
|
||||
let moduleFile = { name: "/a/node_modules/foo/index.d.ts" };
|
||||
let resolution = nodeModuleNameResolver("foo", containingFile.name, {}, createModuleResolutionHost(containingFile, moduleFile));
|
||||
assert.equal(resolution.resolvedModule.resolvedFileName, moduleFile.name);
|
||||
assert.equal(resolution.resolvedModule.isExternalLibraryImport, true);
|
||||
assert.deepEqual(resolution.failedLookupLocations, [
|
||||
"/a/node_modules/b/c/node_modules/d/node_modules/foo.ts",
|
||||
"/a/node_modules/b/c/node_modules/d/node_modules/foo.tsx",
|
||||
"/a/node_modules/b/c/node_modules/d/node_modules/foo.d.ts",
|
||||
"/a/node_modules/b/c/node_modules/d/node_modules/foo/package.json",
|
||||
"/a/node_modules/b/c/node_modules/d/node_modules/foo/index.ts",
|
||||
"/a/node_modules/b/c/node_modules/d/node_modules/foo/index.tsx",
|
||||
"/a/node_modules/b/c/node_modules/d/node_modules/foo/index.d.ts",
|
||||
"/a/node_modules/b/c/node_modules/foo.ts",
|
||||
"/a/node_modules/b/c/node_modules/foo.tsx",
|
||||
"/a/node_modules/b/c/node_modules/foo.d.ts",
|
||||
"/a/node_modules/b/c/node_modules/foo/package.json",
|
||||
"/a/node_modules/b/c/node_modules/foo/index.ts",
|
||||
"/a/node_modules/b/c/node_modules/foo/index.tsx",
|
||||
"/a/node_modules/b/c/node_modules/foo/index.d.ts",
|
||||
"/a/node_modules/b/node_modules/foo.ts",
|
||||
"/a/node_modules/b/node_modules/foo.tsx",
|
||||
"/a/node_modules/b/node_modules/foo.d.ts",
|
||||
"/a/node_modules/b/node_modules/foo/package.json",
|
||||
"/a/node_modules/b/node_modules/foo/index.ts",
|
||||
"/a/node_modules/b/node_modules/foo/index.tsx",
|
||||
"/a/node_modules/b/node_modules/foo/index.d.ts",
|
||||
"/a/node_modules/foo.ts",
|
||||
"/a/node_modules/foo.tsx",
|
||||
"/a/node_modules/foo.d.ts",
|
||||
"/a/node_modules/foo/package.json",
|
||||
"/a/node_modules/foo/index.ts",
|
||||
"/a/node_modules/foo/index.tsx"
|
||||
]);
|
||||
test(/*hasDirectoryExists*/ false);
|
||||
test(/*hasDirectoryExists*/ true);
|
||||
|
||||
function test(hasDirectoryExists: boolean) {
|
||||
let containingFile = { name: "/a/node_modules/b/c/node_modules/d/e.ts" };
|
||||
let moduleFile = { name: "/a/node_modules/foo/index.d.ts" };
|
||||
let resolution = nodeModuleNameResolver("foo", containingFile.name, {}, createModuleResolutionHost(hasDirectoryExists, containingFile, moduleFile));
|
||||
assert.equal(resolution.resolvedModule.resolvedFileName, moduleFile.name);
|
||||
assert.equal(resolution.resolvedModule.isExternalLibraryImport, true);
|
||||
assert.deepEqual(resolution.failedLookupLocations, [
|
||||
"/a/node_modules/b/c/node_modules/d/node_modules/foo.ts",
|
||||
"/a/node_modules/b/c/node_modules/d/node_modules/foo.tsx",
|
||||
"/a/node_modules/b/c/node_modules/d/node_modules/foo.d.ts",
|
||||
"/a/node_modules/b/c/node_modules/d/node_modules/foo/package.json",
|
||||
"/a/node_modules/b/c/node_modules/d/node_modules/foo/index.ts",
|
||||
"/a/node_modules/b/c/node_modules/d/node_modules/foo/index.tsx",
|
||||
"/a/node_modules/b/c/node_modules/d/node_modules/foo/index.d.ts",
|
||||
"/a/node_modules/b/c/node_modules/foo.ts",
|
||||
"/a/node_modules/b/c/node_modules/foo.tsx",
|
||||
"/a/node_modules/b/c/node_modules/foo.d.ts",
|
||||
"/a/node_modules/b/c/node_modules/foo/package.json",
|
||||
"/a/node_modules/b/c/node_modules/foo/index.ts",
|
||||
"/a/node_modules/b/c/node_modules/foo/index.tsx",
|
||||
"/a/node_modules/b/c/node_modules/foo/index.d.ts",
|
||||
"/a/node_modules/b/node_modules/foo.ts",
|
||||
"/a/node_modules/b/node_modules/foo.tsx",
|
||||
"/a/node_modules/b/node_modules/foo.d.ts",
|
||||
"/a/node_modules/b/node_modules/foo/package.json",
|
||||
"/a/node_modules/b/node_modules/foo/index.ts",
|
||||
"/a/node_modules/b/node_modules/foo/index.tsx",
|
||||
"/a/node_modules/b/node_modules/foo/index.d.ts",
|
||||
"/a/node_modules/foo.ts",
|
||||
"/a/node_modules/foo.tsx",
|
||||
"/a/node_modules/foo.d.ts",
|
||||
"/a/node_modules/foo/package.json",
|
||||
"/a/node_modules/foo/index.ts",
|
||||
"/a/node_modules/foo/index.tsx"
|
||||
]);
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -400,4 +458,21 @@ import b = require("./moduleB.ts");
|
||||
test(files, { module: ts.ModuleKind.CommonJS, forceConsistentCasingInFileNames: true }, "/a/B/c", /* useCaseSensitiveFileNames */ false, ["moduleD.ts"], []);
|
||||
})
|
||||
});
|
||||
|
||||
function notImplemented(name: string): () => any {
|
||||
return () => assert(`${name} is not implemented and should not be called`);
|
||||
}
|
||||
|
||||
describe("ModuleResolutionHost.directoryExists", () => {
|
||||
it("No 'fileExists' calls if containing directory is missing", () => {
|
||||
const host: ModuleResolutionHost = {
|
||||
readFile: notImplemented("readFile"),
|
||||
fileExists: notImplemented("fileExists"),
|
||||
directoryExists: _ => false
|
||||
};
|
||||
|
||||
const result = resolveModuleName("someName", "/a/b/c/d", { moduleResolution: ModuleResolutionKind.NodeJs }, host);
|
||||
assert(!result.resolvedModule);
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -134,7 +134,7 @@ var x = 0;`,
|
||||
|
||||
it("Sets module name", () => {
|
||||
let output =
|
||||
`System.register("NamedModule", [], function(exports_1, __moduleName) {\n "use strict";\n var x;\n` +
|
||||
`System.register("NamedModule", [], function(exports_1) {\n "use strict";\n var x;\n` +
|
||||
` return {\n` +
|
||||
` setters:[],\n` +
|
||||
` execute: function() {\n` +
|
||||
@@ -159,7 +159,7 @@ var x = 0;`,
|
||||
`declare function use(a: any);\n` +
|
||||
`use(foo);`
|
||||
let output =
|
||||
`System.register(["SomeOtherName"], function(exports_1, __moduleName) {\n` +
|
||||
`System.register(["SomeOtherName"], function(exports_1) {\n` +
|
||||
` "use strict";\n` +
|
||||
` var SomeName_1;\n` +
|
||||
` return {\n` +
|
||||
|
||||
Reference in New Issue
Block a user