+
+>>;
diff --git a/tests/baselines/reference/reactNamespaceImportPresevation.js b/tests/baselines/reference/reactNamespaceImportPresevation.js
new file mode 100644
index 00000000000..5c44674d031
--- /dev/null
+++ b/tests/baselines/reference/reactNamespaceImportPresevation.js
@@ -0,0 +1,20 @@
+//// [tests/cases/compiler/reactNamespaceImportPresevation.tsx] ////
+
+//// [modules.d.ts]
+
+declare module "my-React-Lib" {
+ var a: any;
+ export = a;
+}
+
+//// [test.tsx]
+import * as myReactLib from "my-React-Lib"; // should not be elided
+declare var foo: any;
+
+;
+
+
+//// [test.jsx]
+"use strict";
+var myReactLib = require("my-React-Lib"); // should not be elided
+;
diff --git a/tests/baselines/reference/reactNamespaceImportPresevation.symbols b/tests/baselines/reference/reactNamespaceImportPresevation.symbols
new file mode 100644
index 00000000000..8a4407c8160
--- /dev/null
+++ b/tests/baselines/reference/reactNamespaceImportPresevation.symbols
@@ -0,0 +1,20 @@
+=== tests/cases/compiler/modules.d.ts ===
+
+declare module "my-React-Lib" {
+ var a: any;
+>a : Symbol(a, Decl(modules.d.ts, 2, 7))
+
+ export = a;
+>a : Symbol(a, Decl(modules.d.ts, 2, 7))
+}
+
+=== tests/cases/compiler/test.tsx ===
+import * as myReactLib from "my-React-Lib"; // should not be elided
+>myReactLib : Symbol(myReactLib, Decl(test.tsx, 0, 6))
+
+declare var foo: any;
+>foo : Symbol(foo, Decl(test.tsx, 1, 11))
+
+;
+>data : Symbol(unknown)
+
diff --git a/tests/baselines/reference/reactNamespaceImportPresevation.types b/tests/baselines/reference/reactNamespaceImportPresevation.types
new file mode 100644
index 00000000000..adb1d60d2d5
--- /dev/null
+++ b/tests/baselines/reference/reactNamespaceImportPresevation.types
@@ -0,0 +1,22 @@
+=== tests/cases/compiler/modules.d.ts ===
+
+declare module "my-React-Lib" {
+ var a: any;
+>a : any
+
+ export = a;
+>a : any
+}
+
+=== tests/cases/compiler/test.tsx ===
+import * as myReactLib from "my-React-Lib"; // should not be elided
+>myReactLib : any
+
+declare var foo: any;
+>foo : any
+
+;
+> : any
+>foo : any
+>data : any
+
diff --git a/tests/baselines/reference/reactNamespaceInvalidInput.errors.txt b/tests/baselines/reference/reactNamespaceInvalidInput.errors.txt
new file mode 100644
index 00000000000..e08ec520867
--- /dev/null
+++ b/tests/baselines/reference/reactNamespaceInvalidInput.errors.txt
@@ -0,0 +1,11 @@
+error TS5059: Invalide value for '--reactNamespace'. 'my-React-Lib' is not a valid identifier.
+tests/cases/compiler/reactNamespaceInvalidInput.tsx(2,2): error TS2304: Cannot find name 'my-React-Lib'.
+
+
+!!! error TS5059: Invalide value for '--reactNamespace'. 'my-React-Lib' is not a valid identifier.
+==== tests/cases/compiler/reactNamespaceInvalidInput.tsx (1 errors) ====
+
+ ;
+ ~~~
+!!! error TS2304: Cannot find name 'my-React-Lib'.
+
\ No newline at end of file
diff --git a/tests/baselines/reference/reactNamespaceInvalidInput.js b/tests/baselines/reference/reactNamespaceInvalidInput.js
new file mode 100644
index 00000000000..bf079d6b9a8
--- /dev/null
+++ b/tests/baselines/reference/reactNamespaceInvalidInput.js
@@ -0,0 +1,7 @@
+//// [reactNamespaceInvalidInput.tsx]
+
+;
+
+
+//// [reactNamespaceInvalidInput.js]
+my-React-Lib.createElement("foo", {data: true});
diff --git a/tests/baselines/reference/reactNamespaceJSXEmit.js b/tests/baselines/reference/reactNamespaceJSXEmit.js
new file mode 100644
index 00000000000..26967d56b7b
--- /dev/null
+++ b/tests/baselines/reference/reactNamespaceJSXEmit.js
@@ -0,0 +1,20 @@
+//// [reactNamespaceJSXEmit.tsx]
+
+declare var myReactLib: any;
+declare var foo: any;
+declare var Bar: any;
+declare var x: any;
+
+;
+;
+;
+;
+;
+
+
+//// [reactNamespaceJSXEmit.js]
+myReactLib.createElement("foo", {data: true});
+myReactLib.createElement(Bar, {x: x});
+myReactLib.createElement("x-component", null);
+myReactLib.createElement(Bar, myReactLib.__spread({}, x));
+myReactLib.createElement(Bar, myReactLib.__spread({}, x, {y: 2}));
diff --git a/tests/baselines/reference/reactNamespaceJSXEmit.symbols b/tests/baselines/reference/reactNamespaceJSXEmit.symbols
new file mode 100644
index 00000000000..d79c1cf531e
--- /dev/null
+++ b/tests/baselines/reference/reactNamespaceJSXEmit.symbols
@@ -0,0 +1,32 @@
+=== tests/cases/compiler/reactNamespaceJSXEmit.tsx ===
+
+declare var myReactLib: any;
+>myReactLib : Symbol(myReactLib, Decl(reactNamespaceJSXEmit.tsx, 1, 11))
+
+declare var foo: any;
+>foo : Symbol(foo, Decl(reactNamespaceJSXEmit.tsx, 2, 11))
+
+declare var Bar: any;
+>Bar : Symbol(Bar, Decl(reactNamespaceJSXEmit.tsx, 3, 11))
+
+declare var x: any;
+>x : Symbol(x, Decl(reactNamespaceJSXEmit.tsx, 4, 11))
+
+;
+>data : Symbol(unknown)
+
+;
+>Bar : Symbol(Bar, Decl(reactNamespaceJSXEmit.tsx, 3, 11))
+>x : Symbol(unknown)
+>x : Symbol(x, Decl(reactNamespaceJSXEmit.tsx, 4, 11))
+
+;
+;
+>Bar : Symbol(Bar, Decl(reactNamespaceJSXEmit.tsx, 3, 11))
+>x : Symbol(x, Decl(reactNamespaceJSXEmit.tsx, 4, 11))
+
+;
+>Bar : Symbol(Bar, Decl(reactNamespaceJSXEmit.tsx, 3, 11))
+>x : Symbol(x, Decl(reactNamespaceJSXEmit.tsx, 4, 11))
+>y : Symbol(unknown)
+
diff --git a/tests/baselines/reference/reactNamespaceJSXEmit.types b/tests/baselines/reference/reactNamespaceJSXEmit.types
new file mode 100644
index 00000000000..06c803ef7fd
--- /dev/null
+++ b/tests/baselines/reference/reactNamespaceJSXEmit.types
@@ -0,0 +1,41 @@
+=== tests/cases/compiler/reactNamespaceJSXEmit.tsx ===
+
+declare var myReactLib: any;
+>myReactLib : any
+
+declare var foo: any;
+>foo : any
+
+declare var Bar: any;
+>Bar : any
+
+declare var x: any;
+>x : any
+
+;
+> : any
+>foo : any
+>data : any
+
+;
+> : any
+>Bar : any
+>x : any
+>x : any
+
+;
+> : any
+>x-component : any
+
+;
+> : any
+>Bar : any
+>x : any
+
+;
+> : any
+>Bar : any
+>x : any
+>y : any
+>2 : number
+
diff --git a/tests/baselines/reference/reactNamespaceMissingDeclaration.errors.txt b/tests/baselines/reference/reactNamespaceMissingDeclaration.errors.txt
new file mode 100644
index 00000000000..f87d223f824
--- /dev/null
+++ b/tests/baselines/reference/reactNamespaceMissingDeclaration.errors.txt
@@ -0,0 +1,9 @@
+tests/cases/compiler/reactNamespaceMissingDeclaration.tsx(3,2): error TS2304: Cannot find name 'myReactLib'.
+
+
+==== tests/cases/compiler/reactNamespaceMissingDeclaration.tsx (1 errors) ====
+
+ // Error myReactLib not declared
+
+ ~~~
+!!! error TS2304: Cannot find name 'myReactLib'.
\ No newline at end of file
diff --git a/tests/baselines/reference/reactNamespaceMissingDeclaration.js b/tests/baselines/reference/reactNamespaceMissingDeclaration.js
new file mode 100644
index 00000000000..d972f319f8f
--- /dev/null
+++ b/tests/baselines/reference/reactNamespaceMissingDeclaration.js
@@ -0,0 +1,8 @@
+//// [reactNamespaceMissingDeclaration.tsx]
+
+// Error myReactLib not declared
+
+
+//// [reactNamespaceMissingDeclaration.js]
+// Error myReactLib not declared
+myReactLib.createElement("foo", {data: true});
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: '' expected.
-==== tests/cases/conformance/jsx/file.tsx (4 errors) ====
+==== tests/cases/conformance/jsx/file.tsx (5 errors) ====
declare namespace JSX { interface Element { } }
function foo() {
var x = {
+ ~~~
+!!! 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: '' expected.
\ No newline at end of file
diff --git a/tests/baselines/reference/tsxPreserveEmit1.js b/tests/baselines/reference/tsxPreserveEmit1.js
index 7ac6c18ebca..6d795c946c3 100644
--- a/tests/baselines/reference/tsxPreserveEmit1.js
+++ b/tests/baselines/reference/tsxPreserveEmit1.js
@@ -34,7 +34,7 @@ module M {
//// [test.jsx]
-define(["require", "exports", 'react-router'], function (require, exports, ReactRouter) {
+define(["require", "exports", 'react', 'react-router'], function (require, exports, React, ReactRouter) {
"use strict";
var Route = ReactRouter.Route;
var routes1 = ;
diff --git a/tests/baselines/reference/tsxPreserveEmit2.js b/tests/baselines/reference/tsxPreserveEmit2.js
new file mode 100644
index 00000000000..6a87da7b285
--- /dev/null
+++ b/tests/baselines/reference/tsxPreserveEmit2.js
@@ -0,0 +1,10 @@
+//// [test.tsx]
+
+
+var Route: any;
+var routes1 = ;
+
+
+//// [test.jsx]
+var Route;
+var routes1 = ;
diff --git a/tests/baselines/reference/tsxPreserveEmit2.symbols b/tests/baselines/reference/tsxPreserveEmit2.symbols
new file mode 100644
index 00000000000..4013b2e35ea
--- /dev/null
+++ b/tests/baselines/reference/tsxPreserveEmit2.symbols
@@ -0,0 +1,10 @@
+=== tests/cases/conformance/jsx/test.tsx ===
+
+
+var Route: any;
+>Route : Symbol(Route, Decl(test.tsx, 2, 3))
+
+var routes1 = ;
+>routes1 : Symbol(routes1, Decl(test.tsx, 3, 3))
+>Route : Symbol(Route, Decl(test.tsx, 2, 3))
+
diff --git a/tests/baselines/reference/tsxPreserveEmit2.types b/tests/baselines/reference/tsxPreserveEmit2.types
new file mode 100644
index 00000000000..c01f564ff53
--- /dev/null
+++ b/tests/baselines/reference/tsxPreserveEmit2.types
@@ -0,0 +1,11 @@
+=== tests/cases/conformance/jsx/test.tsx ===
+
+
+var Route: any;
+>Route : any
+
+var routes1 = ;
+>routes1 : any
+> : any
+>Route : any
+
diff --git a/tests/baselines/reference/tsxPreserveEmit3.js b/tests/baselines/reference/tsxPreserveEmit3.js
new file mode 100644
index 00000000000..500b7d26c93
--- /dev/null
+++ b/tests/baselines/reference/tsxPreserveEmit3.js
@@ -0,0 +1,24 @@
+//// [tests/cases/conformance/jsx/tsxPreserveEmit3.tsx] ////
+
+//// [file.tsx]
+
+declare module JSX {
+ interface Element { }
+ interface IntrinsicElements {
+ [s: string]: any;
+ }
+}
+
+//// [test.d.ts]
+export var React;
+
+//// [react-consumer.tsx]
+// This import should be elided
+import {React} from "./test";
+
+
+//// [file.jsx]
+//// [react-consumer.jsx]
+define(["require", "exports"], function (require, exports) {
+ "use strict";
+});
diff --git a/tests/baselines/reference/tsxPreserveEmit3.symbols b/tests/baselines/reference/tsxPreserveEmit3.symbols
new file mode 100644
index 00000000000..ab534241049
--- /dev/null
+++ b/tests/baselines/reference/tsxPreserveEmit3.symbols
@@ -0,0 +1,25 @@
+=== tests/cases/conformance/jsx/file.tsx ===
+
+declare module JSX {
+>JSX : Symbol(JSX, Decl(file.tsx, 0, 0))
+
+ interface Element { }
+>Element : Symbol(Element, Decl(file.tsx, 1, 20))
+
+ interface IntrinsicElements {
+>IntrinsicElements : Symbol(IntrinsicElements, Decl(file.tsx, 2, 22))
+
+ [s: string]: any;
+>s : Symbol(s, Decl(file.tsx, 4, 3))
+ }
+}
+
+=== tests/cases/conformance/jsx/test.d.ts ===
+export var React;
+>React : Symbol(React, Decl(test.d.ts, 0, 10))
+
+=== tests/cases/conformance/jsx/react-consumer.tsx ===
+// This import should be elided
+import {React} from "./test";
+>React : Symbol(React, Decl(react-consumer.tsx, 1, 8))
+
diff --git a/tests/baselines/reference/tsxPreserveEmit3.types b/tests/baselines/reference/tsxPreserveEmit3.types
new file mode 100644
index 00000000000..152f742a240
--- /dev/null
+++ b/tests/baselines/reference/tsxPreserveEmit3.types
@@ -0,0 +1,25 @@
+=== tests/cases/conformance/jsx/file.tsx ===
+
+declare module JSX {
+>JSX : any
+
+ interface Element { }
+>Element : Element
+
+ interface IntrinsicElements {
+>IntrinsicElements : IntrinsicElements
+
+ [s: string]: any;
+>s : string
+ }
+}
+
+=== tests/cases/conformance/jsx/test.d.ts ===
+export var React;
+>React : any
+
+=== tests/cases/conformance/jsx/react-consumer.tsx ===
+// This import should be elided
+import {React} from "./test";
+>React : any
+
diff --git a/tests/baselines/reference/tsxReactEmitEntities.js b/tests/baselines/reference/tsxReactEmitEntities.js
index c1fba50fd8f..a20f3380bf7 100644
--- a/tests/baselines/reference/tsxReactEmitEntities.js
+++ b/tests/baselines/reference/tsxReactEmitEntities.js
@@ -8,7 +8,9 @@ declare module JSX {
declare var React: any;
Dot goes here: · ¬AnEntity;
;
+Be careful of "-ed strings!
;
//// [file.js]
React.createElement("div", null, "Dot goes here: · ¬AnEntity; ");
+React.createElement("div", null, "Be careful of \"-ed strings!");
diff --git a/tests/baselines/reference/tsxReactEmitEntities.symbols b/tests/baselines/reference/tsxReactEmitEntities.symbols
index b633f57ec13..5a0274029e4 100644
--- a/tests/baselines/reference/tsxReactEmitEntities.symbols
+++ b/tests/baselines/reference/tsxReactEmitEntities.symbols
@@ -19,3 +19,7 @@ declare var React: any;
>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22))
>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22))
+Be careful of "-ed strings!
;
+>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22))
+>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22))
+
diff --git a/tests/baselines/reference/tsxReactEmitEntities.types b/tests/baselines/reference/tsxReactEmitEntities.types
index d6d6c285d79..111653ea140 100644
--- a/tests/baselines/reference/tsxReactEmitEntities.types
+++ b/tests/baselines/reference/tsxReactEmitEntities.types
@@ -20,3 +20,8 @@ declare var React: any;
>div : any
>div : any
+Be careful of "-ed strings!
;
+>Be careful of "-ed strings!
: JSX.Element
+>div : any
+>div : any
+
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;
+}
diff --git a/tests/cases/compiler/reactNamespaceImportPresevation.tsx b/tests/cases/compiler/reactNamespaceImportPresevation.tsx
new file mode 100644
index 00000000000..ec7e5d0d6ac
--- /dev/null
+++ b/tests/cases/compiler/reactNamespaceImportPresevation.tsx
@@ -0,0 +1,15 @@
+//@jsx: preserve
+//@module: commonjs
+//@reactNamespace: myReactLib
+
+//@filename: modules.d.ts
+declare module "my-React-Lib" {
+ var a: any;
+ export = a;
+}
+
+//@filename: test.tsx
+import * as myReactLib from "my-React-Lib"; // should not be elided
+declare var foo: any;
+
+;
diff --git a/tests/cases/compiler/reactNamespaceInvalidInput.tsx b/tests/cases/compiler/reactNamespaceInvalidInput.tsx
new file mode 100644
index 00000000000..a8595de5d6e
--- /dev/null
+++ b/tests/cases/compiler/reactNamespaceInvalidInput.tsx
@@ -0,0 +1,4 @@
+//@jsx: react
+//@reactNamespace: my-React-Lib
+
+;
diff --git a/tests/cases/compiler/reactNamespaceJSXEmit.tsx b/tests/cases/compiler/reactNamespaceJSXEmit.tsx
new file mode 100644
index 00000000000..f5ec957a78b
--- /dev/null
+++ b/tests/cases/compiler/reactNamespaceJSXEmit.tsx
@@ -0,0 +1,13 @@
+//@jsx: react
+//@reactNamespace: myReactLib
+
+declare var myReactLib: any;
+declare var foo: any;
+declare var Bar: any;
+declare var x: any;
+
+;
+;
+;
+;
+;
diff --git a/tests/cases/compiler/reactNamespaceMissingDeclaration.tsx b/tests/cases/compiler/reactNamespaceMissingDeclaration.tsx
new file mode 100644
index 00000000000..fdfed629606
--- /dev/null
+++ b/tests/cases/compiler/reactNamespaceMissingDeclaration.tsx
@@ -0,0 +1,5 @@
+//@jsx: react
+//@reactNamespace: myReactLib
+
+// Error myReactLib not declared
+
\ No newline at end of file
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;
+
+}
diff --git a/tests/cases/conformance/jsx/jsxParsingError2.tsx b/tests/cases/conformance/jsx/jsxParsingError2.tsx
new file mode 100644
index 00000000000..241978106ae
--- /dev/null
+++ b/tests/cases/conformance/jsx/jsxParsingError2.tsx
@@ -0,0 +1,28 @@
+//@jsx: preserve
+
+//@filename: file.tsx
+declare module JSX {
+ interface Element { }
+ interface IntrinsicElements {
+ [s: string]: any;
+ }
+}
+
+// @filename: Error1.tsx
+// Issue error about missing span closing tag, not missing div closing tag
+let x1 =
;
+
+// @filename: Error2.tsx
+let x2 = ;
+
+
+// @filename: Error3.tsx
+let x3 =
;
+
+
+// @filename: Error4.tsx
+let x4 =
;
+
+// @filename: Error5.tsx
+let x5 =
+
diff --git a/tests/cases/conformance/jsx/tsxPreserveEmit2.tsx b/tests/cases/conformance/jsx/tsxPreserveEmit2.tsx
new file mode 100644
index 00000000000..978c96a2019
--- /dev/null
+++ b/tests/cases/conformance/jsx/tsxPreserveEmit2.tsx
@@ -0,0 +1,8 @@
+//@module: amd
+//@jsx: preserve
+//@target: ES5
+
+//@Filename: test.tsx
+
+var Route: any;
+var routes1 = ;
diff --git a/tests/cases/conformance/jsx/tsxPreserveEmit3.tsx b/tests/cases/conformance/jsx/tsxPreserveEmit3.tsx
new file mode 100644
index 00000000000..d7565cacbe2
--- /dev/null
+++ b/tests/cases/conformance/jsx/tsxPreserveEmit3.tsx
@@ -0,0 +1,17 @@
+//@jsx: preserve
+//@module: amd
+
+//@filename: file.tsx
+declare module JSX {
+ interface Element { }
+ interface IntrinsicElements {
+ [s: string]: any;
+ }
+}
+
+//@filename: test.d.ts
+export var React;
+
+//@filename: react-consumer.tsx
+// This import should be elided
+import {React} from "./test";
diff --git a/tests/cases/conformance/jsx/tsxReactEmitEntities.tsx b/tests/cases/conformance/jsx/tsxReactEmitEntities.tsx
index 4b7dc5780f8..4726008d6be 100644
--- a/tests/cases/conformance/jsx/tsxReactEmitEntities.tsx
+++ b/tests/cases/conformance/jsx/tsxReactEmitEntities.tsx
@@ -9,3 +9,4 @@ declare module JSX {
declare var React: any;
Dot goes here: · ¬AnEntity;
;
+Be careful of "-ed strings!
;
diff --git a/tests/cases/conformance/types/contextualTypes/commaOperator/contextuallyTypeCommaOperator01.ts b/tests/cases/conformance/types/contextualTypes/commaOperator/contextuallyTypeCommaOperator01.ts
new file mode 100644
index 00000000000..167369a020b
--- /dev/null
+++ b/tests/cases/conformance/types/contextualTypes/commaOperator/contextuallyTypeCommaOperator01.ts
@@ -0,0 +1,5 @@
+// @noImplicitAny: true
+
+let x: (a: string) => string;
+
+x = (100, a => a);
\ No newline at end of file
diff --git a/tests/cases/conformance/types/contextualTypes/commaOperator/contextuallyTypeCommaOperator02.ts b/tests/cases/conformance/types/contextualTypes/commaOperator/contextuallyTypeCommaOperator02.ts
new file mode 100644
index 00000000000..11e743b583e
--- /dev/null
+++ b/tests/cases/conformance/types/contextualTypes/commaOperator/contextuallyTypeCommaOperator02.ts
@@ -0,0 +1,8 @@
+// @noImplicitAny: true
+
+let x: (a: string) => string;
+
+x = (100, a => {
+ const b: number = a;
+ return b;
+});
\ No newline at end of file
diff --git a/tests/cases/conformance/types/contextualTypes/commaOperator/contextuallyTypeCommaOperator03.ts b/tests/cases/conformance/types/contextualTypes/commaOperator/contextuallyTypeCommaOperator03.ts
new file mode 100644
index 00000000000..321eb99d153
--- /dev/null
+++ b/tests/cases/conformance/types/contextualTypes/commaOperator/contextuallyTypeCommaOperator03.ts
@@ -0,0 +1,5 @@
+// @noImplicitAny: true
+
+let x: (a: string) => string;
+
+x = (a => a, b => b);
\ No newline at end of file
diff --git a/tests/cases/conformance/types/contextualTypes/jsxAttributes/contextuallyTypedStringLiteralsInJsxAttributes01.tsx b/tests/cases/conformance/types/contextualTypes/jsxAttributes/contextuallyTypedStringLiteralsInJsxAttributes01.tsx
new file mode 100644
index 00000000000..ce6f4b7ac2f
--- /dev/null
+++ b/tests/cases/conformance/types/contextualTypes/jsxAttributes/contextuallyTypedStringLiteralsInJsxAttributes01.tsx
@@ -0,0 +1,16 @@
+// @jsx: preserve
+// @declaration: true
+
+namespace JSX {
+ interface IntrinsicElements {
+ span: {};
+ }
+}
+
+const FooComponent = (props: { foo: "A" | "B" | "C" }) => {props.foo};
+
+;
+;
+
+;
+;
\ No newline at end of file
diff --git a/tests/cases/conformance/types/contextualTypes/logicalAnd/contextuallyTypeLogicalAnd01.ts b/tests/cases/conformance/types/contextualTypes/logicalAnd/contextuallyTypeLogicalAnd01.ts
new file mode 100644
index 00000000000..30e46429fa1
--- /dev/null
+++ b/tests/cases/conformance/types/contextualTypes/logicalAnd/contextuallyTypeLogicalAnd01.ts
@@ -0,0 +1,6 @@
+// @noImplicitAny: true
+
+let x: (a: string) => string;
+let y = true;
+
+x = y && (a => a);
\ No newline at end of file
diff --git a/tests/cases/conformance/types/contextualTypes/logicalAnd/contextuallyTypeLogicalAnd02.ts b/tests/cases/conformance/types/contextualTypes/logicalAnd/contextuallyTypeLogicalAnd02.ts
new file mode 100644
index 00000000000..26e58ae49ec
--- /dev/null
+++ b/tests/cases/conformance/types/contextualTypes/logicalAnd/contextuallyTypeLogicalAnd02.ts
@@ -0,0 +1,9 @@
+// @noImplicitAny: true
+
+let x: (a: string) => string;
+let y = true;
+
+x = y && (a => {
+ const b: number = a;
+ return b;
+});
\ No newline at end of file
diff --git a/tests/cases/conformance/types/contextualTypes/logicalAnd/contextuallyTypeLogicalAnd03.ts b/tests/cases/conformance/types/contextualTypes/logicalAnd/contextuallyTypeLogicalAnd03.ts
new file mode 100644
index 00000000000..1fba96c048a
--- /dev/null
+++ b/tests/cases/conformance/types/contextualTypes/logicalAnd/contextuallyTypeLogicalAnd03.ts
@@ -0,0 +1,6 @@
+// @noImplicitAny: true
+
+let x: (a: string) => string;
+let y = true;
+
+x = (a => a) && (b => b);
\ No newline at end of file
diff --git a/tests/cases/fourslash/formatDocumentWithTrivia.ts b/tests/cases/fourslash/formatDocumentWithTrivia.ts
new file mode 100644
index 00000000000..d51677be81d
--- /dev/null
+++ b/tests/cases/fourslash/formatDocumentWithTrivia.ts
@@ -0,0 +1,51 @@
+///
+
+////
+////// whitespace below
+////
+////// whitespace above
+////
+////let x;
+////
+////// abc
+////
+////let y;
+////
+////// whitespace above again
+////
+////while (true) {
+//// while (true) {
+//// }
+////
+//// // whitespace above
+////}
+////
+////// whitespace above again
+////
+////
+
+format.document();
+
+verify.currentFileContentIs(`
+// whitespace below
+
+// whitespace above
+
+let x;
+
+// abc
+
+let y;
+
+// whitespace above again
+
+while (true) {
+ while (true) {
+ }
+
+ // whitespace above
+}
+
+// whitespace above again
+
+`);
diff --git a/tests/cases/fourslash/formatSelectionWithTrivia2.ts b/tests/cases/fourslash/formatSelectionWithTrivia2.ts
new file mode 100644
index 00000000000..06b43009a22
--- /dev/null
+++ b/tests/cases/fourslash/formatSelectionWithTrivia2.ts
@@ -0,0 +1,10 @@
+///
+
+/////*begin*/;
+////
+/////*end*/
+////
+
+format.selection('begin', 'end');
+
+verify.currentFileContentIs(";\n\n\n ");
diff --git a/tests/cases/fourslash/formatTemplateLiteral.ts b/tests/cases/fourslash/formatTemplateLiteral.ts
index 68f2c8c9469..a10f8dba8f2 100644
--- a/tests/cases/fourslash/formatTemplateLiteral.ts
+++ b/tests/cases/fourslash/formatTemplateLiteral.ts
@@ -32,9 +32,9 @@ verify.currentLineContentIs("let w = `bar${3}`;");
goTo.marker("5");
verify.currentLineContentIs(" `template`;");
goTo.marker("6");
-verify.currentLineContentIs("String.raw `foo`;");
+verify.currentLineContentIs("String.raw`foo`;");
goTo.marker("7");
-verify.currentLineContentIs("String.raw `bar${3}`;");
+verify.currentLineContentIs("String.raw`bar${3}`;");
goTo.marker("spaceInside");
verify.currentLineContentIs('`Write ${JSON.stringify("")} and ${(765)} and ${346}`;');
\ No newline at end of file
diff --git a/tests/cases/fourslash/formattingInExpressionsInTsx.ts b/tests/cases/fourslash/formattingInExpressionsInTsx.ts
new file mode 100644
index 00000000000..f02a5a5b291
--- /dev/null
+++ b/tests/cases/fourslash/formattingInExpressionsInTsx.ts
@@ -0,0 +1,14 @@
+///
+
+// @Filename: test.tsx
+////import * as React from "react";
+////
+////
+
+goTo.marker("1");
+edit.insert(";");
+verify.currentLineContentIs(" return true;");
\ No newline at end of file
diff --git a/tests/cases/fourslash/formattingOptionsChange.ts b/tests/cases/fourslash/formattingOptionsChange.ts
index cdd8f61a215..a9c49d72507 100644
--- a/tests/cases/fourslash/formattingOptionsChange.ts
+++ b/tests/cases/fourslash/formattingOptionsChange.ts
@@ -6,7 +6,8 @@
/////*InsertSpaceAfterKeywordsInControlFlowStatements*/if (true) { }
/////*InsertSpaceAfterFunctionKeywordForAnonymousFunctions*/(function () { })
/////*InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis*/(1 )
-/////*InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets*/[1 ]; [ ]; []; [,]
+/////*InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets*/[1 ]; [ ]; []; [,];
+/////*InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces*/`${1}`;`${ 1 }`
/////*PlaceOpenBraceOnNewLineForFunctions*/class foo {
////}
/////*PlaceOpenBraceOnNewLineForControlBlocks*/if (true) {
@@ -18,7 +19,8 @@ runTest("InsertSpaceBeforeAndAfterBinaryOperators", "1 + 2 - 3", "1+2-3");
runTest("InsertSpaceAfterKeywordsInControlFlowStatements", "if (true) { }", "if(true) { }");
runTest("InsertSpaceAfterFunctionKeywordForAnonymousFunctions", "(function () { })", "(function() { })");
runTest("InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis", " ( 1 )", " (1)");
-runTest("InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets", "[ 1 ];[];[];[ , ]", "[1];[];[];[, ]");
+runTest("InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets", "[ 1 ];[];[];[ , ];", "[1];[];[];[, ];");
+runTest("InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces", "`${ 1 }`; `${ 1 }`", "`${1}`; `${1}`");
runTest("PlaceOpenBraceOnNewLineForFunctions", "class foo", "class foo {");
runTest("PlaceOpenBraceOnNewLineForControlBlocks", "if ( true )", "if ( true ) {");
diff --git a/tests/cases/fourslash/formattingTemplates.ts b/tests/cases/fourslash/formattingTemplates.ts
index c7decd10316..c759376335d 100644
--- a/tests/cases/fourslash/formattingTemplates.ts
+++ b/tests/cases/fourslash/formattingTemplates.ts
@@ -5,8 +5,8 @@
goTo.marker("1");
edit.insert(";");
-verify.currentLineContentIs("String.call `${123}`;");
+verify.currentLineContentIs("String.call`${123}`;");
goTo.marker("2");
edit.insert(";");
-verify.currentLineContentIs("String.call `${123} ${456}`;");
\ No newline at end of file
+verify.currentLineContentIs("String.call`${123} ${456}`;");
\ No newline at end of file
diff --git a/tests/cases/fourslash/fourslash.ts b/tests/cases/fourslash/fourslash.ts
index dd443e942cf..0e83189dd8e 100644
--- a/tests/cases/fourslash/fourslash.ts
+++ b/tests/cases/fourslash/fourslash.ts
@@ -81,6 +81,7 @@ declare namespace FourSlashInterface {
InsertSpaceAfterFunctionKeywordForAnonymousFunctions: boolean;
InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: boolean;
InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets: boolean;
+ InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces: boolean;
PlaceOpenBraceOnNewLineForFunctions: boolean;
PlaceOpenBraceOnNewLineForControlBlocks: boolean;
[s: string]: boolean | number | string;
diff --git a/tests/cases/unittests/moduleResolution.ts b/tests/cases/unittests/moduleResolution.ts
index 5b924650401..81d7c5f8b2e 100644
--- a/tests/cases/unittests/moduleResolution.ts
+++ b/tests/cases/unittests/moduleResolution.ts
@@ -26,15 +26,36 @@ module ts {
content?: string
}
- function createModuleResolutionHost(...files: File[]): ModuleResolutionHost {
+ function createModuleResolutionHost(hasDirectoryExists: boolean, ...files: File[]): ModuleResolutionHost {
let map = arrayToMap(files, f => f.name);
- return { fileExists, readFile };
-
- function fileExists(path: string): boolean {
- return hasProperty(map, path);
+ if (hasDirectoryExists) {
+ const directories: Map = {};
+ for (const f of files) {
+ let name = getDirectoryPath(f.name);
+ while (true) {
+ directories[name] = name;
+ let baseName = getDirectoryPath(name);
+ if (baseName === name) {
+ break;
+ }
+ name = baseName;
+ }
+ }
+ return {
+ readFile,
+ directoryExists: path => {
+ return hasProperty(directories, path);
+ },
+ fileExists: path => {
+ assert.isTrue(hasProperty(directories, getDirectoryPath(path)), "'fileExists' request in non-existing directory");
+ return hasProperty(map, path);
+ }
+ }
+ }
+ else {
+ return { readFile, fileExists: path => hasProperty(map, path), };
}
-
function readFile(path: string): string {
return hasProperty(map, path) ? map[path].content : undefined;
}
@@ -51,9 +72,14 @@ module ts {
function testLoadAsFile(containingFileName: string, moduleFileNameNoExt: string, moduleName: string): void {
for (let ext of supportedTypeScriptExtensions) {
+ test(ext, /*hasDirectoryExists*/ false);
+ test(ext, /*hasDirectoryExists*/ true);
+ }
+
+ function test(ext: string, hasDirectoryExists: boolean) {
let containingFile = { name: containingFileName }
let moduleFile = { name: moduleFileNameNoExt + ext }
- let resolution = nodeModuleNameResolver(moduleName, containingFile.name, {}, createModuleResolutionHost(containingFile, moduleFile));
+ let resolution = nodeModuleNameResolver(moduleName, containingFile.name, {}, createModuleResolutionHost(hasDirectoryExists, containingFile, moduleFile));
assert.equal(resolution.resolvedModule.resolvedFileName, moduleFile.name);
assert.equal(!!resolution.resolvedModule.isExternalLibraryImport, false);
@@ -69,6 +95,7 @@ module ts {
}
assert.deepEqual(resolution.failedLookupLocations, failedLookupLocations);
+
}
}
@@ -89,14 +116,19 @@ module ts {
});
function testLoadingFromPackageJson(containingFileName: string, packageJsonFileName: string, fieldRef: string, moduleFileName: string, moduleName: string): void {
- let containingFile = { name: containingFileName };
- let packageJson = { name: packageJsonFileName, content: JSON.stringify({ "typings": fieldRef }) };
- let moduleFile = { name: moduleFileName };
- let resolution = nodeModuleNameResolver(moduleName, containingFile.name, {}, createModuleResolutionHost(containingFile, packageJson, moduleFile));
- assert.equal(resolution.resolvedModule.resolvedFileName, moduleFile.name);
- assert.equal(!!resolution.resolvedModule.isExternalLibraryImport, false);
- // expect three failed lookup location - attempt to load module as file with all supported extensions
- assert.equal(resolution.failedLookupLocations.length, supportedTypeScriptExtensions.length);
+ test(/*hasDirectoryExists*/ false);
+ test(/*hasDirectoryExists*/ true);
+
+ function test(hasDirectoryExists: boolean) {
+ let containingFile = { name: containingFileName };
+ let packageJson = { name: packageJsonFileName, content: JSON.stringify({ "typings": fieldRef }) };
+ let moduleFile = { name: moduleFileName };
+ let resolution = nodeModuleNameResolver(moduleName, containingFile.name, {}, createModuleResolutionHost(hasDirectoryExists, containingFile, packageJson, moduleFile));
+ assert.equal(resolution.resolvedModule.resolvedFileName, moduleFile.name);
+ assert.equal(!!resolution.resolvedModule.isExternalLibraryImport, false);
+ // expect three failed lookup location - attempt to load module as file with all supported extensions
+ assert.equal(resolution.failedLookupLocations.length, supportedTypeScriptExtensions.length);
+ }
}
it("module name as directory - load from 'typings'", () => {
@@ -107,16 +139,21 @@ module ts {
});
function testTypingsIgnored(typings: any): void {
- let containingFile = { name: "/a/b.ts" };
- let packageJson = { name: "/node_modules/b/package.json", content: JSON.stringify({ "typings": typings }) };
- let moduleFile = { name: "/a/b.d.ts" };
+ test(/*hasDirectoryExists*/ false);
+ test(/*hasDirectoryExists*/ true);
- let indexPath = "/node_modules/b/index.d.ts";
- let indexFile = { name: indexPath }
+ function test(hasDirectoryExists: boolean) {
+ let containingFile = { name: "/a/b.ts" };
+ let packageJson = { name: "/node_modules/b/package.json", content: JSON.stringify({ "typings": typings }) };
+ let moduleFile = { name: "/a/b.d.ts" };
- let resolution = nodeModuleNameResolver("b", containingFile.name, {}, createModuleResolutionHost(containingFile, packageJson, moduleFile, indexFile));
+ let indexPath = "/node_modules/b/index.d.ts";
+ let indexFile = { name: indexPath }
- assert.equal(resolution.resolvedModule.resolvedFileName, indexPath);
+ let resolution = nodeModuleNameResolver("b", containingFile.name, {}, createModuleResolutionHost(hasDirectoryExists, containingFile, packageJson, moduleFile, indexFile));
+
+ assert.equal(resolution.resolvedModule.resolvedFileName, indexPath);
+ }
}
it("module name as directory - handle invalid 'typings'", () => {
@@ -128,89 +165,110 @@ module ts {
});
it("module name as directory - load index.d.ts", () => {
- let containingFile = { name: "/a/b/c.ts" };
- let packageJson = { name: "/a/b/foo/package.json", content: JSON.stringify({ main: "/c/d" }) };
- let indexFile = { name: "/a/b/foo/index.d.ts" };
- let resolution = nodeModuleNameResolver("./foo", containingFile.name, {}, createModuleResolutionHost(containingFile, packageJson, indexFile));
- assert.equal(resolution.resolvedModule.resolvedFileName, indexFile.name);
- assert.equal(!!resolution.resolvedModule.isExternalLibraryImport, false);
- assert.deepEqual(resolution.failedLookupLocations, [
- "/a/b/foo.ts",
- "/a/b/foo.tsx",
- "/a/b/foo.d.ts",
- "/a/b/foo/index.ts",
- "/a/b/foo/index.tsx",
- ]);
+ test(/*hasDirectoryExists*/ false);
+ test(/*hasDirectoryExists*/ true);
+
+ function test(hasDirectoryExists: boolean) {
+ let containingFile = { name: "/a/b/c.ts" };
+ let packageJson = { name: "/a/b/foo/package.json", content: JSON.stringify({ main: "/c/d" }) };
+ let indexFile = { name: "/a/b/foo/index.d.ts" };
+ let resolution = nodeModuleNameResolver("./foo", containingFile.name, {}, createModuleResolutionHost(hasDirectoryExists, containingFile, packageJson, indexFile));
+ assert.equal(resolution.resolvedModule.resolvedFileName, indexFile.name);
+ assert.equal(!!resolution.resolvedModule.isExternalLibraryImport, false);
+ assert.deepEqual(resolution.failedLookupLocations, [
+ "/a/b/foo.ts",
+ "/a/b/foo.tsx",
+ "/a/b/foo.d.ts",
+ "/a/b/foo/index.ts",
+ "/a/b/foo/index.tsx",
+ ]);
+ }
});
});
describe("Node module resolution - non-relative paths", () => {
it("load module as file - ts files not loaded", () => {
- let containingFile = { name: "/a/b/c/d/e.ts" };
- let moduleFile = { name: "/a/b/node_modules/foo.ts" };
- let resolution = nodeModuleNameResolver("foo", containingFile.name, {}, createModuleResolutionHost(containingFile, moduleFile));
- assert.equal(resolution.resolvedModule.resolvedFileName, moduleFile.name);
- assert.deepEqual(resolution.failedLookupLocations, [
- "/a/b/c/d/node_modules/foo.ts",
- "/a/b/c/d/node_modules/foo.tsx",
- "/a/b/c/d/node_modules/foo.d.ts",
- "/a/b/c/d/node_modules/foo/package.json",
- "/a/b/c/d/node_modules/foo/index.ts",
- "/a/b/c/d/node_modules/foo/index.tsx",
- "/a/b/c/d/node_modules/foo/index.d.ts",
- "/a/b/c/node_modules/foo.ts",
- "/a/b/c/node_modules/foo.tsx",
- "/a/b/c/node_modules/foo.d.ts",
- "/a/b/c/node_modules/foo/package.json",
- "/a/b/c/node_modules/foo/index.ts",
- "/a/b/c/node_modules/foo/index.tsx",
- "/a/b/c/node_modules/foo/index.d.ts",
- ])
+ test(/*hasDirectoryExists*/ false);
+ test(/*hasDirectoryExists*/ true);
+
+ function test(hasDirectoryExists: boolean) {
+ let containingFile = { name: "/a/b/c/d/e.ts" };
+ let moduleFile = { name: "/a/b/node_modules/foo.ts" };
+ let resolution = nodeModuleNameResolver("foo", containingFile.name, {}, createModuleResolutionHost(hasDirectoryExists, containingFile, moduleFile));
+ assert.equal(resolution.resolvedModule.resolvedFileName, moduleFile.name);
+ assert.deepEqual(resolution.failedLookupLocations, [
+ "/a/b/c/d/node_modules/foo.ts",
+ "/a/b/c/d/node_modules/foo.tsx",
+ "/a/b/c/d/node_modules/foo.d.ts",
+ "/a/b/c/d/node_modules/foo/package.json",
+ "/a/b/c/d/node_modules/foo/index.ts",
+ "/a/b/c/d/node_modules/foo/index.tsx",
+ "/a/b/c/d/node_modules/foo/index.d.ts",
+ "/a/b/c/node_modules/foo.ts",
+ "/a/b/c/node_modules/foo.tsx",
+ "/a/b/c/node_modules/foo.d.ts",
+ "/a/b/c/node_modules/foo/package.json",
+ "/a/b/c/node_modules/foo/index.ts",
+ "/a/b/c/node_modules/foo/index.tsx",
+ "/a/b/c/node_modules/foo/index.d.ts",
+ ])
+ }
});
it("load module as file", () => {
- let containingFile = { name: "/a/b/c/d/e.ts" };
- let moduleFile = { name: "/a/b/node_modules/foo.d.ts" };
- let resolution = nodeModuleNameResolver("foo", containingFile.name, {}, createModuleResolutionHost(containingFile, moduleFile));
- assert.equal(resolution.resolvedModule.resolvedFileName, moduleFile.name);
- assert.equal(resolution.resolvedModule.isExternalLibraryImport, true);
+ test(/*hasDirectoryExists*/ false);
+ test(/*hasDirectoryExists*/ true);
+
+ function test(hasDirectoryExists: boolean) {
+ let containingFile = { name: "/a/b/c/d/e.ts" };
+ let moduleFile = { name: "/a/b/node_modules/foo.d.ts" };
+ let resolution = nodeModuleNameResolver("foo", containingFile.name, {}, createModuleResolutionHost(hasDirectoryExists, containingFile, moduleFile));
+ assert.equal(resolution.resolvedModule.resolvedFileName, moduleFile.name);
+ assert.equal(resolution.resolvedModule.isExternalLibraryImport, true);
+ }
});
it("load module as directory", () => {
- let containingFile = { name: "/a/node_modules/b/c/node_modules/d/e.ts" };
- let moduleFile = { name: "/a/node_modules/foo/index.d.ts" };
- let resolution = nodeModuleNameResolver("foo", containingFile.name, {}, createModuleResolutionHost(containingFile, moduleFile));
- assert.equal(resolution.resolvedModule.resolvedFileName, moduleFile.name);
- assert.equal(resolution.resolvedModule.isExternalLibraryImport, true);
- assert.deepEqual(resolution.failedLookupLocations, [
- "/a/node_modules/b/c/node_modules/d/node_modules/foo.ts",
- "/a/node_modules/b/c/node_modules/d/node_modules/foo.tsx",
- "/a/node_modules/b/c/node_modules/d/node_modules/foo.d.ts",
- "/a/node_modules/b/c/node_modules/d/node_modules/foo/package.json",
- "/a/node_modules/b/c/node_modules/d/node_modules/foo/index.ts",
- "/a/node_modules/b/c/node_modules/d/node_modules/foo/index.tsx",
- "/a/node_modules/b/c/node_modules/d/node_modules/foo/index.d.ts",
- "/a/node_modules/b/c/node_modules/foo.ts",
- "/a/node_modules/b/c/node_modules/foo.tsx",
- "/a/node_modules/b/c/node_modules/foo.d.ts",
- "/a/node_modules/b/c/node_modules/foo/package.json",
- "/a/node_modules/b/c/node_modules/foo/index.ts",
- "/a/node_modules/b/c/node_modules/foo/index.tsx",
- "/a/node_modules/b/c/node_modules/foo/index.d.ts",
- "/a/node_modules/b/node_modules/foo.ts",
- "/a/node_modules/b/node_modules/foo.tsx",
- "/a/node_modules/b/node_modules/foo.d.ts",
- "/a/node_modules/b/node_modules/foo/package.json",
- "/a/node_modules/b/node_modules/foo/index.ts",
- "/a/node_modules/b/node_modules/foo/index.tsx",
- "/a/node_modules/b/node_modules/foo/index.d.ts",
- "/a/node_modules/foo.ts",
- "/a/node_modules/foo.tsx",
- "/a/node_modules/foo.d.ts",
- "/a/node_modules/foo/package.json",
- "/a/node_modules/foo/index.ts",
- "/a/node_modules/foo/index.tsx"
- ]);
+ test(/*hasDirectoryExists*/ false);
+ test(/*hasDirectoryExists*/ true);
+
+ function test(hasDirectoryExists: boolean) {
+ let containingFile = { name: "/a/node_modules/b/c/node_modules/d/e.ts" };
+ let moduleFile = { name: "/a/node_modules/foo/index.d.ts" };
+ let resolution = nodeModuleNameResolver("foo", containingFile.name, {}, createModuleResolutionHost(hasDirectoryExists, containingFile, moduleFile));
+ assert.equal(resolution.resolvedModule.resolvedFileName, moduleFile.name);
+ assert.equal(resolution.resolvedModule.isExternalLibraryImport, true);
+ assert.deepEqual(resolution.failedLookupLocations, [
+ "/a/node_modules/b/c/node_modules/d/node_modules/foo.ts",
+ "/a/node_modules/b/c/node_modules/d/node_modules/foo.tsx",
+ "/a/node_modules/b/c/node_modules/d/node_modules/foo.d.ts",
+ "/a/node_modules/b/c/node_modules/d/node_modules/foo/package.json",
+ "/a/node_modules/b/c/node_modules/d/node_modules/foo/index.ts",
+ "/a/node_modules/b/c/node_modules/d/node_modules/foo/index.tsx",
+ "/a/node_modules/b/c/node_modules/d/node_modules/foo/index.d.ts",
+ "/a/node_modules/b/c/node_modules/foo.ts",
+ "/a/node_modules/b/c/node_modules/foo.tsx",
+ "/a/node_modules/b/c/node_modules/foo.d.ts",
+ "/a/node_modules/b/c/node_modules/foo/package.json",
+ "/a/node_modules/b/c/node_modules/foo/index.ts",
+ "/a/node_modules/b/c/node_modules/foo/index.tsx",
+ "/a/node_modules/b/c/node_modules/foo/index.d.ts",
+ "/a/node_modules/b/node_modules/foo.ts",
+ "/a/node_modules/b/node_modules/foo.tsx",
+ "/a/node_modules/b/node_modules/foo.d.ts",
+ "/a/node_modules/b/node_modules/foo/package.json",
+ "/a/node_modules/b/node_modules/foo/index.ts",
+ "/a/node_modules/b/node_modules/foo/index.tsx",
+ "/a/node_modules/b/node_modules/foo/index.d.ts",
+ "/a/node_modules/foo.ts",
+ "/a/node_modules/foo.tsx",
+ "/a/node_modules/foo.d.ts",
+ "/a/node_modules/foo/package.json",
+ "/a/node_modules/foo/index.ts",
+ "/a/node_modules/foo/index.tsx"
+ ]);
+
+ }
});
});
@@ -400,4 +458,21 @@ import b = require("./moduleB.ts");
test(files, { module: ts.ModuleKind.CommonJS, forceConsistentCasingInFileNames: true }, "/a/B/c", /* useCaseSensitiveFileNames */ false, ["moduleD.ts"], []);
})
});
+
+ function notImplemented(name: string): () => any {
+ return () => assert(`${name} is not implemented and should not be called`);
+ }
+
+ describe("ModuleResolutionHost.directoryExists", () => {
+ it("No 'fileExists' calls if containing directory is missing", () => {
+ const host: ModuleResolutionHost = {
+ readFile: notImplemented("readFile"),
+ fileExists: notImplemented("fileExists"),
+ directoryExists: _ => false
+ };
+
+ const result = resolveModuleName("someName", "/a/b/c/d", { moduleResolution: ModuleResolutionKind.NodeJs }, host);
+ assert(!result.resolvedModule);
+ });
+ });
}
\ No newline at end of file
diff --git a/tslint.json b/tslint.json
index 71efb21ad7b..2d2e42d4383 100644
--- a/tslint.json
+++ b/tslint.json
@@ -42,6 +42,7 @@
"boolean-trivia": true,
"type-operator-spacing": true,
"prefer-const": true,
- "no-in-operator": true
+ "no-in-operator": true,
+ "no-increment-decrement": true
}
}