From 2c4856ae71eb53ac9a2ab060e05890e5d10a3266 Mon Sep 17 00:00:00 2001 From: Ryan Cavanaugh Date: Tue, 29 Dec 2015 16:00:15 -0800 Subject: [PATCH 1/7] Issue correct errors for missing JSX closing tags Fixes #6280 --- src/compiler/checker.ts | 23 +------ src/compiler/diagnosticMessages.json | 4 ++ src/compiler/parser.ts | 24 ++++++- .../reference/jsxAndTypeAssertion.errors.txt | 30 +++++++-- .../jsxInvalidEsprimaTestSuite.errors.txt | 18 ++++- .../reference/jsxParsingError2.errors.txt | 66 +++++++++++++++++++ tests/baselines/reference/jsxParsingError2.js | 49 ++++++++++++++ .../reference/tsxErrorRecovery1.errors.txt | 9 ++- .../conformance/jsx/jsxParsingError2.tsx | 28 ++++++++ 9 files changed, 217 insertions(+), 34 deletions(-) create mode 100644 tests/baselines/reference/jsxParsingError2.errors.txt create mode 100644 tests/baselines/reference/jsxParsingError2.js create mode 100644 tests/cases/conformance/jsx/jsxParsingError2.tsx diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 5d57e9d2028..fe28758494b 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -7938,31 +7938,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 (lhs).text === (rhs).text; - } - - return (lhs).right.text === (rhs).right.text && - tagNamesAreEquivalent((lhs).left, (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) { diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index a43f3534df6..f7268d6d990 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -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 } } diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 7f5d052a7e7..390ab210543 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -3497,6 +3497,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 (lhs).text === (rhs).text; + } + + return (lhs).right.text === (rhs).right.text && + tagNamesAreEquivalent((lhs).left, (rhs).left); + } + + function parseJsxElementOrSelfClosingElement(inExpressionContext: boolean): JsxElement | JsxSelfClosingElement { const opening = parseJsxOpeningOrSelfClosingElement(inExpressionContext); let result: JsxElement | JsxSelfClosingElement; @@ -3506,6 +3520,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 { @@ -3565,10 +3584,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()); diff --git a/tests/baselines/reference/jsxAndTypeAssertion.errors.txt b/tests/baselines/reference/jsxAndTypeAssertion.errors.txt index aebabf15133..d0e9bcf145b 100644 --- a/tests/baselines/reference/jsxAndTypeAssertion.errors.txt +++ b/tests/baselines/reference/jsxAndTypeAssertion.errors.txt @@ -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: ' { test: }; + ~~~ +!!! error TS17008: JSX element 'any' has no corresponding closing tag. ~~~~ !!! error TS2304: Cannot find name 'test'. ~ !!! error TS1005: '}' expected. x = ; + ~~~ +!!! error TS17008: JSX element 'any' has no corresponding closing tag. x = hello {{}} ; + ~~~ +!!! 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 = {}}>hello{{}}; + ~~~ +!!! error TS17008: JSX element 'foo' has no corresponding closing tag. ~ !!! error TS1005: '}' expected. x = x, x = ; {{/foo/.test(x) ? : }} + ~~~ +!!! 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'. \ No newline at end of file +!!! 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: '; @@ -188,7 +192,11 @@ tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(35,21): error TS17002 ~ !!! error TS1109: Expression expected. ; + ~ +!!! error TS17008: JSX element 'a' has no corresponding closing tag. ; + ~ +!!! error TS17008: JSX element 'a' has no corresponding closing tag. var x =
one
two
;; var x =
one
/* intervening comment */
two
;;
{"str";}; @@ -218,9 +226,13 @@ tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(35,21): error TS17002 >; >; ; + ~ +!!! error TS17008: JSX element 'a' has no corresponding closing tag. ~ !!! error TS1005: '{' expected. ; + ~ +!!! 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'. \ No newline at end of file +!!! error TS1005: '; + ~~~ +!!! error TS17008: JSX element 'div' has no corresponding closing tag. + ~~~~~~ +!!! error TS17002: Expected corresponding JSX closing tag for 'span'. + + +!!! error TS1005: '; + ~~~~~~~ +!!! error TS17002: Expected corresponding JSX closing tag for 'div'. + + +==== tests/cases/conformance/jsx/Error3.tsx (2 errors) ==== + let x3 =
; + ~~~ +!!! error TS17008: JSX element 'div' has no corresponding closing tag. + + + +!!! error TS1005: '
; + ~~~ +!!! error TS17008: JSX element 'div' has no corresponding closing tag. + ~~~~~~~ +!!! error TS17002: Expected corresponding JSX closing tag for 'div'. + + +!!! error TS1005: ' + ~~~ +!!! error TS17008: JSX element 'div' has no corresponding closing tag. + ~~~~ +!!! error TS17008: JSX element 'span' has no corresponding closing tag. + + + +!!! error TS1005: '
; + +//// [Error2.tsx] +let x2 =
; + + +//// [Error3.tsx] +let x3 =
; + + +//// [Error4.tsx] +let x4 =
; + +//// [Error5.tsx] +let x5 =
+ + + +//// [file.jsx] +//// [Error1.jsx] +// Issue error about missing span closing tag, not missing div closing tag +var x1 =
; +; +//// [Error2.jsx] +var x2 =
; +//// [Error3.jsx] +var x3 =
; + +; +//// [Error4.jsx] +var x4 =
; +; +//// [Error5.jsx] +var x5 =
+ +; diff --git a/tests/baselines/reference/tsxErrorRecovery1.errors.txt b/tests/baselines/reference/tsxErrorRecovery1.errors.txt index 0937b0d37ac..c368e48ddd1 100644 --- a/tests/baselines/reference/tsxErrorRecovery1.errors.txt +++ b/tests/baselines/reference/tsxErrorRecovery1.errors.txt @@ -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: ' {
+ ~~~ +!!! 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'. \ No newline at end of file +!!! error TS1005: '
; + +// @filename: Error2.tsx +let x2 =
; + + +// @filename: Error3.tsx +let x3 =
; + + +// @filename: Error4.tsx +let x4 =
; + +// @filename: Error5.tsx +let x5 =
+ From 347359c18e9e17aa8e5ac35023308449018b4e64 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Tue, 5 Jan 2016 11:01:28 -0500 Subject: [PATCH 2/7] Added '[Symbol.toStringTag]' property to 'GeneratorFunction'. --- src/lib/es6.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/es6.d.ts b/src/lib/es6.d.ts index 531dbf9e5ea..c5dbeb65749 100644 --- a/src/lib/es6.d.ts +++ b/src/lib/es6.d.ts @@ -565,7 +565,7 @@ interface IterableIterator extends Iterator { } interface GeneratorFunction extends Function { - + [Symbol.toStringTag]: string; } interface GeneratorFunctionConstructor { From a4dc0f37dab3e6381aa2bb607942913ce22e10b9 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Tue, 5 Jan 2016 11:20:44 -0500 Subject: [PATCH 3/7] Added '[Symbol.toStringTag]' properties to type arrays. --- src/lib/es6.d.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/lib/es6.d.ts b/src/lib/es6.d.ts index c5dbeb65749..b86eccf4b58 100644 --- a/src/lib/es6.d.ts +++ b/src/lib/es6.d.ts @@ -909,6 +909,7 @@ interface Int8Array { */ values(): IterableIterator; [Symbol.iterator](): IterableIterator; + [Symbol.toStringTag]: "Int8Array"; } interface Int8ArrayConstructor { @@ -941,6 +942,7 @@ interface Uint8Array { */ values(): IterableIterator; [Symbol.iterator](): IterableIterator; + [Symbol.toStringTag]: "UInt8Array"; } interface Uint8ArrayConstructor { @@ -976,6 +978,7 @@ interface Uint8ClampedArray { values(): IterableIterator; [Symbol.iterator](): IterableIterator; + [Symbol.toStringTag]: "Uint8ClampedArray"; } interface Uint8ClampedArrayConstructor { @@ -1013,6 +1016,7 @@ interface Int16Array { [Symbol.iterator](): IterableIterator; + [Symbol.toStringTag]: "Int16Array"; } interface Int16ArrayConstructor { @@ -1045,6 +1049,7 @@ interface Uint16Array { */ values(): IterableIterator; [Symbol.iterator](): IterableIterator; + [Symbol.toStringTag]: "Uint16Array"; } interface Uint16ArrayConstructor { @@ -1077,6 +1082,7 @@ interface Int32Array { */ values(): IterableIterator; [Symbol.iterator](): IterableIterator; + [Symbol.toStringTag]: "Int32Array"; } interface Int32ArrayConstructor { @@ -1109,6 +1115,7 @@ interface Uint32Array { */ values(): IterableIterator; [Symbol.iterator](): IterableIterator; + [Symbol.toStringTag]: "Uint32Array"; } interface Uint32ArrayConstructor { @@ -1141,6 +1148,7 @@ interface Float32Array { */ values(): IterableIterator; [Symbol.iterator](): IterableIterator; + [Symbol.toStringTag]: "Float32Array"; } interface Float32ArrayConstructor { @@ -1173,6 +1181,7 @@ interface Float64Array { */ values(): IterableIterator; [Symbol.iterator](): IterableIterator; + [Symbol.toStringTag]: "Float64Array"; } interface Float64ArrayConstructor { From 7d292c41d689252dee59b0c719c83521a097b0ea Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Tue, 5 Jan 2016 11:23:45 -0500 Subject: [PATCH 4/7] Use string literals for '[Symbol.toStringTag]' properties. --- src/lib/es6.d.ts | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/lib/es6.d.ts b/src/lib/es6.d.ts index b86eccf4b58..84128a01cf2 100644 --- a/src/lib/es6.d.ts +++ b/src/lib/es6.d.ts @@ -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 extends Iterator { } interface GeneratorFunction extends Function { - [Symbol.toStringTag]: string; + [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 { size: number; values(): IterableIterator; [Symbol.iterator]():IterableIterator<[K,V]>; - [Symbol.toStringTag]: string; + [Symbol.toStringTag]: "Map"; } interface MapConstructor { @@ -824,7 +824,7 @@ interface WeakMap { get(key: K): V; has(key: K): boolean; set(key: K, value?: V): WeakMap; - [Symbol.toStringTag]: string; + [Symbol.toStringTag]: "WeakMap"; } interface WeakMapConstructor { @@ -846,7 +846,7 @@ interface Set { size: number; values(): IterableIterator; [Symbol.iterator]():IterableIterator; - [Symbol.toStringTag]: string; + [Symbol.toStringTag]: "Set"; } interface SetConstructor { @@ -862,7 +862,7 @@ interface WeakSet { 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"; } /** @@ -1258,7 +1258,7 @@ interface Promise { catch(onrejected?: (reason: any) => T | PromiseLike): Promise; catch(onrejected?: (reason: any) => void): Promise; - [Symbol.toStringTag]: string; + [Symbol.toStringTag]: "Promise"; } interface PromiseConstructor { From 3fd5fd6c59e66ebd6c3f62ceb3d396410aac62b6 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Tue, 5 Jan 2016 11:40:45 -0500 Subject: [PATCH 5/7] Updated a test and added a new test for assignability betewen typed arrays. --- tests/cases/compiler/typedArrays.ts | 2 - .../typedArraysCrossAssignability01.ts | 94 +++++++++++++++++++ 2 files changed, 94 insertions(+), 2 deletions(-) create mode 100644 tests/cases/compiler/typedArraysCrossAssignability01.ts diff --git a/tests/cases/compiler/typedArrays.ts b/tests/cases/compiler/typedArrays.ts index 4508632f6d6..602e15dc2d7 100644 --- a/tests/cases/compiler/typedArrays.ts +++ b/tests/cases/compiler/typedArrays.ts @@ -75,7 +75,6 @@ function CreateIntegerTypedArraysFromArrayLike(obj:ArrayLike) { 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 = []; diff --git a/tests/cases/compiler/typedArraysCrossAssignability01.ts b/tests/cases/compiler/typedArraysCrossAssignability01.ts new file mode 100644 index 00000000000..27607b64161 --- /dev/null +++ b/tests/cases/compiler/typedArraysCrossAssignability01.ts @@ -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; + +} From 5248b2ce033f2a7667620c86b70fc516486352f6 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Tue, 5 Jan 2016 11:41:59 -0500 Subject: [PATCH 6/7] Accepted baselines. --- tests/baselines/reference/typedArrays.js | 5 - tests/baselines/reference/typedArrays.symbols | 241 +++++--- tests/baselines/reference/typedArrays.types | 107 +++- ...typedArraysCrossAssignability01.errors.txt | 545 ++++++++++++++++++ .../typedArraysCrossAssignability01.js | 180 ++++++ 5 files changed, 979 insertions(+), 99 deletions(-) create mode 100644 tests/baselines/reference/typedArraysCrossAssignability01.errors.txt create mode 100644 tests/baselines/reference/typedArraysCrossAssignability01.js diff --git a/tests/baselines/reference/typedArrays.js b/tests/baselines/reference/typedArrays.js index 89e6f43ecae..6159edc1187 100644 --- a/tests/baselines/reference/typedArrays.js +++ b/tests/baselines/reference/typedArrays.js @@ -75,7 +75,6 @@ function CreateIntegerTypedArraysFromArrayLike(obj:ArrayLike) { 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); diff --git a/tests/baselines/reference/typedArrays.symbols b/tests/baselines/reference/typedArrays.symbols index cf5e68b956a..7282e8b8879 100644 --- a/tests/baselines/reference/typedArrays.symbols +++ b/tests/baselines/reference/typedArrays.symbols @@ -307,267 +307,324 @@ function CreateIntegerTypedArraysFromArrayLike(obj:ArrayLike) { >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, 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, 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)) } diff --git a/tests/baselines/reference/typedArrays.types b/tests/baselines/reference/typedArrays.types index 9886982c0f2..f7d3cbdd19f 100644 --- a/tests/baselines/reference/typedArrays.types +++ b/tests/baselines/reference/typedArrays.types @@ -483,22 +483,125 @@ function CreateIntegerTypedArraysFromArrayLike(obj:ArrayLike) { >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[] diff --git a/tests/baselines/reference/typedArraysCrossAssignability01.errors.txt b/tests/baselines/reference/typedArraysCrossAssignability01.errors.txt new file mode 100644 index 00000000000..bd3422b4826 --- /dev/null +++ b/tests/baselines/reference/typedArraysCrossAssignability01.errors.txt @@ -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; + + } + \ No newline at end of file diff --git a/tests/baselines/reference/typedArraysCrossAssignability01.js b/tests/baselines/reference/typedArraysCrossAssignability01.js new file mode 100644 index 00000000000..9572bfcaf59 --- /dev/null +++ b/tests/baselines/reference/typedArraysCrossAssignability01.js @@ -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; +} From dbe8489087b70d7401d902a720af0e2415c23c0a Mon Sep 17 00:00:00 2001 From: Vladimir Matveev Date: Tue, 5 Jan 2016 10:28:32 -0800 Subject: [PATCH 7/7] Revert "Merge pull request #6098 from guybedford/master" This reverts commit 996f16940e3d10a3fe0fb018defa78ce869021ee, reversing changes made to 51fd41b0c7b0f38335f8a2de6f5cd66b278c5a9c. --- src/compiler/emitter.ts | 2 +- tests/baselines/reference/aliasesInSystemModule1.js | 2 +- tests/baselines/reference/aliasesInSystemModule2.js | 2 +- .../reference/allowSyntheticDefaultImports2.js | 4 ++-- .../reference/allowSyntheticDefaultImports3.js | 4 ++-- .../reference/allowSyntheticDefaultImports5.js | 2 +- .../reference/allowSyntheticDefaultImports6.js | 2 +- .../reference/anonymousDefaultExportsSystem.js | 4 ++-- tests/baselines/reference/capturedLetConstInLoop4.js | 2 +- .../decoratedDefaultExportsGetExportedSystem.js | 4 ++-- .../reference/defaultExportsGetExportedSystem.js | 4 ++-- tests/baselines/reference/es5-system.js | 2 +- .../reference/exportNonInitializedVariablesSystem.js | 2 +- tests/baselines/reference/exportStarForValues10.js | 6 +++--- tests/baselines/reference/exportStarForValues6.js | 4 ++-- .../reference/exportStarForValuesInSystem.js | 4 ++-- .../reference/isolatedModulesPlainFile-System.js | 2 +- tests/baselines/reference/modulePrologueSystem.js | 2 +- .../reference/outFilerootDirModuleNamesSystem.js | 4 ++-- tests/baselines/reference/outModuleConcatSystem.js | 4 ++-- .../reference/outModuleConcatSystem.sourcemap.txt | 4 ++-- .../prefixUnaryOperatorsOnExportedVariables.js | 2 +- tests/baselines/reference/systemExportAssignment.js | 2 +- tests/baselines/reference/systemExportAssignment2.js | 4 ++-- tests/baselines/reference/systemExportAssignment3.js | 2 +- tests/baselines/reference/systemModule1.js | 2 +- tests/baselines/reference/systemModule10.js | 2 +- tests/baselines/reference/systemModule10_ES5.js | 2 +- tests/baselines/reference/systemModule11.js | 10 +++++----- tests/baselines/reference/systemModule12.js | 2 +- tests/baselines/reference/systemModule13.js | 2 +- tests/baselines/reference/systemModule14.js | 2 +- tests/baselines/reference/systemModule15.js | 8 ++++---- tests/baselines/reference/systemModule16.js | 2 +- tests/baselines/reference/systemModule17.js | 4 ++-- tests/baselines/reference/systemModule2.js | 2 +- tests/baselines/reference/systemModule3.js | 8 ++++---- tests/baselines/reference/systemModule4.js | 2 +- tests/baselines/reference/systemModule5.js | 2 +- tests/baselines/reference/systemModule6.js | 2 +- tests/baselines/reference/systemModule7.js | 2 +- tests/baselines/reference/systemModule8.js | 2 +- tests/baselines/reference/systemModule9.js | 2 +- .../reference/systemModuleAmbientDeclarations.js | 12 ++++++------ tests/baselines/reference/systemModuleConstEnums.js | 2 +- .../systemModuleConstEnumsSeparateCompilation.js | 2 +- .../reference/systemModuleDeclarationMerging.js | 2 +- .../baselines/reference/systemModuleExportDefault.js | 8 ++++---- .../systemModuleNonTopLevelModuleMembers.js | 2 +- .../reference/systemModuleWithSuperClass.js | 4 ++-- tests/cases/unittests/transpile.ts | 4 ++-- 51 files changed, 85 insertions(+), 85 deletions(-) diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index d412225cdf0..174ddb68546 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -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); diff --git a/tests/baselines/reference/aliasesInSystemModule1.js b/tests/baselines/reference/aliasesInSystemModule1.js index 11f02c18ea4..43037c7634c 100644 --- a/tests/baselines/reference/aliasesInSystemModule1.js +++ b/tests/baselines/reference/aliasesInSystemModule1.js @@ -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; diff --git a/tests/baselines/reference/aliasesInSystemModule2.js b/tests/baselines/reference/aliasesInSystemModule2.js index 7378536e2fd..7effb2721be 100644 --- a/tests/baselines/reference/aliasesInSystemModule2.js +++ b/tests/baselines/reference/aliasesInSystemModule2.js @@ -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; diff --git a/tests/baselines/reference/allowSyntheticDefaultImports2.js b/tests/baselines/reference/allowSyntheticDefaultImports2.js index 0480250d71a..fcc029415cf 100644 --- a/tests/baselines/reference/allowSyntheticDefaultImports2.js +++ b/tests/baselines/reference/allowSyntheticDefaultImports2.js @@ -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; diff --git a/tests/baselines/reference/allowSyntheticDefaultImports3.js b/tests/baselines/reference/allowSyntheticDefaultImports3.js index adf85792fd9..b14d25dbd61 100644 --- a/tests/baselines/reference/allowSyntheticDefaultImports3.js +++ b/tests/baselines/reference/allowSyntheticDefaultImports3.js @@ -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; diff --git a/tests/baselines/reference/allowSyntheticDefaultImports5.js b/tests/baselines/reference/allowSyntheticDefaultImports5.js index d0dfdcb76d1..c9121512b61 100644 --- a/tests/baselines/reference/allowSyntheticDefaultImports5.js +++ b/tests/baselines/reference/allowSyntheticDefaultImports5.js @@ -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; diff --git a/tests/baselines/reference/allowSyntheticDefaultImports6.js b/tests/baselines/reference/allowSyntheticDefaultImports6.js index eaafb5ee276..64d52e70af9 100644 --- a/tests/baselines/reference/allowSyntheticDefaultImports6.js +++ b/tests/baselines/reference/allowSyntheticDefaultImports6.js @@ -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; diff --git a/tests/baselines/reference/anonymousDefaultExportsSystem.js b/tests/baselines/reference/anonymousDefaultExportsSystem.js index 4ee7e2a11bc..74913a57a99 100644 --- a/tests/baselines/reference/anonymousDefaultExportsSystem.js +++ b/tests/baselines/reference/anonymousDefaultExportsSystem.js @@ -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); diff --git a/tests/baselines/reference/capturedLetConstInLoop4.js b/tests/baselines/reference/capturedLetConstInLoop4.js index c2d2c998616..724c84fe04f 100644 --- a/tests/baselines/reference/capturedLetConstInLoop4.js +++ b/tests/baselines/reference/capturedLetConstInLoop4.js @@ -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 diff --git a/tests/baselines/reference/decoratedDefaultExportsGetExportedSystem.js b/tests/baselines/reference/decoratedDefaultExportsGetExportedSystem.js index be20d5ffc12..ed322374799 100644 --- a/tests/baselines/reference/decoratedDefaultExportsGetExportedSystem.js +++ b/tests/baselines/reference/decoratedDefaultExportsGetExportedSystem.js @@ -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; diff --git a/tests/baselines/reference/defaultExportsGetExportedSystem.js b/tests/baselines/reference/defaultExportsGetExportedSystem.js index f67ccb6ee23..67dc47f4bd5 100644 --- a/tests/baselines/reference/defaultExportsGetExportedSystem.js +++ b/tests/baselines/reference/defaultExportsGetExportedSystem.js @@ -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); diff --git a/tests/baselines/reference/es5-system.js b/tests/baselines/reference/es5-system.js index 1cd1dac13d1..a9633352b8b 100644 --- a/tests/baselines/reference/es5-system.js +++ b/tests/baselines/reference/es5-system.js @@ -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 { diff --git a/tests/baselines/reference/exportNonInitializedVariablesSystem.js b/tests/baselines/reference/exportNonInitializedVariablesSystem.js index 53d8a5424ef..b5674bf5ce3 100644 --- a/tests/baselines/reference/exportNonInitializedVariablesSystem.js +++ b/tests/baselines/reference/exportNonInitializedVariablesSystem.js @@ -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 { diff --git a/tests/baselines/reference/exportStarForValues10.js b/tests/baselines/reference/exportStarForValues10.js index 1149baf8b27..dca5dad9b7a 100644 --- a/tests/baselines/reference/exportStarForValues10.js +++ b/tests/baselines/reference/exportStarForValues10.js @@ -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) { diff --git a/tests/baselines/reference/exportStarForValues6.js b/tests/baselines/reference/exportStarForValues6.js index f2257277630..69357d87ee0 100644 --- a/tests/baselines/reference/exportStarForValues6.js +++ b/tests/baselines/reference/exportStarForValues6.js @@ -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 { diff --git a/tests/baselines/reference/exportStarForValuesInSystem.js b/tests/baselines/reference/exportStarForValuesInSystem.js index 33ca1f8b24d..a33465f7e2e 100644 --- a/tests/baselines/reference/exportStarForValuesInSystem.js +++ b/tests/baselines/reference/exportStarForValuesInSystem.js @@ -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 { diff --git a/tests/baselines/reference/isolatedModulesPlainFile-System.js b/tests/baselines/reference/isolatedModulesPlainFile-System.js index 44eec5161c0..b66bd497810 100644 --- a/tests/baselines/reference/isolatedModulesPlainFile-System.js +++ b/tests/baselines/reference/isolatedModulesPlainFile-System.js @@ -5,7 +5,7 @@ run(1); //// [isolatedModulesPlainFile-System.js] -System.register([], function(exports_1, __moduleName) { +System.register([], function(exports_1) { "use strict"; return { setters:[], diff --git a/tests/baselines/reference/modulePrologueSystem.js b/tests/baselines/reference/modulePrologueSystem.js index 04519898166..80a46fb27fc 100644 --- a/tests/baselines/reference/modulePrologueSystem.js +++ b/tests/baselines/reference/modulePrologueSystem.js @@ -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 { diff --git a/tests/baselines/reference/outFilerootDirModuleNamesSystem.js b/tests/baselines/reference/outFilerootDirModuleNamesSystem.js index e6ac346dc7f..298ad52689f 100644 --- a/tests/baselines/reference/outFilerootDirModuleNamesSystem.js +++ b/tests/baselines/reference/outFilerootDirModuleNamesSystem.js @@ -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; diff --git a/tests/baselines/reference/outModuleConcatSystem.js b/tests/baselines/reference/outModuleConcatSystem.js index bd2753c6d5f..d4552d33167 100644 --- a/tests/baselines/reference/outModuleConcatSystem.js +++ b/tests/baselines/reference/outModuleConcatSystem.js @@ -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; diff --git a/tests/baselines/reference/outModuleConcatSystem.sourcemap.txt b/tests/baselines/reference/outModuleConcatSystem.sourcemap.txt index 0b1f9cc5294..e3f521c828c 100644 --- a/tests/baselines/reference/outModuleConcatSystem.sourcemap.txt +++ b/tests/baselines/reference/outModuleConcatSystem.sourcemap.txt @@ -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; diff --git a/tests/baselines/reference/prefixUnaryOperatorsOnExportedVariables.js b/tests/baselines/reference/prefixUnaryOperatorsOnExportedVariables.js index a3b70bde6d5..5d414c97d05 100644 --- a/tests/baselines/reference/prefixUnaryOperatorsOnExportedVariables.js +++ b/tests/baselines/reference/prefixUnaryOperatorsOnExportedVariables.js @@ -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 { diff --git a/tests/baselines/reference/systemExportAssignment.js b/tests/baselines/reference/systemExportAssignment.js index f8b50cb580f..72962cf835c 100644 --- a/tests/baselines/reference/systemExportAssignment.js +++ b/tests/baselines/reference/systemExportAssignment.js @@ -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:[], diff --git a/tests/baselines/reference/systemExportAssignment2.js b/tests/baselines/reference/systemExportAssignment2.js index 6a5c0e8f397..0f4dd712493 100644 --- a/tests/baselines/reference/systemExportAssignment2.js +++ b/tests/baselines/reference/systemExportAssignment2.js @@ -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:[], diff --git a/tests/baselines/reference/systemExportAssignment3.js b/tests/baselines/reference/systemExportAssignment3.js index 9c6d3cdbb2f..ca2492a54e1 100644 --- a/tests/baselines/reference/systemExportAssignment3.js +++ b/tests/baselines/reference/systemExportAssignment3.js @@ -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:[], diff --git a/tests/baselines/reference/systemModule1.js b/tests/baselines/reference/systemModule1.js index 749d8170dcb..52f3b482069 100644 --- a/tests/baselines/reference/systemModule1.js +++ b/tests/baselines/reference/systemModule1.js @@ -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 { diff --git a/tests/baselines/reference/systemModule10.js b/tests/baselines/reference/systemModule10.js index f23e7ca1d76..ac32c4948e7 100644 --- a/tests/baselines/reference/systemModule10.js +++ b/tests/baselines/reference/systemModule10.js @@ -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 { diff --git a/tests/baselines/reference/systemModule10_ES5.js b/tests/baselines/reference/systemModule10_ES5.js index 3d63e092df4..0c98df6ba99 100644 --- a/tests/baselines/reference/systemModule10_ES5.js +++ b/tests/baselines/reference/systemModule10_ES5.js @@ -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 { diff --git a/tests/baselines/reference/systemModule11.js b/tests/baselines/reference/systemModule11.js index 1e755a86541..92b0576b919 100644 --- a/tests/baselines/reference/systemModule11.js +++ b/tests/baselines/reference/systemModule11.js @@ -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) { diff --git a/tests/baselines/reference/systemModule12.js b/tests/baselines/reference/systemModule12.js index 04252396926..d8961c3b001 100644 --- a/tests/baselines/reference/systemModule12.js +++ b/tests/baselines/reference/systemModule12.js @@ -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:[], diff --git a/tests/baselines/reference/systemModule13.js b/tests/baselines/reference/systemModule13.js index 509534ee0fe..0b81a946de4 100644 --- a/tests/baselines/reference/systemModule13.js +++ b/tests/baselines/reference/systemModule13.js @@ -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 { diff --git a/tests/baselines/reference/systemModule14.js b/tests/baselines/reference/systemModule14.js index af78af7f6b1..2ec8fc600f4 100644 --- a/tests/baselines/reference/systemModule14.js +++ b/tests/baselines/reference/systemModule14.js @@ -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; diff --git a/tests/baselines/reference/systemModule15.js b/tests/baselines/reference/systemModule15.js index f347ad59671..f8dc11b0ac7 100644 --- a/tests/baselines/reference/systemModule15.js +++ b/tests/baselines/reference/systemModule15.js @@ -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 { diff --git a/tests/baselines/reference/systemModule16.js b/tests/baselines/reference/systemModule16.js index 0986218b65d..76fb85cd3ae 100644 --- a/tests/baselines/reference/systemModule16.js +++ b/tests/baselines/reference/systemModule16.js @@ -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 = { diff --git a/tests/baselines/reference/systemModule17.js b/tests/baselines/reference/systemModule17.js index b441004408b..6daa119d287 100644 --- a/tests/baselines/reference/systemModule17.js +++ b/tests/baselines/reference/systemModule17.js @@ -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; diff --git a/tests/baselines/reference/systemModule2.js b/tests/baselines/reference/systemModule2.js index 78be2c008e4..ee3dfd327ec 100644 --- a/tests/baselines/reference/systemModule2.js +++ b/tests/baselines/reference/systemModule2.js @@ -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 { diff --git a/tests/baselines/reference/systemModule3.js b/tests/baselines/reference/systemModule3.js index 9ccc5ea7894..dbef74f3036 100644 --- a/tests/baselines/reference/systemModule3.js +++ b/tests/baselines/reference/systemModule3.js @@ -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 { diff --git a/tests/baselines/reference/systemModule4.js b/tests/baselines/reference/systemModule4.js index 526ee5d2c3a..192c87d49ea 100644 --- a/tests/baselines/reference/systemModule4.js +++ b/tests/baselines/reference/systemModule4.js @@ -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 { diff --git a/tests/baselines/reference/systemModule5.js b/tests/baselines/reference/systemModule5.js index 6d6a8e52823..4a455f25b13 100644 --- a/tests/baselines/reference/systemModule5.js +++ b/tests/baselines/reference/systemModule5.js @@ -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); diff --git a/tests/baselines/reference/systemModule6.js b/tests/baselines/reference/systemModule6.js index d93b1b861e0..51c8fbc68fb 100644 --- a/tests/baselines/reference/systemModule6.js +++ b/tests/baselines/reference/systemModule6.js @@ -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() { diff --git a/tests/baselines/reference/systemModule7.js b/tests/baselines/reference/systemModule7.js index 6abf76cf075..d76d86a3b0f 100644 --- a/tests/baselines/reference/systemModule7.js +++ b/tests/baselines/reference/systemModule7.js @@ -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 { diff --git a/tests/baselines/reference/systemModule8.js b/tests/baselines/reference/systemModule8.js index 6d48a4a9d45..b6cdd677f00 100644 --- a/tests/baselines/reference/systemModule8.js +++ b/tests/baselines/reference/systemModule8.js @@ -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() { diff --git a/tests/baselines/reference/systemModule9.js b/tests/baselines/reference/systemModule9.js index 4804a08fd39..137dd019a02 100644 --- a/tests/baselines/reference/systemModule9.js +++ b/tests/baselines/reference/systemModule9.js @@ -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; diff --git a/tests/baselines/reference/systemModuleAmbientDeclarations.js b/tests/baselines/reference/systemModuleAmbientDeclarations.js index 35e48fe2aff..9bdde23a842 100644 --- a/tests/baselines/reference/systemModuleAmbientDeclarations.js +++ b/tests/baselines/reference/systemModuleAmbientDeclarations.js @@ -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:[], diff --git a/tests/baselines/reference/systemModuleConstEnums.js b/tests/baselines/reference/systemModuleConstEnums.js index abcd9ca5802..8b8707768d9 100644 --- a/tests/baselines/reference/systemModuleConstEnums.js +++ b/tests/baselines/reference/systemModuleConstEnums.js @@ -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 */); diff --git a/tests/baselines/reference/systemModuleConstEnumsSeparateCompilation.js b/tests/baselines/reference/systemModuleConstEnumsSeparateCompilation.js index 5eaa354bc2a..8466d399ac9 100644 --- a/tests/baselines/reference/systemModuleConstEnumsSeparateCompilation.js +++ b/tests/baselines/reference/systemModuleConstEnumsSeparateCompilation.js @@ -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() { diff --git a/tests/baselines/reference/systemModuleDeclarationMerging.js b/tests/baselines/reference/systemModuleDeclarationMerging.js index 68dec6f3805..5ed029a769a 100644 --- a/tests/baselines/reference/systemModuleDeclarationMerging.js +++ b/tests/baselines/reference/systemModuleDeclarationMerging.js @@ -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() { } diff --git a/tests/baselines/reference/systemModuleExportDefault.js b/tests/baselines/reference/systemModuleExportDefault.js index 05e23840a51..cf1a99a4ad7 100644 --- a/tests/baselines/reference/systemModuleExportDefault.js +++ b/tests/baselines/reference/systemModuleExportDefault.js @@ -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 { diff --git a/tests/baselines/reference/systemModuleNonTopLevelModuleMembers.js b/tests/baselines/reference/systemModuleNonTopLevelModuleMembers.js index 3bce3b662ae..ee9858a7fec 100644 --- a/tests/baselines/reference/systemModuleNonTopLevelModuleMembers.js +++ b/tests/baselines/reference/systemModuleNonTopLevelModuleMembers.js @@ -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() { } diff --git a/tests/baselines/reference/systemModuleWithSuperClass.js b/tests/baselines/reference/systemModuleWithSuperClass.js index 21b262fd217..fe9c2742f2d 100644 --- a/tests/baselines/reference/systemModuleWithSuperClass.js +++ b/tests/baselines/reference/systemModuleWithSuperClass.js @@ -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]; diff --git a/tests/cases/unittests/transpile.ts b/tests/cases/unittests/transpile.ts index 882b4e2094b..513d37673bb 100644 --- a/tests/cases/unittests/transpile.ts +++ b/tests/cases/unittests/transpile.ts @@ -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` +