mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-18 16:34:36 -05:00
Merge branch 'master' into this-function-types
This commit is contained in:
@@ -1,12 +1,9 @@
|
||||
tests/cases/compiler/ExportAssignment7.ts(1,14): error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
tests/cases/compiler/ExportAssignment7.ts(4,1): error TS2309: An export assignment cannot be used in a module with other exported elements.
|
||||
tests/cases/compiler/ExportAssignment7.ts(4,10): error TS2304: Cannot find name 'B'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/ExportAssignment7.ts (3 errors) ====
|
||||
==== tests/cases/compiler/ExportAssignment7.ts (2 errors) ====
|
||||
export class C {
|
||||
~
|
||||
!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
}
|
||||
|
||||
export = B;
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
tests/cases/compiler/ExportAssignment8.ts(1,1): error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
tests/cases/compiler/ExportAssignment8.ts(1,1): error TS2309: An export assignment cannot be used in a module with other exported elements.
|
||||
tests/cases/compiler/ExportAssignment8.ts(1,10): error TS2304: Cannot find name 'B'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/ExportAssignment8.ts (3 errors) ====
|
||||
==== tests/cases/compiler/ExportAssignment8.ts (2 errors) ====
|
||||
export = B;
|
||||
~~~~~~~~~~~
|
||||
!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
~~~~~~~~~~~
|
||||
!!! error TS2309: An export assignment cannot be used in a module with other exported elements.
|
||||
~
|
||||
!!! error TS2304: Cannot find name 'B'.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
tests/cases/conformance/parser/ecmascript5/Protected/Protected1.ts(1,1): error TS1044: 'protected' modifier cannot appear on a module element.
|
||||
tests/cases/conformance/parser/ecmascript5/Protected/Protected1.ts(1,1): error TS1044: 'protected' modifier cannot appear on a module or namespace element.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript5/Protected/Protected1.ts (1 errors) ====
|
||||
protected class C {
|
||||
~~~~~~~~~
|
||||
!!! error TS1044: 'protected' modifier cannot appear on a module element.
|
||||
!!! error TS1044: 'protected' modifier cannot appear on a module or namespace element.
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
tests/cases/conformance/parser/ecmascript5/Protected/Protected2.ts(1,1): error TS1044: 'protected' modifier cannot appear on a module element.
|
||||
tests/cases/conformance/parser/ecmascript5/Protected/Protected2.ts(1,1): error TS1044: 'protected' modifier cannot appear on a module or namespace element.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript5/Protected/Protected2.ts (1 errors) ====
|
||||
protected module M {
|
||||
~~~~~~~~~
|
||||
!!! error TS1044: 'protected' modifier cannot appear on a module element.
|
||||
!!! error TS1044: 'protected' modifier cannot appear on a module or namespace element.
|
||||
}
|
||||
@@ -1,13 +1,10 @@
|
||||
tests/cases/conformance/internalModules/DeclarationMerging/part1.ts(1,15): error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
tests/cases/conformance/internalModules/DeclarationMerging/part2.ts(3,24): error TS2304: Cannot find name 'Point'.
|
||||
tests/cases/conformance/internalModules/DeclarationMerging/part2.ts(7,36): error TS2304: Cannot find name 'Point'.
|
||||
tests/cases/conformance/internalModules/DeclarationMerging/part2.ts(7,54): error TS2304: Cannot find name 'Point'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/internalModules/DeclarationMerging/part1.ts (1 errors) ====
|
||||
==== tests/cases/conformance/internalModules/DeclarationMerging/part1.ts (0 errors) ====
|
||||
export module A {
|
||||
~
|
||||
!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
export interface Point {
|
||||
x: number;
|
||||
y: number;
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
tests/cases/conformance/ambient/consumer.ts(2,1): error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
|
||||
|
||||
==== tests/cases/conformance/ambient/consumer.ts (1 errors) ====
|
||||
/// <reference path="decls.ts" />
|
||||
import imp1 = require('equ');
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
|
||||
|
||||
// Ambient external module members are always exported with or without export keyword when module lacks export assignment
|
||||
import imp3 = require('equ2');
|
||||
var n = imp3.x;
|
||||
var n: number;
|
||||
|
||||
==== tests/cases/conformance/ambient/decls.ts (0 errors) ====
|
||||
|
||||
// Ambient external module with export assignment
|
||||
declare module 'equ' {
|
||||
var x;
|
||||
export = x;
|
||||
}
|
||||
|
||||
declare module 'equ2' {
|
||||
var x: number;
|
||||
}
|
||||
|
||||
// Ambient external import declaration referencing ambient external module using top level module name
|
||||
@@ -0,0 +1,36 @@
|
||||
=== tests/cases/conformance/ambient/consumer.ts ===
|
||||
/// <reference path="decls.ts" />
|
||||
import imp1 = require('equ');
|
||||
>imp1 : Symbol(imp1, Decl(consumer.ts, 0, 0))
|
||||
|
||||
|
||||
// Ambient external module members are always exported with or without export keyword when module lacks export assignment
|
||||
import imp3 = require('equ2');
|
||||
>imp3 : Symbol(imp3, Decl(consumer.ts, 1, 29))
|
||||
|
||||
var n = imp3.x;
|
||||
>n : Symbol(n, Decl(consumer.ts, 6, 3), Decl(consumer.ts, 7, 3))
|
||||
>imp3.x : Symbol(imp3.x, Decl(decls.ts, 8, 7))
|
||||
>imp3 : Symbol(imp3, Decl(consumer.ts, 1, 29))
|
||||
>x : Symbol(imp3.x, Decl(decls.ts, 8, 7))
|
||||
|
||||
var n: number;
|
||||
>n : Symbol(n, Decl(consumer.ts, 6, 3), Decl(consumer.ts, 7, 3))
|
||||
|
||||
=== tests/cases/conformance/ambient/decls.ts ===
|
||||
|
||||
// Ambient external module with export assignment
|
||||
declare module 'equ' {
|
||||
var x;
|
||||
>x : Symbol(x, Decl(decls.ts, 3, 7))
|
||||
|
||||
export = x;
|
||||
>x : Symbol(x, Decl(decls.ts, 3, 7))
|
||||
}
|
||||
|
||||
declare module 'equ2' {
|
||||
var x: number;
|
||||
>x : Symbol(x, Decl(decls.ts, 8, 7))
|
||||
}
|
||||
|
||||
// Ambient external import declaration referencing ambient external module using top level module name
|
||||
36
tests/baselines/reference/ambientDeclarationsExternal.types
Normal file
36
tests/baselines/reference/ambientDeclarationsExternal.types
Normal file
@@ -0,0 +1,36 @@
|
||||
=== tests/cases/conformance/ambient/consumer.ts ===
|
||||
/// <reference path="decls.ts" />
|
||||
import imp1 = require('equ');
|
||||
>imp1 : any
|
||||
|
||||
|
||||
// Ambient external module members are always exported with or without export keyword when module lacks export assignment
|
||||
import imp3 = require('equ2');
|
||||
>imp3 : typeof imp3
|
||||
|
||||
var n = imp3.x;
|
||||
>n : number
|
||||
>imp3.x : number
|
||||
>imp3 : typeof imp3
|
||||
>x : number
|
||||
|
||||
var n: number;
|
||||
>n : number
|
||||
|
||||
=== tests/cases/conformance/ambient/decls.ts ===
|
||||
|
||||
// Ambient external module with export assignment
|
||||
declare module 'equ' {
|
||||
var x;
|
||||
>x : any
|
||||
|
||||
export = x;
|
||||
>x : any
|
||||
}
|
||||
|
||||
declare module 'equ2' {
|
||||
var x: number;
|
||||
>x : number
|
||||
}
|
||||
|
||||
// Ambient external import declaration referencing ambient external module using top level module name
|
||||
@@ -4,7 +4,7 @@ var obj: Object;
|
||||
>Object : Object
|
||||
|
||||
if (ArrayBuffer.isView(obj)) {
|
||||
>ArrayBuffer.isView(obj) : arg is ArrayBufferView
|
||||
>ArrayBuffer.isView(obj) : boolean
|
||||
>ArrayBuffer.isView : (arg: any) => arg is ArrayBufferView
|
||||
>ArrayBuffer : ArrayBufferConstructor
|
||||
>isView : (arg: any) => arg is ArrayBufferView
|
||||
|
||||
@@ -3,21 +3,21 @@ var a: string[] = [];
|
||||
>a : Symbol(a, Decl(arrayConcat2.ts, 0, 3))
|
||||
|
||||
a.concat("hello", 'world');
|
||||
>a.concat : Symbol(Array.concat, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>a.concat : Symbol(Array.concat, Decl(lib.d.ts, --, --))
|
||||
>a : Symbol(a, Decl(arrayConcat2.ts, 0, 3))
|
||||
>concat : Symbol(Array.concat, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>concat : Symbol(Array.concat, Decl(lib.d.ts, --, --))
|
||||
|
||||
a.concat('Hello');
|
||||
>a.concat : Symbol(Array.concat, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>a.concat : Symbol(Array.concat, Decl(lib.d.ts, --, --))
|
||||
>a : Symbol(a, Decl(arrayConcat2.ts, 0, 3))
|
||||
>concat : Symbol(Array.concat, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>concat : Symbol(Array.concat, Decl(lib.d.ts, --, --))
|
||||
|
||||
var b = new Array<string>();
|
||||
>b : Symbol(b, Decl(arrayConcat2.ts, 5, 3))
|
||||
>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
|
||||
b.concat('hello');
|
||||
>b.concat : Symbol(Array.concat, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>b.concat : Symbol(Array.concat, Decl(lib.d.ts, --, --))
|
||||
>b : Symbol(b, Decl(arrayConcat2.ts, 5, 3))
|
||||
>concat : Symbol(Array.concat, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>concat : Symbol(Array.concat, Decl(lib.d.ts, --, --))
|
||||
|
||||
|
||||
@@ -5,17 +5,17 @@ var a: string[] = [];
|
||||
|
||||
a.concat("hello", 'world');
|
||||
>a.concat("hello", 'world') : string[]
|
||||
>a.concat : { <U extends string[]>(...items: U[]): string[]; (...items: string[]): string[]; }
|
||||
>a.concat : (...items: (string | string[])[]) => string[]
|
||||
>a : string[]
|
||||
>concat : { <U extends string[]>(...items: U[]): string[]; (...items: string[]): string[]; }
|
||||
>concat : (...items: (string | string[])[]) => string[]
|
||||
>"hello" : string
|
||||
>'world' : string
|
||||
|
||||
a.concat('Hello');
|
||||
>a.concat('Hello') : string[]
|
||||
>a.concat : { <U extends string[]>(...items: U[]): string[]; (...items: string[]): string[]; }
|
||||
>a.concat : (...items: (string | string[])[]) => string[]
|
||||
>a : string[]
|
||||
>concat : { <U extends string[]>(...items: U[]): string[]; (...items: string[]): string[]; }
|
||||
>concat : (...items: (string | string[])[]) => string[]
|
||||
>'Hello' : string
|
||||
|
||||
var b = new Array<string>();
|
||||
@@ -25,8 +25,8 @@ var b = new Array<string>();
|
||||
|
||||
b.concat('hello');
|
||||
>b.concat('hello') : string[]
|
||||
>b.concat : { <U extends string[]>(...items: U[]): string[]; (...items: string[]): string[]; }
|
||||
>b.concat : (...items: (string | string[])[]) => string[]
|
||||
>b : string[]
|
||||
>concat : { <U extends string[]>(...items: U[]): string[]; (...items: string[]): string[]; }
|
||||
>concat : (...items: (string | string[])[]) => string[]
|
||||
>'hello' : string
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
var x = [].concat([{ a: 1 }], [{ a: 2 }])
|
||||
>x : Symbol(x, Decl(arrayConcatMap.ts, 0, 3))
|
||||
>[].concat([{ a: 1 }], [{ a: 2 }]) .map : Symbol(Array.map, Decl(lib.d.ts, --, --))
|
||||
>[].concat : Symbol(Array.concat, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>concat : Symbol(Array.concat, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>[].concat : Symbol(Array.concat, Decl(lib.d.ts, --, --))
|
||||
>concat : Symbol(Array.concat, Decl(lib.d.ts, --, --))
|
||||
>a : Symbol(a, Decl(arrayConcatMap.ts, 0, 20))
|
||||
>a : Symbol(a, Decl(arrayConcatMap.ts, 0, 32))
|
||||
|
||||
|
||||
@@ -4,9 +4,9 @@ var x = [].concat([{ a: 1 }], [{ a: 2 }])
|
||||
>[].concat([{ a: 1 }], [{ a: 2 }]) .map(b => b.a) : any[]
|
||||
>[].concat([{ a: 1 }], [{ a: 2 }]) .map : <U>(callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any) => U[]
|
||||
>[].concat([{ a: 1 }], [{ a: 2 }]) : any[]
|
||||
>[].concat : { <U extends any[]>(...items: U[]): any[]; (...items: any[]): any[]; }
|
||||
>[].concat : (...items: any[]) => any[]
|
||||
>[] : undefined[]
|
||||
>concat : { <U extends any[]>(...items: U[]): any[]; (...items: any[]): any[]; }
|
||||
>concat : (...items: any[]) => any[]
|
||||
>[{ a: 1 }] : { a: number; }[]
|
||||
>{ a: 1 } : { a: number; }
|
||||
>a : number
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
//// [blockScopedBindingsReassignedInLoop1.ts]
|
||||
declare function use(n: number): void;
|
||||
(function () {
|
||||
'use strict'
|
||||
for (let i = 0; i < 9; ++i) {
|
||||
(() => use(++i))();
|
||||
}
|
||||
})();
|
||||
|
||||
//// [blockScopedBindingsReassignedInLoop1.js]
|
||||
(function () {
|
||||
'use strict';
|
||||
var _loop_1 = function(i) {
|
||||
(function () { return use(++i); })();
|
||||
out_i_1 = i;
|
||||
};
|
||||
var out_i_1;
|
||||
for (var i = 0; i < 9; ++i) {
|
||||
_loop_1(i);
|
||||
i = out_i_1;
|
||||
}
|
||||
})();
|
||||
@@ -0,0 +1,17 @@
|
||||
=== tests/cases/compiler/blockScopedBindingsReassignedInLoop1.ts ===
|
||||
declare function use(n: number): void;
|
||||
>use : Symbol(use, Decl(blockScopedBindingsReassignedInLoop1.ts, 0, 0))
|
||||
>n : Symbol(n, Decl(blockScopedBindingsReassignedInLoop1.ts, 0, 21))
|
||||
|
||||
(function () {
|
||||
'use strict'
|
||||
for (let i = 0; i < 9; ++i) {
|
||||
>i : Symbol(i, Decl(blockScopedBindingsReassignedInLoop1.ts, 3, 10))
|
||||
>i : Symbol(i, Decl(blockScopedBindingsReassignedInLoop1.ts, 3, 10))
|
||||
>i : Symbol(i, Decl(blockScopedBindingsReassignedInLoop1.ts, 3, 10))
|
||||
|
||||
(() => use(++i))();
|
||||
>use : Symbol(use, Decl(blockScopedBindingsReassignedInLoop1.ts, 0, 0))
|
||||
>i : Symbol(i, Decl(blockScopedBindingsReassignedInLoop1.ts, 3, 10))
|
||||
}
|
||||
})();
|
||||
@@ -0,0 +1,32 @@
|
||||
=== tests/cases/compiler/blockScopedBindingsReassignedInLoop1.ts ===
|
||||
declare function use(n: number): void;
|
||||
>use : (n: number) => void
|
||||
>n : number
|
||||
|
||||
(function () {
|
||||
>(function () { 'use strict' for (let i = 0; i < 9; ++i) { (() => use(++i))(); }})() : void
|
||||
>(function () { 'use strict' for (let i = 0; i < 9; ++i) { (() => use(++i))(); }}) : () => void
|
||||
>function () { 'use strict' for (let i = 0; i < 9; ++i) { (() => use(++i))(); }} : () => void
|
||||
|
||||
'use strict'
|
||||
>'use strict' : string
|
||||
|
||||
for (let i = 0; i < 9; ++i) {
|
||||
>i : number
|
||||
>0 : number
|
||||
>i < 9 : boolean
|
||||
>i : number
|
||||
>9 : number
|
||||
>++i : number
|
||||
>i : number
|
||||
|
||||
(() => use(++i))();
|
||||
>(() => use(++i))() : void
|
||||
>(() => use(++i)) : () => void
|
||||
>() => use(++i) : () => void
|
||||
>use(++i) : void
|
||||
>use : (n: number) => void
|
||||
>++i : number
|
||||
>i : number
|
||||
}
|
||||
})();
|
||||
@@ -0,0 +1,120 @@
|
||||
//// [blockScopedBindingsReassignedInLoop2.ts]
|
||||
for (let x = 1, y = 2; x < y; ++x, --y) {
|
||||
let a = () => x++ + y++;
|
||||
if (x == 1) {
|
||||
break;
|
||||
}
|
||||
else {
|
||||
y = 5;
|
||||
}
|
||||
}
|
||||
|
||||
for (let x = 1, y = 2; x < y; ++x, --y) {
|
||||
let a = () => x++ + y++;
|
||||
if (x == 1) {
|
||||
continue;
|
||||
}
|
||||
else {
|
||||
y = 5;
|
||||
}
|
||||
}
|
||||
|
||||
loop:
|
||||
for (let x = 1, y = 2; x < y; ++x, --y) {
|
||||
let a = () => x++ + y++;
|
||||
if (x == 1) {
|
||||
break loop;
|
||||
}
|
||||
else {
|
||||
y = 5;
|
||||
}
|
||||
}
|
||||
|
||||
loop:
|
||||
for (let x = 1, y = 2; x < y; ++x, --y) {
|
||||
let a = () => x++ + y++;
|
||||
if (x == 1) {
|
||||
continue loop;
|
||||
}
|
||||
else {
|
||||
y = 5;
|
||||
}
|
||||
}
|
||||
|
||||
//// [blockScopedBindingsReassignedInLoop2.js]
|
||||
var _loop_1 = function(x, y) {
|
||||
var a = function () { return x++ + y++; };
|
||||
if (x == 1) {
|
||||
return out_x_1 = x, out_y_1 = y, "break";
|
||||
}
|
||||
else {
|
||||
y = 5;
|
||||
}
|
||||
out_x_1 = x;
|
||||
out_y_1 = y;
|
||||
};
|
||||
var out_x_1, out_y_1;
|
||||
for (var x = 1, y = 2; x < y; ++x, --y) {
|
||||
var state_1 = _loop_1(x, y);
|
||||
x = out_x_1;
|
||||
y = out_y_1;
|
||||
if (state_1 === "break") break;
|
||||
}
|
||||
var _loop_2 = function(x, y) {
|
||||
var a = function () { return x++ + y++; };
|
||||
if (x == 1) {
|
||||
return out_x_2 = x, out_y_2 = y, "continue";
|
||||
}
|
||||
else {
|
||||
y = 5;
|
||||
}
|
||||
out_x_2 = x;
|
||||
out_y_2 = y;
|
||||
};
|
||||
var out_x_2, out_y_2;
|
||||
for (var x = 1, y = 2; x < y; ++x, --y) {
|
||||
var state_2 = _loop_2(x, y);
|
||||
x = out_x_2;
|
||||
y = out_y_2;
|
||||
if (state_2 === "continue") continue;
|
||||
}
|
||||
var _loop_3 = function(x, y) {
|
||||
var a = function () { return x++ + y++; };
|
||||
if (x == 1) {
|
||||
return out_x_3 = x, out_y_3 = y, "break-loop";
|
||||
}
|
||||
else {
|
||||
y = 5;
|
||||
}
|
||||
out_x_3 = x;
|
||||
out_y_3 = y;
|
||||
};
|
||||
var out_x_3, out_y_3;
|
||||
loop: for (var x = 1, y = 2; x < y; ++x, --y) {
|
||||
var state_3 = _loop_3(x, y);
|
||||
x = out_x_3;
|
||||
y = out_y_3;
|
||||
switch(state_3) {
|
||||
case "break-loop": break loop;
|
||||
}
|
||||
}
|
||||
var _loop_4 = function(x, y) {
|
||||
var a = function () { return x++ + y++; };
|
||||
if (x == 1) {
|
||||
return out_x_4 = x, out_y_4 = y, "continue-loop";
|
||||
}
|
||||
else {
|
||||
y = 5;
|
||||
}
|
||||
out_x_4 = x;
|
||||
out_y_4 = y;
|
||||
};
|
||||
var out_x_4, out_y_4;
|
||||
loop: for (var x = 1, y = 2; x < y; ++x, --y) {
|
||||
var state_4 = _loop_4(x, y);
|
||||
x = out_x_4;
|
||||
y = out_y_4;
|
||||
switch(state_4) {
|
||||
case "continue-loop": continue loop;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
=== tests/cases/compiler/blockScopedBindingsReassignedInLoop2.ts ===
|
||||
for (let x = 1, y = 2; x < y; ++x, --y) {
|
||||
>x : Symbol(x, Decl(blockScopedBindingsReassignedInLoop2.ts, 0, 8))
|
||||
>y : Symbol(y, Decl(blockScopedBindingsReassignedInLoop2.ts, 0, 15))
|
||||
>x : Symbol(x, Decl(blockScopedBindingsReassignedInLoop2.ts, 0, 8))
|
||||
>y : Symbol(y, Decl(blockScopedBindingsReassignedInLoop2.ts, 0, 15))
|
||||
>x : Symbol(x, Decl(blockScopedBindingsReassignedInLoop2.ts, 0, 8))
|
||||
>y : Symbol(y, Decl(blockScopedBindingsReassignedInLoop2.ts, 0, 15))
|
||||
|
||||
let a = () => x++ + y++;
|
||||
>a : Symbol(a, Decl(blockScopedBindingsReassignedInLoop2.ts, 1, 7))
|
||||
>x : Symbol(x, Decl(blockScopedBindingsReassignedInLoop2.ts, 0, 8))
|
||||
>y : Symbol(y, Decl(blockScopedBindingsReassignedInLoop2.ts, 0, 15))
|
||||
|
||||
if (x == 1) {
|
||||
>x : Symbol(x, Decl(blockScopedBindingsReassignedInLoop2.ts, 0, 8))
|
||||
|
||||
break;
|
||||
}
|
||||
else {
|
||||
y = 5;
|
||||
>y : Symbol(y, Decl(blockScopedBindingsReassignedInLoop2.ts, 0, 15))
|
||||
}
|
||||
}
|
||||
|
||||
for (let x = 1, y = 2; x < y; ++x, --y) {
|
||||
>x : Symbol(x, Decl(blockScopedBindingsReassignedInLoop2.ts, 10, 8))
|
||||
>y : Symbol(y, Decl(blockScopedBindingsReassignedInLoop2.ts, 10, 15))
|
||||
>x : Symbol(x, Decl(blockScopedBindingsReassignedInLoop2.ts, 10, 8))
|
||||
>y : Symbol(y, Decl(blockScopedBindingsReassignedInLoop2.ts, 10, 15))
|
||||
>x : Symbol(x, Decl(blockScopedBindingsReassignedInLoop2.ts, 10, 8))
|
||||
>y : Symbol(y, Decl(blockScopedBindingsReassignedInLoop2.ts, 10, 15))
|
||||
|
||||
let a = () => x++ + y++;
|
||||
>a : Symbol(a, Decl(blockScopedBindingsReassignedInLoop2.ts, 11, 7))
|
||||
>x : Symbol(x, Decl(blockScopedBindingsReassignedInLoop2.ts, 10, 8))
|
||||
>y : Symbol(y, Decl(blockScopedBindingsReassignedInLoop2.ts, 10, 15))
|
||||
|
||||
if (x == 1) {
|
||||
>x : Symbol(x, Decl(blockScopedBindingsReassignedInLoop2.ts, 10, 8))
|
||||
|
||||
continue;
|
||||
}
|
||||
else {
|
||||
y = 5;
|
||||
>y : Symbol(y, Decl(blockScopedBindingsReassignedInLoop2.ts, 10, 15))
|
||||
}
|
||||
}
|
||||
|
||||
loop:
|
||||
for (let x = 1, y = 2; x < y; ++x, --y) {
|
||||
>x : Symbol(x, Decl(blockScopedBindingsReassignedInLoop2.ts, 21, 8))
|
||||
>y : Symbol(y, Decl(blockScopedBindingsReassignedInLoop2.ts, 21, 15))
|
||||
>x : Symbol(x, Decl(blockScopedBindingsReassignedInLoop2.ts, 21, 8))
|
||||
>y : Symbol(y, Decl(blockScopedBindingsReassignedInLoop2.ts, 21, 15))
|
||||
>x : Symbol(x, Decl(blockScopedBindingsReassignedInLoop2.ts, 21, 8))
|
||||
>y : Symbol(y, Decl(blockScopedBindingsReassignedInLoop2.ts, 21, 15))
|
||||
|
||||
let a = () => x++ + y++;
|
||||
>a : Symbol(a, Decl(blockScopedBindingsReassignedInLoop2.ts, 22, 7))
|
||||
>x : Symbol(x, Decl(blockScopedBindingsReassignedInLoop2.ts, 21, 8))
|
||||
>y : Symbol(y, Decl(blockScopedBindingsReassignedInLoop2.ts, 21, 15))
|
||||
|
||||
if (x == 1) {
|
||||
>x : Symbol(x, Decl(blockScopedBindingsReassignedInLoop2.ts, 21, 8))
|
||||
|
||||
break loop;
|
||||
}
|
||||
else {
|
||||
y = 5;
|
||||
>y : Symbol(y, Decl(blockScopedBindingsReassignedInLoop2.ts, 21, 15))
|
||||
}
|
||||
}
|
||||
|
||||
loop:
|
||||
for (let x = 1, y = 2; x < y; ++x, --y) {
|
||||
>x : Symbol(x, Decl(blockScopedBindingsReassignedInLoop2.ts, 32, 8))
|
||||
>y : Symbol(y, Decl(blockScopedBindingsReassignedInLoop2.ts, 32, 15))
|
||||
>x : Symbol(x, Decl(blockScopedBindingsReassignedInLoop2.ts, 32, 8))
|
||||
>y : Symbol(y, Decl(blockScopedBindingsReassignedInLoop2.ts, 32, 15))
|
||||
>x : Symbol(x, Decl(blockScopedBindingsReassignedInLoop2.ts, 32, 8))
|
||||
>y : Symbol(y, Decl(blockScopedBindingsReassignedInLoop2.ts, 32, 15))
|
||||
|
||||
let a = () => x++ + y++;
|
||||
>a : Symbol(a, Decl(blockScopedBindingsReassignedInLoop2.ts, 33, 7))
|
||||
>x : Symbol(x, Decl(blockScopedBindingsReassignedInLoop2.ts, 32, 8))
|
||||
>y : Symbol(y, Decl(blockScopedBindingsReassignedInLoop2.ts, 32, 15))
|
||||
|
||||
if (x == 1) {
|
||||
>x : Symbol(x, Decl(blockScopedBindingsReassignedInLoop2.ts, 32, 8))
|
||||
|
||||
continue loop;
|
||||
}
|
||||
else {
|
||||
y = 5;
|
||||
>y : Symbol(y, Decl(blockScopedBindingsReassignedInLoop2.ts, 32, 15))
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,160 @@
|
||||
=== tests/cases/compiler/blockScopedBindingsReassignedInLoop2.ts ===
|
||||
for (let x = 1, y = 2; x < y; ++x, --y) {
|
||||
>x : number
|
||||
>1 : number
|
||||
>y : number
|
||||
>2 : number
|
||||
>x < y : boolean
|
||||
>x : number
|
||||
>y : number
|
||||
>++x, --y : number
|
||||
>++x : number
|
||||
>x : number
|
||||
>--y : number
|
||||
>y : number
|
||||
|
||||
let a = () => x++ + y++;
|
||||
>a : () => number
|
||||
>() => x++ + y++ : () => number
|
||||
>x++ + y++ : number
|
||||
>x++ : number
|
||||
>x : number
|
||||
>y++ : number
|
||||
>y : number
|
||||
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
|
||||
break;
|
||||
}
|
||||
else {
|
||||
y = 5;
|
||||
>y = 5 : number
|
||||
>y : number
|
||||
>5 : number
|
||||
}
|
||||
}
|
||||
|
||||
for (let x = 1, y = 2; x < y; ++x, --y) {
|
||||
>x : number
|
||||
>1 : number
|
||||
>y : number
|
||||
>2 : number
|
||||
>x < y : boolean
|
||||
>x : number
|
||||
>y : number
|
||||
>++x, --y : number
|
||||
>++x : number
|
||||
>x : number
|
||||
>--y : number
|
||||
>y : number
|
||||
|
||||
let a = () => x++ + y++;
|
||||
>a : () => number
|
||||
>() => x++ + y++ : () => number
|
||||
>x++ + y++ : number
|
||||
>x++ : number
|
||||
>x : number
|
||||
>y++ : number
|
||||
>y : number
|
||||
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
|
||||
continue;
|
||||
}
|
||||
else {
|
||||
y = 5;
|
||||
>y = 5 : number
|
||||
>y : number
|
||||
>5 : number
|
||||
}
|
||||
}
|
||||
|
||||
loop:
|
||||
>loop : any
|
||||
|
||||
for (let x = 1, y = 2; x < y; ++x, --y) {
|
||||
>x : number
|
||||
>1 : number
|
||||
>y : number
|
||||
>2 : number
|
||||
>x < y : boolean
|
||||
>x : number
|
||||
>y : number
|
||||
>++x, --y : number
|
||||
>++x : number
|
||||
>x : number
|
||||
>--y : number
|
||||
>y : number
|
||||
|
||||
let a = () => x++ + y++;
|
||||
>a : () => number
|
||||
>() => x++ + y++ : () => number
|
||||
>x++ + y++ : number
|
||||
>x++ : number
|
||||
>x : number
|
||||
>y++ : number
|
||||
>y : number
|
||||
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
|
||||
break loop;
|
||||
>loop : any
|
||||
}
|
||||
else {
|
||||
y = 5;
|
||||
>y = 5 : number
|
||||
>y : number
|
||||
>5 : number
|
||||
}
|
||||
}
|
||||
|
||||
loop:
|
||||
>loop : any
|
||||
|
||||
for (let x = 1, y = 2; x < y; ++x, --y) {
|
||||
>x : number
|
||||
>1 : number
|
||||
>y : number
|
||||
>2 : number
|
||||
>x < y : boolean
|
||||
>x : number
|
||||
>y : number
|
||||
>++x, --y : number
|
||||
>++x : number
|
||||
>x : number
|
||||
>--y : number
|
||||
>y : number
|
||||
|
||||
let a = () => x++ + y++;
|
||||
>a : () => number
|
||||
>() => x++ + y++ : () => number
|
||||
>x++ + y++ : number
|
||||
>x++ : number
|
||||
>x : number
|
||||
>y++ : number
|
||||
>y : number
|
||||
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
|
||||
continue loop;
|
||||
>loop : any
|
||||
}
|
||||
else {
|
||||
y = 5;
|
||||
>y = 5 : number
|
||||
>y : number
|
||||
>5 : number
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,247 @@
|
||||
//// [blockScopedBindingsReassignedInLoop3.ts]
|
||||
|
||||
for (let x = 1, y = 2; x < y; ++x, --y) {
|
||||
let a = () => x++ + y++;
|
||||
if (x == 1) {
|
||||
break;
|
||||
}
|
||||
else {
|
||||
for (let a = 1; a < 5; --a) {
|
||||
let f = () => a;
|
||||
if (a) {
|
||||
a = x;
|
||||
break;
|
||||
}
|
||||
else {
|
||||
y++;
|
||||
}
|
||||
}
|
||||
|
||||
y = 5;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for (let x = 1, y = 2; x < y; ++x, --y) {
|
||||
let a = () => x++ + y++;
|
||||
if (x == 1) {
|
||||
continue;
|
||||
}
|
||||
else {
|
||||
for (let a = 1; a < 5; --a) {
|
||||
let f = () => a;
|
||||
if (a) {
|
||||
a = x;
|
||||
continue;
|
||||
}
|
||||
else {
|
||||
y++;
|
||||
}
|
||||
}
|
||||
|
||||
y = 5;
|
||||
}
|
||||
}
|
||||
|
||||
loop2:
|
||||
for (let x = 1, y = 2; x < y; ++x, --y) {
|
||||
let a = () => x++ + y++;
|
||||
if (x == 1) {
|
||||
break loop2;
|
||||
}
|
||||
else {
|
||||
loop1:
|
||||
for (let a = 1; a < 5; --a) {
|
||||
let f = () => a;
|
||||
if (a) {
|
||||
a = x;
|
||||
break loop1;
|
||||
}
|
||||
else {
|
||||
y++;
|
||||
break loop2
|
||||
}
|
||||
}
|
||||
|
||||
y = 5;
|
||||
}
|
||||
}
|
||||
|
||||
loop2:
|
||||
for (let x = 1, y = 2; x < y; ++x, --y) {
|
||||
let a = () => x++ + y++;
|
||||
if (x == 1) {
|
||||
continue loop2;
|
||||
}
|
||||
else {
|
||||
loop1:
|
||||
for (let a = 1; a < 5; --a) {
|
||||
let f = () => a;
|
||||
if (a) {
|
||||
a = x;
|
||||
continue loop1;
|
||||
}
|
||||
else {
|
||||
y++;
|
||||
continue loop2
|
||||
}
|
||||
}
|
||||
|
||||
y = 5;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//// [blockScopedBindingsReassignedInLoop3.js]
|
||||
var _loop_1 = function(x, y) {
|
||||
var a = function () { return x++ + y++; };
|
||||
if (x == 1) {
|
||||
return out_x_1 = x, out_y_1 = y, "break";
|
||||
}
|
||||
else {
|
||||
var _loop_2 = function(a_1) {
|
||||
var f = function () { return a_1; };
|
||||
if (a_1) {
|
||||
a_1 = x;
|
||||
return out_a_1_1 = a_1, "break";
|
||||
}
|
||||
else {
|
||||
y++;
|
||||
}
|
||||
out_a_1_1 = a_1;
|
||||
};
|
||||
var out_a_1_1;
|
||||
for (var a_1 = 1; a_1 < 5; --a_1) {
|
||||
var state_1 = _loop_2(a_1);
|
||||
a_1 = out_a_1_1;
|
||||
if (state_1 === "break") break;
|
||||
}
|
||||
y = 5;
|
||||
}
|
||||
out_x_1 = x;
|
||||
out_y_1 = y;
|
||||
};
|
||||
var out_x_1, out_y_1;
|
||||
for (var x = 1, y = 2; x < y; ++x, --y) {
|
||||
var state_2 = _loop_1(x, y);
|
||||
x = out_x_1;
|
||||
y = out_y_1;
|
||||
if (state_2 === "break") break;
|
||||
}
|
||||
var _loop_3 = function(x, y) {
|
||||
var a = function () { return x++ + y++; };
|
||||
if (x == 1) {
|
||||
return out_x_2 = x, out_y_2 = y, "continue";
|
||||
}
|
||||
else {
|
||||
var _loop_4 = function(a_2) {
|
||||
var f = function () { return a_2; };
|
||||
if (a_2) {
|
||||
a_2 = x;
|
||||
return out_a_2_1 = a_2, "continue";
|
||||
}
|
||||
else {
|
||||
y++;
|
||||
}
|
||||
out_a_2_1 = a_2;
|
||||
};
|
||||
var out_a_2_1;
|
||||
for (var a_2 = 1; a_2 < 5; --a_2) {
|
||||
var state_3 = _loop_4(a_2);
|
||||
a_2 = out_a_2_1;
|
||||
if (state_3 === "continue") continue;
|
||||
}
|
||||
y = 5;
|
||||
}
|
||||
out_x_2 = x;
|
||||
out_y_2 = y;
|
||||
};
|
||||
var out_x_2, out_y_2;
|
||||
for (var x = 1, y = 2; x < y; ++x, --y) {
|
||||
var state_4 = _loop_3(x, y);
|
||||
x = out_x_2;
|
||||
y = out_y_2;
|
||||
if (state_4 === "continue") continue;
|
||||
}
|
||||
var _loop_5 = function(x, y) {
|
||||
var a = function () { return x++ + y++; };
|
||||
if (x == 1) {
|
||||
return out_x_3 = x, out_y_3 = y, "break-loop2";
|
||||
}
|
||||
else {
|
||||
var _loop_6 = function(a_3) {
|
||||
var f = function () { return a_3; };
|
||||
if (a_3) {
|
||||
a_3 = x;
|
||||
return out_a_3_1 = a_3, "break-loop1";
|
||||
}
|
||||
else {
|
||||
y++;
|
||||
return out_a_3_1 = a_3, "break-loop2";
|
||||
}
|
||||
out_a_3_1 = a_3;
|
||||
};
|
||||
var out_a_3_1;
|
||||
loop1: for (var a_3 = 1; a_3 < 5; --a_3) {
|
||||
var state_5 = _loop_6(a_3);
|
||||
a_3 = out_a_3_1;
|
||||
switch(state_5) {
|
||||
case "break-loop1": break loop1;
|
||||
case "break-loop2": return state_5;
|
||||
}
|
||||
}
|
||||
y = 5;
|
||||
}
|
||||
out_x_3 = x;
|
||||
out_y_3 = y;
|
||||
};
|
||||
var out_x_3, out_y_3;
|
||||
loop2: for (var x = 1, y = 2; x < y; ++x, --y) {
|
||||
var state_6 = _loop_5(x, y);
|
||||
x = out_x_3;
|
||||
y = out_y_3;
|
||||
switch(state_6) {
|
||||
case "break-loop2": break loop2;
|
||||
}
|
||||
}
|
||||
var _loop_7 = function(x, y) {
|
||||
var a = function () { return x++ + y++; };
|
||||
if (x == 1) {
|
||||
return out_x_4 = x, out_y_4 = y, "continue-loop2";
|
||||
}
|
||||
else {
|
||||
var _loop_8 = function(a_4) {
|
||||
var f = function () { return a_4; };
|
||||
if (a_4) {
|
||||
a_4 = x;
|
||||
return out_a_4_1 = a_4, "continue-loop1";
|
||||
}
|
||||
else {
|
||||
y++;
|
||||
return out_a_4_1 = a_4, "continue-loop2";
|
||||
}
|
||||
out_a_4_1 = a_4;
|
||||
};
|
||||
var out_a_4_1;
|
||||
loop1: for (var a_4 = 1; a_4 < 5; --a_4) {
|
||||
var state_7 = _loop_8(a_4);
|
||||
a_4 = out_a_4_1;
|
||||
switch(state_7) {
|
||||
case "continue-loop1": continue loop1;
|
||||
case "continue-loop2": return state_7;
|
||||
}
|
||||
}
|
||||
y = 5;
|
||||
}
|
||||
out_x_4 = x;
|
||||
out_y_4 = y;
|
||||
};
|
||||
var out_x_4, out_y_4;
|
||||
loop2: for (var x = 1, y = 2; x < y; ++x, --y) {
|
||||
var state_8 = _loop_7(x, y);
|
||||
x = out_x_4;
|
||||
y = out_y_4;
|
||||
switch(state_8) {
|
||||
case "continue-loop2": continue loop2;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,203 @@
|
||||
=== tests/cases/compiler/blockScopedBindingsReassignedInLoop3.ts ===
|
||||
|
||||
for (let x = 1, y = 2; x < y; ++x, --y) {
|
||||
>x : Symbol(x, Decl(blockScopedBindingsReassignedInLoop3.ts, 1, 8))
|
||||
>y : Symbol(y, Decl(blockScopedBindingsReassignedInLoop3.ts, 1, 15))
|
||||
>x : Symbol(x, Decl(blockScopedBindingsReassignedInLoop3.ts, 1, 8))
|
||||
>y : Symbol(y, Decl(blockScopedBindingsReassignedInLoop3.ts, 1, 15))
|
||||
>x : Symbol(x, Decl(blockScopedBindingsReassignedInLoop3.ts, 1, 8))
|
||||
>y : Symbol(y, Decl(blockScopedBindingsReassignedInLoop3.ts, 1, 15))
|
||||
|
||||
let a = () => x++ + y++;
|
||||
>a : Symbol(a, Decl(blockScopedBindingsReassignedInLoop3.ts, 2, 7))
|
||||
>x : Symbol(x, Decl(blockScopedBindingsReassignedInLoop3.ts, 1, 8))
|
||||
>y : Symbol(y, Decl(blockScopedBindingsReassignedInLoop3.ts, 1, 15))
|
||||
|
||||
if (x == 1) {
|
||||
>x : Symbol(x, Decl(blockScopedBindingsReassignedInLoop3.ts, 1, 8))
|
||||
|
||||
break;
|
||||
}
|
||||
else {
|
||||
for (let a = 1; a < 5; --a) {
|
||||
>a : Symbol(a, Decl(blockScopedBindingsReassignedInLoop3.ts, 7, 16))
|
||||
>a : Symbol(a, Decl(blockScopedBindingsReassignedInLoop3.ts, 7, 16))
|
||||
>a : Symbol(a, Decl(blockScopedBindingsReassignedInLoop3.ts, 7, 16))
|
||||
|
||||
let f = () => a;
|
||||
>f : Symbol(f, Decl(blockScopedBindingsReassignedInLoop3.ts, 8, 15))
|
||||
>a : Symbol(a, Decl(blockScopedBindingsReassignedInLoop3.ts, 7, 16))
|
||||
|
||||
if (a) {
|
||||
>a : Symbol(a, Decl(blockScopedBindingsReassignedInLoop3.ts, 7, 16))
|
||||
|
||||
a = x;
|
||||
>a : Symbol(a, Decl(blockScopedBindingsReassignedInLoop3.ts, 7, 16))
|
||||
>x : Symbol(x, Decl(blockScopedBindingsReassignedInLoop3.ts, 1, 8))
|
||||
|
||||
break;
|
||||
}
|
||||
else {
|
||||
y++;
|
||||
>y : Symbol(y, Decl(blockScopedBindingsReassignedInLoop3.ts, 1, 15))
|
||||
}
|
||||
}
|
||||
|
||||
y = 5;
|
||||
>y : Symbol(y, Decl(blockScopedBindingsReassignedInLoop3.ts, 1, 15))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for (let x = 1, y = 2; x < y; ++x, --y) {
|
||||
>x : Symbol(x, Decl(blockScopedBindingsReassignedInLoop3.ts, 23, 8))
|
||||
>y : Symbol(y, Decl(blockScopedBindingsReassignedInLoop3.ts, 23, 15))
|
||||
>x : Symbol(x, Decl(blockScopedBindingsReassignedInLoop3.ts, 23, 8))
|
||||
>y : Symbol(y, Decl(blockScopedBindingsReassignedInLoop3.ts, 23, 15))
|
||||
>x : Symbol(x, Decl(blockScopedBindingsReassignedInLoop3.ts, 23, 8))
|
||||
>y : Symbol(y, Decl(blockScopedBindingsReassignedInLoop3.ts, 23, 15))
|
||||
|
||||
let a = () => x++ + y++;
|
||||
>a : Symbol(a, Decl(blockScopedBindingsReassignedInLoop3.ts, 24, 7))
|
||||
>x : Symbol(x, Decl(blockScopedBindingsReassignedInLoop3.ts, 23, 8))
|
||||
>y : Symbol(y, Decl(blockScopedBindingsReassignedInLoop3.ts, 23, 15))
|
||||
|
||||
if (x == 1) {
|
||||
>x : Symbol(x, Decl(blockScopedBindingsReassignedInLoop3.ts, 23, 8))
|
||||
|
||||
continue;
|
||||
}
|
||||
else {
|
||||
for (let a = 1; a < 5; --a) {
|
||||
>a : Symbol(a, Decl(blockScopedBindingsReassignedInLoop3.ts, 29, 16))
|
||||
>a : Symbol(a, Decl(blockScopedBindingsReassignedInLoop3.ts, 29, 16))
|
||||
>a : Symbol(a, Decl(blockScopedBindingsReassignedInLoop3.ts, 29, 16))
|
||||
|
||||
let f = () => a;
|
||||
>f : Symbol(f, Decl(blockScopedBindingsReassignedInLoop3.ts, 30, 15))
|
||||
>a : Symbol(a, Decl(blockScopedBindingsReassignedInLoop3.ts, 29, 16))
|
||||
|
||||
if (a) {
|
||||
>a : Symbol(a, Decl(blockScopedBindingsReassignedInLoop3.ts, 29, 16))
|
||||
|
||||
a = x;
|
||||
>a : Symbol(a, Decl(blockScopedBindingsReassignedInLoop3.ts, 29, 16))
|
||||
>x : Symbol(x, Decl(blockScopedBindingsReassignedInLoop3.ts, 23, 8))
|
||||
|
||||
continue;
|
||||
}
|
||||
else {
|
||||
y++;
|
||||
>y : Symbol(y, Decl(blockScopedBindingsReassignedInLoop3.ts, 23, 15))
|
||||
}
|
||||
}
|
||||
|
||||
y = 5;
|
||||
>y : Symbol(y, Decl(blockScopedBindingsReassignedInLoop3.ts, 23, 15))
|
||||
}
|
||||
}
|
||||
|
||||
loop2:
|
||||
for (let x = 1, y = 2; x < y; ++x, --y) {
|
||||
>x : Symbol(x, Decl(blockScopedBindingsReassignedInLoop3.ts, 45, 8))
|
||||
>y : Symbol(y, Decl(blockScopedBindingsReassignedInLoop3.ts, 45, 15))
|
||||
>x : Symbol(x, Decl(blockScopedBindingsReassignedInLoop3.ts, 45, 8))
|
||||
>y : Symbol(y, Decl(blockScopedBindingsReassignedInLoop3.ts, 45, 15))
|
||||
>x : Symbol(x, Decl(blockScopedBindingsReassignedInLoop3.ts, 45, 8))
|
||||
>y : Symbol(y, Decl(blockScopedBindingsReassignedInLoop3.ts, 45, 15))
|
||||
|
||||
let a = () => x++ + y++;
|
||||
>a : Symbol(a, Decl(blockScopedBindingsReassignedInLoop3.ts, 46, 7))
|
||||
>x : Symbol(x, Decl(blockScopedBindingsReassignedInLoop3.ts, 45, 8))
|
||||
>y : Symbol(y, Decl(blockScopedBindingsReassignedInLoop3.ts, 45, 15))
|
||||
|
||||
if (x == 1) {
|
||||
>x : Symbol(x, Decl(blockScopedBindingsReassignedInLoop3.ts, 45, 8))
|
||||
|
||||
break loop2;
|
||||
}
|
||||
else {
|
||||
loop1:
|
||||
for (let a = 1; a < 5; --a) {
|
||||
>a : Symbol(a, Decl(blockScopedBindingsReassignedInLoop3.ts, 52, 16))
|
||||
>a : Symbol(a, Decl(blockScopedBindingsReassignedInLoop3.ts, 52, 16))
|
||||
>a : Symbol(a, Decl(blockScopedBindingsReassignedInLoop3.ts, 52, 16))
|
||||
|
||||
let f = () => a;
|
||||
>f : Symbol(f, Decl(blockScopedBindingsReassignedInLoop3.ts, 53, 15))
|
||||
>a : Symbol(a, Decl(blockScopedBindingsReassignedInLoop3.ts, 52, 16))
|
||||
|
||||
if (a) {
|
||||
>a : Symbol(a, Decl(blockScopedBindingsReassignedInLoop3.ts, 52, 16))
|
||||
|
||||
a = x;
|
||||
>a : Symbol(a, Decl(blockScopedBindingsReassignedInLoop3.ts, 52, 16))
|
||||
>x : Symbol(x, Decl(blockScopedBindingsReassignedInLoop3.ts, 45, 8))
|
||||
|
||||
break loop1;
|
||||
}
|
||||
else {
|
||||
y++;
|
||||
>y : Symbol(y, Decl(blockScopedBindingsReassignedInLoop3.ts, 45, 15))
|
||||
|
||||
break loop2
|
||||
}
|
||||
}
|
||||
|
||||
y = 5;
|
||||
>y : Symbol(y, Decl(blockScopedBindingsReassignedInLoop3.ts, 45, 15))
|
||||
}
|
||||
}
|
||||
|
||||
loop2:
|
||||
for (let x = 1, y = 2; x < y; ++x, --y) {
|
||||
>x : Symbol(x, Decl(blockScopedBindingsReassignedInLoop3.ts, 69, 8))
|
||||
>y : Symbol(y, Decl(blockScopedBindingsReassignedInLoop3.ts, 69, 15))
|
||||
>x : Symbol(x, Decl(blockScopedBindingsReassignedInLoop3.ts, 69, 8))
|
||||
>y : Symbol(y, Decl(blockScopedBindingsReassignedInLoop3.ts, 69, 15))
|
||||
>x : Symbol(x, Decl(blockScopedBindingsReassignedInLoop3.ts, 69, 8))
|
||||
>y : Symbol(y, Decl(blockScopedBindingsReassignedInLoop3.ts, 69, 15))
|
||||
|
||||
let a = () => x++ + y++;
|
||||
>a : Symbol(a, Decl(blockScopedBindingsReassignedInLoop3.ts, 70, 7))
|
||||
>x : Symbol(x, Decl(blockScopedBindingsReassignedInLoop3.ts, 69, 8))
|
||||
>y : Symbol(y, Decl(blockScopedBindingsReassignedInLoop3.ts, 69, 15))
|
||||
|
||||
if (x == 1) {
|
||||
>x : Symbol(x, Decl(blockScopedBindingsReassignedInLoop3.ts, 69, 8))
|
||||
|
||||
continue loop2;
|
||||
}
|
||||
else {
|
||||
loop1:
|
||||
for (let a = 1; a < 5; --a) {
|
||||
>a : Symbol(a, Decl(blockScopedBindingsReassignedInLoop3.ts, 76, 16))
|
||||
>a : Symbol(a, Decl(blockScopedBindingsReassignedInLoop3.ts, 76, 16))
|
||||
>a : Symbol(a, Decl(blockScopedBindingsReassignedInLoop3.ts, 76, 16))
|
||||
|
||||
let f = () => a;
|
||||
>f : Symbol(f, Decl(blockScopedBindingsReassignedInLoop3.ts, 77, 15))
|
||||
>a : Symbol(a, Decl(blockScopedBindingsReassignedInLoop3.ts, 76, 16))
|
||||
|
||||
if (a) {
|
||||
>a : Symbol(a, Decl(blockScopedBindingsReassignedInLoop3.ts, 76, 16))
|
||||
|
||||
a = x;
|
||||
>a : Symbol(a, Decl(blockScopedBindingsReassignedInLoop3.ts, 76, 16))
|
||||
>x : Symbol(x, Decl(blockScopedBindingsReassignedInLoop3.ts, 69, 8))
|
||||
|
||||
continue loop1;
|
||||
}
|
||||
else {
|
||||
y++;
|
||||
>y : Symbol(y, Decl(blockScopedBindingsReassignedInLoop3.ts, 69, 15))
|
||||
|
||||
continue loop2
|
||||
}
|
||||
}
|
||||
|
||||
y = 5;
|
||||
>y : Symbol(y, Decl(blockScopedBindingsReassignedInLoop3.ts, 69, 15))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,301 @@
|
||||
=== tests/cases/compiler/blockScopedBindingsReassignedInLoop3.ts ===
|
||||
|
||||
for (let x = 1, y = 2; x < y; ++x, --y) {
|
||||
>x : number
|
||||
>1 : number
|
||||
>y : number
|
||||
>2 : number
|
||||
>x < y : boolean
|
||||
>x : number
|
||||
>y : number
|
||||
>++x, --y : number
|
||||
>++x : number
|
||||
>x : number
|
||||
>--y : number
|
||||
>y : number
|
||||
|
||||
let a = () => x++ + y++;
|
||||
>a : () => number
|
||||
>() => x++ + y++ : () => number
|
||||
>x++ + y++ : number
|
||||
>x++ : number
|
||||
>x : number
|
||||
>y++ : number
|
||||
>y : number
|
||||
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
|
||||
break;
|
||||
}
|
||||
else {
|
||||
for (let a = 1; a < 5; --a) {
|
||||
>a : number
|
||||
>1 : number
|
||||
>a < 5 : boolean
|
||||
>a : number
|
||||
>5 : number
|
||||
>--a : number
|
||||
>a : number
|
||||
|
||||
let f = () => a;
|
||||
>f : () => number
|
||||
>() => a : () => number
|
||||
>a : number
|
||||
|
||||
if (a) {
|
||||
>a : number
|
||||
|
||||
a = x;
|
||||
>a = x : number
|
||||
>a : number
|
||||
>x : number
|
||||
|
||||
break;
|
||||
}
|
||||
else {
|
||||
y++;
|
||||
>y++ : number
|
||||
>y : number
|
||||
}
|
||||
}
|
||||
|
||||
y = 5;
|
||||
>y = 5 : number
|
||||
>y : number
|
||||
>5 : number
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for (let x = 1, y = 2; x < y; ++x, --y) {
|
||||
>x : number
|
||||
>1 : number
|
||||
>y : number
|
||||
>2 : number
|
||||
>x < y : boolean
|
||||
>x : number
|
||||
>y : number
|
||||
>++x, --y : number
|
||||
>++x : number
|
||||
>x : number
|
||||
>--y : number
|
||||
>y : number
|
||||
|
||||
let a = () => x++ + y++;
|
||||
>a : () => number
|
||||
>() => x++ + y++ : () => number
|
||||
>x++ + y++ : number
|
||||
>x++ : number
|
||||
>x : number
|
||||
>y++ : number
|
||||
>y : number
|
||||
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
|
||||
continue;
|
||||
}
|
||||
else {
|
||||
for (let a = 1; a < 5; --a) {
|
||||
>a : number
|
||||
>1 : number
|
||||
>a < 5 : boolean
|
||||
>a : number
|
||||
>5 : number
|
||||
>--a : number
|
||||
>a : number
|
||||
|
||||
let f = () => a;
|
||||
>f : () => number
|
||||
>() => a : () => number
|
||||
>a : number
|
||||
|
||||
if (a) {
|
||||
>a : number
|
||||
|
||||
a = x;
|
||||
>a = x : number
|
||||
>a : number
|
||||
>x : number
|
||||
|
||||
continue;
|
||||
}
|
||||
else {
|
||||
y++;
|
||||
>y++ : number
|
||||
>y : number
|
||||
}
|
||||
}
|
||||
|
||||
y = 5;
|
||||
>y = 5 : number
|
||||
>y : number
|
||||
>5 : number
|
||||
}
|
||||
}
|
||||
|
||||
loop2:
|
||||
>loop2 : any
|
||||
|
||||
for (let x = 1, y = 2; x < y; ++x, --y) {
|
||||
>x : number
|
||||
>1 : number
|
||||
>y : number
|
||||
>2 : number
|
||||
>x < y : boolean
|
||||
>x : number
|
||||
>y : number
|
||||
>++x, --y : number
|
||||
>++x : number
|
||||
>x : number
|
||||
>--y : number
|
||||
>y : number
|
||||
|
||||
let a = () => x++ + y++;
|
||||
>a : () => number
|
||||
>() => x++ + y++ : () => number
|
||||
>x++ + y++ : number
|
||||
>x++ : number
|
||||
>x : number
|
||||
>y++ : number
|
||||
>y : number
|
||||
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
|
||||
break loop2;
|
||||
>loop2 : any
|
||||
}
|
||||
else {
|
||||
loop1:
|
||||
>loop1 : any
|
||||
|
||||
for (let a = 1; a < 5; --a) {
|
||||
>a : number
|
||||
>1 : number
|
||||
>a < 5 : boolean
|
||||
>a : number
|
||||
>5 : number
|
||||
>--a : number
|
||||
>a : number
|
||||
|
||||
let f = () => a;
|
||||
>f : () => number
|
||||
>() => a : () => number
|
||||
>a : number
|
||||
|
||||
if (a) {
|
||||
>a : number
|
||||
|
||||
a = x;
|
||||
>a = x : number
|
||||
>a : number
|
||||
>x : number
|
||||
|
||||
break loop1;
|
||||
>loop1 : any
|
||||
}
|
||||
else {
|
||||
y++;
|
||||
>y++ : number
|
||||
>y : number
|
||||
|
||||
break loop2
|
||||
>loop2 : any
|
||||
}
|
||||
}
|
||||
|
||||
y = 5;
|
||||
>y = 5 : number
|
||||
>y : number
|
||||
>5 : number
|
||||
}
|
||||
}
|
||||
|
||||
loop2:
|
||||
>loop2 : any
|
||||
|
||||
for (let x = 1, y = 2; x < y; ++x, --y) {
|
||||
>x : number
|
||||
>1 : number
|
||||
>y : number
|
||||
>2 : number
|
||||
>x < y : boolean
|
||||
>x : number
|
||||
>y : number
|
||||
>++x, --y : number
|
||||
>++x : number
|
||||
>x : number
|
||||
>--y : number
|
||||
>y : number
|
||||
|
||||
let a = () => x++ + y++;
|
||||
>a : () => number
|
||||
>() => x++ + y++ : () => number
|
||||
>x++ + y++ : number
|
||||
>x++ : number
|
||||
>x : number
|
||||
>y++ : number
|
||||
>y : number
|
||||
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
|
||||
continue loop2;
|
||||
>loop2 : any
|
||||
}
|
||||
else {
|
||||
loop1:
|
||||
>loop1 : any
|
||||
|
||||
for (let a = 1; a < 5; --a) {
|
||||
>a : number
|
||||
>1 : number
|
||||
>a < 5 : boolean
|
||||
>a : number
|
||||
>5 : number
|
||||
>--a : number
|
||||
>a : number
|
||||
|
||||
let f = () => a;
|
||||
>f : () => number
|
||||
>() => a : () => number
|
||||
>a : number
|
||||
|
||||
if (a) {
|
||||
>a : number
|
||||
|
||||
a = x;
|
||||
>a = x : number
|
||||
>a : number
|
||||
>x : number
|
||||
|
||||
continue loop1;
|
||||
>loop1 : any
|
||||
}
|
||||
else {
|
||||
y++;
|
||||
>y++ : number
|
||||
>y : number
|
||||
|
||||
continue loop2
|
||||
>loop2 : any
|
||||
}
|
||||
}
|
||||
|
||||
y = 5;
|
||||
>y = 5 : number
|
||||
>y : number
|
||||
>5 : number
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
//// [blockScopedBindingsReassignedInLoop4.ts]
|
||||
function f1() {
|
||||
for (let x = 1, y = 2; x < y; ++x, --y) {
|
||||
let a = () => x++ + y++;
|
||||
if (x == 1) {
|
||||
return 1;
|
||||
}
|
||||
else {
|
||||
y = 5;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//// [blockScopedBindingsReassignedInLoop4.js]
|
||||
function f1() {
|
||||
var _loop_1 = function(x, y) {
|
||||
var a = function () { return x++ + y++; };
|
||||
if (x == 1) {
|
||||
return { value: 1 };
|
||||
}
|
||||
else {
|
||||
y = 5;
|
||||
}
|
||||
out_x_1 = x;
|
||||
out_y_1 = y;
|
||||
};
|
||||
var out_x_1, out_y_1;
|
||||
for (var x = 1, y = 2; x < y; ++x, --y) {
|
||||
var state_1 = _loop_1(x, y);
|
||||
x = out_x_1;
|
||||
y = out_y_1;
|
||||
if (typeof state_1 === "object") return state_1.value;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
=== tests/cases/compiler/blockScopedBindingsReassignedInLoop4.ts ===
|
||||
function f1() {
|
||||
>f1 : Symbol(f1, Decl(blockScopedBindingsReassignedInLoop4.ts, 0, 0))
|
||||
|
||||
for (let x = 1, y = 2; x < y; ++x, --y) {
|
||||
>x : Symbol(x, Decl(blockScopedBindingsReassignedInLoop4.ts, 1, 12))
|
||||
>y : Symbol(y, Decl(blockScopedBindingsReassignedInLoop4.ts, 1, 19))
|
||||
>x : Symbol(x, Decl(blockScopedBindingsReassignedInLoop4.ts, 1, 12))
|
||||
>y : Symbol(y, Decl(blockScopedBindingsReassignedInLoop4.ts, 1, 19))
|
||||
>x : Symbol(x, Decl(blockScopedBindingsReassignedInLoop4.ts, 1, 12))
|
||||
>y : Symbol(y, Decl(blockScopedBindingsReassignedInLoop4.ts, 1, 19))
|
||||
|
||||
let a = () => x++ + y++;
|
||||
>a : Symbol(a, Decl(blockScopedBindingsReassignedInLoop4.ts, 2, 11))
|
||||
>x : Symbol(x, Decl(blockScopedBindingsReassignedInLoop4.ts, 1, 12))
|
||||
>y : Symbol(y, Decl(blockScopedBindingsReassignedInLoop4.ts, 1, 19))
|
||||
|
||||
if (x == 1) {
|
||||
>x : Symbol(x, Decl(blockScopedBindingsReassignedInLoop4.ts, 1, 12))
|
||||
|
||||
return 1;
|
||||
}
|
||||
else {
|
||||
y = 5;
|
||||
>y : Symbol(y, Decl(blockScopedBindingsReassignedInLoop4.ts, 1, 19))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
=== tests/cases/compiler/blockScopedBindingsReassignedInLoop4.ts ===
|
||||
function f1() {
|
||||
>f1 : () => number
|
||||
|
||||
for (let x = 1, y = 2; x < y; ++x, --y) {
|
||||
>x : number
|
||||
>1 : number
|
||||
>y : number
|
||||
>2 : number
|
||||
>x < y : boolean
|
||||
>x : number
|
||||
>y : number
|
||||
>++x, --y : number
|
||||
>++x : number
|
||||
>x : number
|
||||
>--y : number
|
||||
>y : number
|
||||
|
||||
let a = () => x++ + y++;
|
||||
>a : () => number
|
||||
>() => x++ + y++ : () => number
|
||||
>x++ + y++ : number
|
||||
>x++ : number
|
||||
>x : number
|
||||
>y++ : number
|
||||
>y : number
|
||||
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
|
||||
return 1;
|
||||
>1 : number
|
||||
}
|
||||
else {
|
||||
y = 5;
|
||||
>y = 5 : number
|
||||
>y : number
|
||||
>5 : number
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
//// [blockScopedBindingsReassignedInLoop5.ts]
|
||||
for (let x = 1, y = 2; x < y; ++x, --y) {
|
||||
let a = () => x++ + y++;
|
||||
if (x == 1)
|
||||
break;
|
||||
else
|
||||
y = 5;
|
||||
}
|
||||
|
||||
|
||||
//// [blockScopedBindingsReassignedInLoop5.js]
|
||||
var _loop_1 = function(x, y) {
|
||||
var a = function () { return x++ + y++; };
|
||||
if (x == 1)
|
||||
return out_x_1 = x, out_y_1 = y, "break";
|
||||
else
|
||||
y = 5;
|
||||
out_x_1 = x;
|
||||
out_y_1 = y;
|
||||
};
|
||||
var out_x_1, out_y_1;
|
||||
for (var x = 1, y = 2; x < y; ++x, --y) {
|
||||
var state_1 = _loop_1(x, y);
|
||||
x = out_x_1;
|
||||
y = out_y_1;
|
||||
if (state_1 === "break") break;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
=== tests/cases/compiler/blockScopedBindingsReassignedInLoop5.ts ===
|
||||
for (let x = 1, y = 2; x < y; ++x, --y) {
|
||||
>x : Symbol(x, Decl(blockScopedBindingsReassignedInLoop5.ts, 0, 8))
|
||||
>y : Symbol(y, Decl(blockScopedBindingsReassignedInLoop5.ts, 0, 15))
|
||||
>x : Symbol(x, Decl(blockScopedBindingsReassignedInLoop5.ts, 0, 8))
|
||||
>y : Symbol(y, Decl(blockScopedBindingsReassignedInLoop5.ts, 0, 15))
|
||||
>x : Symbol(x, Decl(blockScopedBindingsReassignedInLoop5.ts, 0, 8))
|
||||
>y : Symbol(y, Decl(blockScopedBindingsReassignedInLoop5.ts, 0, 15))
|
||||
|
||||
let a = () => x++ + y++;
|
||||
>a : Symbol(a, Decl(blockScopedBindingsReassignedInLoop5.ts, 1, 7))
|
||||
>x : Symbol(x, Decl(blockScopedBindingsReassignedInLoop5.ts, 0, 8))
|
||||
>y : Symbol(y, Decl(blockScopedBindingsReassignedInLoop5.ts, 0, 15))
|
||||
|
||||
if (x == 1)
|
||||
>x : Symbol(x, Decl(blockScopedBindingsReassignedInLoop5.ts, 0, 8))
|
||||
|
||||
break;
|
||||
else
|
||||
y = 5;
|
||||
>y : Symbol(y, Decl(blockScopedBindingsReassignedInLoop5.ts, 0, 15))
|
||||
}
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
=== tests/cases/compiler/blockScopedBindingsReassignedInLoop5.ts ===
|
||||
for (let x = 1, y = 2; x < y; ++x, --y) {
|
||||
>x : number
|
||||
>1 : number
|
||||
>y : number
|
||||
>2 : number
|
||||
>x < y : boolean
|
||||
>x : number
|
||||
>y : number
|
||||
>++x, --y : number
|
||||
>++x : number
|
||||
>x : number
|
||||
>--y : number
|
||||
>y : number
|
||||
|
||||
let a = () => x++ + y++;
|
||||
>a : () => number
|
||||
>() => x++ + y++ : () => number
|
||||
>x++ + y++ : number
|
||||
>x++ : number
|
||||
>x : number
|
||||
>y++ : number
|
||||
>y : number
|
||||
|
||||
if (x == 1)
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
|
||||
break;
|
||||
else
|
||||
y = 5;
|
||||
>y = 5 : number
|
||||
>y : number
|
||||
>5 : number
|
||||
}
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
//// [blockScopedBindingsReassignedInLoop6.ts]
|
||||
function f1() {
|
||||
for (let [x, y] = [1, 2]; x < y; ++x, --y) {
|
||||
let a = () => x++ + y++;
|
||||
if (x == 1)
|
||||
break;
|
||||
else if (y == 2)
|
||||
y = 5;
|
||||
else
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
function f2() {
|
||||
for (let [{a: x, b: {c: y}}] = [{a: 1, b: {c: 2}}]; x < y; ++x, --y) {
|
||||
let a = () => x++ + y++;
|
||||
if (x == 1)
|
||||
break;
|
||||
else if (y == 2)
|
||||
y = 5;
|
||||
else
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//// [blockScopedBindingsReassignedInLoop6.js]
|
||||
function f1() {
|
||||
var _loop_1 = function(x, y) {
|
||||
var a = function () { return x++ + y++; };
|
||||
if (x == 1)
|
||||
return out_x_1 = x, out_y_1 = y, "break";
|
||||
else if (y == 2)
|
||||
y = 5;
|
||||
else
|
||||
return { value: void 0 };
|
||||
out_x_1 = x;
|
||||
out_y_1 = y;
|
||||
};
|
||||
var out_x_1, out_y_1;
|
||||
for (var _a = [1, 2], x = _a[0], y = _a[1]; x < y; ++x, --y) {
|
||||
var state_1 = _loop_1(x, y);
|
||||
x = out_x_1;
|
||||
y = out_y_1;
|
||||
if (typeof state_1 === "object") return state_1.value;
|
||||
if (state_1 === "break") break;
|
||||
}
|
||||
}
|
||||
function f2() {
|
||||
var _loop_2 = function(x, y) {
|
||||
var a = function () { return x++ + y++; };
|
||||
if (x == 1)
|
||||
return out_x_2 = x, out_y_2 = y, "break";
|
||||
else if (y == 2)
|
||||
y = 5;
|
||||
else
|
||||
return { value: void 0 };
|
||||
out_x_2 = x;
|
||||
out_y_2 = y;
|
||||
};
|
||||
var out_x_2, out_y_2;
|
||||
for (var _a = [{ a: 1, b: { c: 2 } }][0], x = _a.a, y = _a.b.c; x < y; ++x, --y) {
|
||||
var state_2 = _loop_2(x, y);
|
||||
x = out_x_2;
|
||||
y = out_y_2;
|
||||
if (typeof state_2 === "object") return state_2.value;
|
||||
if (state_2 === "break") break;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
=== tests/cases/compiler/blockScopedBindingsReassignedInLoop6.ts ===
|
||||
function f1() {
|
||||
>f1 : Symbol(f1, Decl(blockScopedBindingsReassignedInLoop6.ts, 0, 0))
|
||||
|
||||
for (let [x, y] = [1, 2]; x < y; ++x, --y) {
|
||||
>x : Symbol(x, Decl(blockScopedBindingsReassignedInLoop6.ts, 1, 14))
|
||||
>y : Symbol(y, Decl(blockScopedBindingsReassignedInLoop6.ts, 1, 16))
|
||||
>x : Symbol(x, Decl(blockScopedBindingsReassignedInLoop6.ts, 1, 14))
|
||||
>y : Symbol(y, Decl(blockScopedBindingsReassignedInLoop6.ts, 1, 16))
|
||||
>x : Symbol(x, Decl(blockScopedBindingsReassignedInLoop6.ts, 1, 14))
|
||||
>y : Symbol(y, Decl(blockScopedBindingsReassignedInLoop6.ts, 1, 16))
|
||||
|
||||
let a = () => x++ + y++;
|
||||
>a : Symbol(a, Decl(blockScopedBindingsReassignedInLoop6.ts, 2, 11))
|
||||
>x : Symbol(x, Decl(blockScopedBindingsReassignedInLoop6.ts, 1, 14))
|
||||
>y : Symbol(y, Decl(blockScopedBindingsReassignedInLoop6.ts, 1, 16))
|
||||
|
||||
if (x == 1)
|
||||
>x : Symbol(x, Decl(blockScopedBindingsReassignedInLoop6.ts, 1, 14))
|
||||
|
||||
break;
|
||||
else if (y == 2)
|
||||
>y : Symbol(y, Decl(blockScopedBindingsReassignedInLoop6.ts, 1, 16))
|
||||
|
||||
y = 5;
|
||||
>y : Symbol(y, Decl(blockScopedBindingsReassignedInLoop6.ts, 1, 16))
|
||||
|
||||
else
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
function f2() {
|
||||
>f2 : Symbol(f2, Decl(blockScopedBindingsReassignedInLoop6.ts, 10, 1))
|
||||
|
||||
for (let [{a: x, b: {c: y}}] = [{a: 1, b: {c: 2}}]; x < y; ++x, --y) {
|
||||
>a : Symbol(a, Decl(blockScopedBindingsReassignedInLoop6.ts, 13, 37))
|
||||
>x : Symbol(x, Decl(blockScopedBindingsReassignedInLoop6.ts, 13, 15))
|
||||
>b : Symbol(b, Decl(blockScopedBindingsReassignedInLoop6.ts, 13, 42))
|
||||
>c : Symbol(c, Decl(blockScopedBindingsReassignedInLoop6.ts, 13, 47))
|
||||
>y : Symbol(y, Decl(blockScopedBindingsReassignedInLoop6.ts, 13, 25))
|
||||
>a : Symbol(a, Decl(blockScopedBindingsReassignedInLoop6.ts, 13, 37))
|
||||
>b : Symbol(b, Decl(blockScopedBindingsReassignedInLoop6.ts, 13, 42))
|
||||
>c : Symbol(c, Decl(blockScopedBindingsReassignedInLoop6.ts, 13, 47))
|
||||
>x : Symbol(x, Decl(blockScopedBindingsReassignedInLoop6.ts, 13, 15))
|
||||
>y : Symbol(y, Decl(blockScopedBindingsReassignedInLoop6.ts, 13, 25))
|
||||
>x : Symbol(x, Decl(blockScopedBindingsReassignedInLoop6.ts, 13, 15))
|
||||
>y : Symbol(y, Decl(blockScopedBindingsReassignedInLoop6.ts, 13, 25))
|
||||
|
||||
let a = () => x++ + y++;
|
||||
>a : Symbol(a, Decl(blockScopedBindingsReassignedInLoop6.ts, 14, 11))
|
||||
>x : Symbol(x, Decl(blockScopedBindingsReassignedInLoop6.ts, 13, 15))
|
||||
>y : Symbol(y, Decl(blockScopedBindingsReassignedInLoop6.ts, 13, 25))
|
||||
|
||||
if (x == 1)
|
||||
>x : Symbol(x, Decl(blockScopedBindingsReassignedInLoop6.ts, 13, 15))
|
||||
|
||||
break;
|
||||
else if (y == 2)
|
||||
>y : Symbol(y, Decl(blockScopedBindingsReassignedInLoop6.ts, 13, 25))
|
||||
|
||||
y = 5;
|
||||
>y : Symbol(y, Decl(blockScopedBindingsReassignedInLoop6.ts, 13, 25))
|
||||
|
||||
else
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,110 @@
|
||||
=== tests/cases/compiler/blockScopedBindingsReassignedInLoop6.ts ===
|
||||
function f1() {
|
||||
>f1 : () => void
|
||||
|
||||
for (let [x, y] = [1, 2]; x < y; ++x, --y) {
|
||||
>x : number
|
||||
>y : number
|
||||
>[1, 2] : [number, number]
|
||||
>1 : number
|
||||
>2 : number
|
||||
>x < y : boolean
|
||||
>x : number
|
||||
>y : number
|
||||
>++x, --y : number
|
||||
>++x : number
|
||||
>x : number
|
||||
>--y : number
|
||||
>y : number
|
||||
|
||||
let a = () => x++ + y++;
|
||||
>a : () => number
|
||||
>() => x++ + y++ : () => number
|
||||
>x++ + y++ : number
|
||||
>x++ : number
|
||||
>x : number
|
||||
>y++ : number
|
||||
>y : number
|
||||
|
||||
if (x == 1)
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
|
||||
break;
|
||||
else if (y == 2)
|
||||
>y == 2 : boolean
|
||||
>y : number
|
||||
>2 : number
|
||||
|
||||
y = 5;
|
||||
>y = 5 : number
|
||||
>y : number
|
||||
>5 : number
|
||||
|
||||
else
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
function f2() {
|
||||
>f2 : () => void
|
||||
|
||||
for (let [{a: x, b: {c: y}}] = [{a: 1, b: {c: 2}}]; x < y; ++x, --y) {
|
||||
>a : any
|
||||
>x : number
|
||||
>b : any
|
||||
>c : any
|
||||
>y : number
|
||||
>[{a: 1, b: {c: 2}}] : [{ a: number; b: { c: number; }; }]
|
||||
>{a: 1, b: {c: 2}} : { a: number; b: { c: number; }; }
|
||||
>a : number
|
||||
>1 : number
|
||||
>b : { c: number; }
|
||||
>{c: 2} : { c: number; }
|
||||
>c : number
|
||||
>2 : number
|
||||
>x < y : boolean
|
||||
>x : number
|
||||
>y : number
|
||||
>++x, --y : number
|
||||
>++x : number
|
||||
>x : number
|
||||
>--y : number
|
||||
>y : number
|
||||
|
||||
let a = () => x++ + y++;
|
||||
>a : () => number
|
||||
>() => x++ + y++ : () => number
|
||||
>x++ + y++ : number
|
||||
>x++ : number
|
||||
>x : number
|
||||
>y++ : number
|
||||
>y : number
|
||||
|
||||
if (x == 1)
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
|
||||
break;
|
||||
else if (y == 2)
|
||||
>y == 2 : boolean
|
||||
>y : number
|
||||
>2 : number
|
||||
|
||||
y = 5;
|
||||
>y = 5 : number
|
||||
>y : number
|
||||
>5 : number
|
||||
|
||||
else
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
tests/cases/conformance/externalModules/foo1.ts(1,1): error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
tests/cases/conformance/externalModules/foo1.ts(9,12): error TS2339: Property 'x' does not exist on type 'C1'.
|
||||
tests/cases/conformance/externalModules/foo2.ts(8,12): error TS2339: Property 'y' does not exist on type 'C1'.
|
||||
tests/cases/conformance/externalModules/foo2.ts(13,8): error TS2339: Property 'x' does not exist on type 'C1'.
|
||||
@@ -26,10 +25,8 @@ tests/cases/conformance/externalModules/foo2.ts(13,8): error TS2339: Property 'x
|
||||
}
|
||||
}
|
||||
|
||||
==== tests/cases/conformance/externalModules/foo1.ts (2 errors) ====
|
||||
==== tests/cases/conformance/externalModules/foo1.ts (1 errors) ====
|
||||
import foo2 = require('./foo2');
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
export module M1 {
|
||||
export class C1 {
|
||||
m1: foo2.M1.C1;
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractManyKeywords.ts(1,1): error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractManyKeywords.ts(1,25): error TS1005: ';' expected.
|
||||
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractManyKeywords.ts(3,1): error TS1128: Declaration or statement expected.
|
||||
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractManyKeywords.ts(4,17): error TS1005: '=' expected.
|
||||
|
||||
|
||||
==== tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractManyKeywords.ts (4 errors) ====
|
||||
==== tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractManyKeywords.ts (3 errors) ====
|
||||
export default abstract class A {}
|
||||
~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
~~~~~
|
||||
!!! error TS1005: ';' expected.
|
||||
export abstract class B {}
|
||||
|
||||
@@ -1,17 +1,14 @@
|
||||
tests/cases/compiler/classExtendsNull.ts(2,5): error TS17005: A constructor cannot contain a 'super' call when its class extends 'null'
|
||||
tests/cases/compiler/classExtendsNull.ts(3,9): error TS17005: A constructor cannot contain a 'super' call when its class extends 'null'
|
||||
|
||||
|
||||
==== tests/cases/compiler/classExtendsNull.ts (1 errors) ====
|
||||
class C extends null {
|
||||
constructor() {
|
||||
~~~~~~~~~~~~~~~
|
||||
super();
|
||||
~~~~~~~~~~~~~~~~
|
||||
return Object.create(null);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
}
|
||||
~~~~~
|
||||
~~~~~~~
|
||||
!!! error TS17005: A constructor cannot contain a 'super' call when its class extends 'null'
|
||||
return Object.create(null);
|
||||
}
|
||||
}
|
||||
|
||||
class D extends null {
|
||||
|
||||
@@ -1,17 +1,14 @@
|
||||
tests/cases/compiler/classMemberInitializerWithLamdaScoping3_1.ts(4,14): error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
tests/cases/compiler/classMemberInitializerWithLamdaScoping3_1.ts(8,21): error TS2301: Initializer of instance member variable 'messageHandler' cannot reference identifier 'field1' declared in the constructor.
|
||||
|
||||
|
||||
==== tests/cases/compiler/classMemberInitializerWithLamdaScoping3_0.ts (0 errors) ====
|
||||
var field1: string;
|
||||
|
||||
==== tests/cases/compiler/classMemberInitializerWithLamdaScoping3_1.ts (2 errors) ====
|
||||
==== tests/cases/compiler/classMemberInitializerWithLamdaScoping3_1.ts (1 errors) ====
|
||||
declare var console: {
|
||||
log(msg?: any): void;
|
||||
};
|
||||
export class Test1 {
|
||||
~~~~~
|
||||
!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
constructor(private field1: string) {
|
||||
}
|
||||
messageHandler = () => {
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
tests/cases/compiler/classMemberInitializerWithLamdaScoping3_0.ts(1,1): error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
tests/cases/compiler/classMemberInitializerWithLamdaScoping3_1.ts(8,21): error TS2304: Cannot find name 'field1'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/classMemberInitializerWithLamdaScoping3_0.ts (1 errors) ====
|
||||
==== tests/cases/compiler/classMemberInitializerWithLamdaScoping3_0.ts (0 errors) ====
|
||||
export var field1: string;
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
|
||||
==== tests/cases/compiler/classMemberInitializerWithLamdaScoping3_1.ts (1 errors) ====
|
||||
declare var console: {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
tests/cases/conformance/es6/computedProperties/computedPropertyNames36_ES5.ts(8,5): error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'.
|
||||
tests/cases/conformance/es6/computedProperties/computedPropertyNames36_ES5.ts(8,9): error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames36_ES5.ts (1 errors) ====
|
||||
@@ -10,7 +10,7 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames36_ES5.ts(8,
|
||||
|
||||
// Computed properties
|
||||
get ["get1"]() { return new Foo }
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~
|
||||
!!! error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'.
|
||||
set ["set1"](p: Foo2) { }
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
tests/cases/conformance/es6/computedProperties/computedPropertyNames36_ES6.ts(8,5): error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'.
|
||||
tests/cases/conformance/es6/computedProperties/computedPropertyNames36_ES6.ts(8,9): error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames36_ES6.ts (1 errors) ====
|
||||
@@ -10,7 +10,7 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames36_ES6.ts(8,
|
||||
|
||||
// Computed properties
|
||||
get ["get1"]() { return new Foo }
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~
|
||||
!!! error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'.
|
||||
set ["set1"](p: Foo2) { }
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
tests/cases/conformance/es6/computedProperties/computedPropertyNames38_ES5.ts(8,5): error TS2411: Property '[1 << 6]' of type 'Foo' is not assignable to string index type 'Foo2'.
|
||||
tests/cases/conformance/es6/computedProperties/computedPropertyNames38_ES5.ts(8,9): error TS2411: Property '[1 << 6]' of type 'Foo' is not assignable to string index type 'Foo2'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames38_ES5.ts (1 errors) ====
|
||||
@@ -10,7 +10,7 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames38_ES5.ts(8,
|
||||
|
||||
// Computed properties
|
||||
get [1 << 6]() { return new Foo }
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~
|
||||
!!! error TS2411: Property '[1 << 6]' of type 'Foo' is not assignable to string index type 'Foo2'.
|
||||
set [1 << 6](p: Foo2) { }
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
tests/cases/conformance/es6/computedProperties/computedPropertyNames38_ES6.ts(8,5): error TS2411: Property '[1 << 6]' of type 'Foo' is not assignable to string index type 'Foo2'.
|
||||
tests/cases/conformance/es6/computedProperties/computedPropertyNames38_ES6.ts(8,9): error TS2411: Property '[1 << 6]' of type 'Foo' is not assignable to string index type 'Foo2'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames38_ES6.ts (1 errors) ====
|
||||
@@ -10,7 +10,7 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames38_ES6.ts(8,
|
||||
|
||||
// Computed properties
|
||||
get [1 << 6]() { return new Foo }
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~
|
||||
!!! error TS2411: Property '[1 << 6]' of type 'Foo' is not assignable to string index type 'Foo2'.
|
||||
set [1 << 6](p: Foo2) { }
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
tests/cases/conformance/es6/computedProperties/computedPropertyNames39_ES5.ts(8,5): error TS2412: Property '[1 << 6]' of type 'Foo' is not assignable to numeric index type 'Foo2'.
|
||||
tests/cases/conformance/es6/computedProperties/computedPropertyNames39_ES5.ts(8,9): error TS2412: Property '[1 << 6]' of type 'Foo' is not assignable to numeric index type 'Foo2'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames39_ES5.ts (1 errors) ====
|
||||
@@ -10,7 +10,7 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames39_ES5.ts(8,
|
||||
|
||||
// Computed properties
|
||||
get [1 << 6]() { return new Foo }
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~
|
||||
!!! error TS2412: Property '[1 << 6]' of type 'Foo' is not assignable to numeric index type 'Foo2'.
|
||||
set [1 << 6](p: Foo2) { }
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
tests/cases/conformance/es6/computedProperties/computedPropertyNames39_ES6.ts(8,5): error TS2412: Property '[1 << 6]' of type 'Foo' is not assignable to numeric index type 'Foo2'.
|
||||
tests/cases/conformance/es6/computedProperties/computedPropertyNames39_ES6.ts(8,9): error TS2412: Property '[1 << 6]' of type 'Foo' is not assignable to numeric index type 'Foo2'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames39_ES6.ts (1 errors) ====
|
||||
@@ -10,7 +10,7 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames39_ES6.ts(8,
|
||||
|
||||
// Computed properties
|
||||
get [1 << 6]() { return new Foo }
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~
|
||||
!!! error TS2412: Property '[1 << 6]' of type 'Foo' is not assignable to numeric index type 'Foo2'.
|
||||
set [1 << 6](p: Foo2) { }
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
tests/cases/conformance/es6/computedProperties/computedPropertyNames43_ES5.ts(10,5): error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'.
|
||||
tests/cases/conformance/es6/computedProperties/computedPropertyNames43_ES5.ts(10,9): error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames43_ES5.ts (1 errors) ====
|
||||
@@ -12,7 +12,7 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames43_ES5.ts(10
|
||||
class D extends C {
|
||||
// Computed properties
|
||||
get ["get1"]() { return new Foo }
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~
|
||||
!!! error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'.
|
||||
set ["set1"](p: Foo2) { }
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
tests/cases/conformance/es6/computedProperties/computedPropertyNames43_ES6.ts(10,5): error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'.
|
||||
tests/cases/conformance/es6/computedProperties/computedPropertyNames43_ES6.ts(10,9): error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames43_ES6.ts (1 errors) ====
|
||||
@@ -12,7 +12,7 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames43_ES6.ts(10
|
||||
class D extends C {
|
||||
// Computed properties
|
||||
get ["get1"]() { return new Foo }
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~
|
||||
!!! error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'.
|
||||
set ["set1"](p: Foo2) { }
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
tests/cases/conformance/es6/computedProperties/computedPropertyNames44_ES5.ts(6,5): error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'.
|
||||
tests/cases/conformance/es6/computedProperties/computedPropertyNames44_ES5.ts(10,5): error TS2411: Property '["set1"]' of type 'Foo' is not assignable to string index type 'Foo2'.
|
||||
tests/cases/conformance/es6/computedProperties/computedPropertyNames44_ES5.ts(6,9): error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'.
|
||||
tests/cases/conformance/es6/computedProperties/computedPropertyNames44_ES5.ts(10,9): error TS2411: Property '["set1"]' of type 'Foo' is not assignable to string index type 'Foo2'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames44_ES5.ts (2 errors) ====
|
||||
@@ -9,12 +9,12 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames44_ES5.ts(10
|
||||
class C {
|
||||
[s: string]: Foo2;
|
||||
get ["get1"]() { return new Foo }
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~
|
||||
!!! error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'.
|
||||
}
|
||||
|
||||
class D extends C {
|
||||
set ["set1"](p: Foo) { }
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~
|
||||
!!! error TS2411: Property '["set1"]' of type 'Foo' is not assignable to string index type 'Foo2'.
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
tests/cases/conformance/es6/computedProperties/computedPropertyNames44_ES6.ts(6,5): error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'.
|
||||
tests/cases/conformance/es6/computedProperties/computedPropertyNames44_ES6.ts(10,5): error TS2411: Property '["set1"]' of type 'Foo' is not assignable to string index type 'Foo2'.
|
||||
tests/cases/conformance/es6/computedProperties/computedPropertyNames44_ES6.ts(6,9): error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'.
|
||||
tests/cases/conformance/es6/computedProperties/computedPropertyNames44_ES6.ts(10,9): error TS2411: Property '["set1"]' of type 'Foo' is not assignable to string index type 'Foo2'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames44_ES6.ts (2 errors) ====
|
||||
@@ -9,12 +9,12 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames44_ES6.ts(10
|
||||
class C {
|
||||
[s: string]: Foo2;
|
||||
get ["get1"]() { return new Foo }
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~
|
||||
!!! error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'.
|
||||
}
|
||||
|
||||
class D extends C {
|
||||
set ["set1"](p: Foo) { }
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~
|
||||
!!! error TS2411: Property '["set1"]' of type 'Foo' is not assignable to string index type 'Foo2'.
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
tests/cases/conformance/es6/computedProperties/computedPropertyNames45_ES5.ts(5,5): error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'.
|
||||
tests/cases/conformance/es6/computedProperties/computedPropertyNames45_ES5.ts(11,5): error TS2411: Property '["set1"]' of type 'Foo' is not assignable to string index type 'Foo2'.
|
||||
tests/cases/conformance/es6/computedProperties/computedPropertyNames45_ES5.ts(5,9): error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'.
|
||||
tests/cases/conformance/es6/computedProperties/computedPropertyNames45_ES5.ts(11,9): error TS2411: Property '["set1"]' of type 'Foo' is not assignable to string index type 'Foo2'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames45_ES5.ts (2 errors) ====
|
||||
@@ -8,7 +8,7 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames45_ES5.ts(11
|
||||
|
||||
class C {
|
||||
get ["get1"]() { return new Foo }
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~
|
||||
!!! error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'.
|
||||
}
|
||||
|
||||
@@ -16,6 +16,6 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames45_ES5.ts(11
|
||||
// No error when the indexer is in a class more derived than the computed property
|
||||
[s: string]: Foo2;
|
||||
set ["set1"](p: Foo) { }
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~
|
||||
!!! error TS2411: Property '["set1"]' of type 'Foo' is not assignable to string index type 'Foo2'.
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
tests/cases/conformance/es6/computedProperties/computedPropertyNames45_ES6.ts(5,5): error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'.
|
||||
tests/cases/conformance/es6/computedProperties/computedPropertyNames45_ES6.ts(11,5): error TS2411: Property '["set1"]' of type 'Foo' is not assignable to string index type 'Foo2'.
|
||||
tests/cases/conformance/es6/computedProperties/computedPropertyNames45_ES6.ts(5,9): error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'.
|
||||
tests/cases/conformance/es6/computedProperties/computedPropertyNames45_ES6.ts(11,9): error TS2411: Property '["set1"]' of type 'Foo' is not assignable to string index type 'Foo2'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames45_ES6.ts (2 errors) ====
|
||||
@@ -8,7 +8,7 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames45_ES6.ts(11
|
||||
|
||||
class C {
|
||||
get ["get1"]() { return new Foo }
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~
|
||||
!!! error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'.
|
||||
}
|
||||
|
||||
@@ -16,6 +16,6 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames45_ES6.ts(11
|
||||
// No error when the indexer is in a class more derived than the computed property
|
||||
[s: string]: Foo2;
|
||||
set ["set1"](p: Foo) { }
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~
|
||||
!!! error TS2411: Property '["set1"]' of type 'Foo' is not assignable to string index type 'Foo2'.
|
||||
}
|
||||
@@ -14,15 +14,15 @@ var fa: number[];
|
||||
|
||||
fa = fa.concat([0]);
|
||||
>fa : Symbol(fa, Decl(concatError.ts, 8, 3))
|
||||
>fa.concat : Symbol(Array.concat, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>fa.concat : Symbol(Array.concat, Decl(lib.d.ts, --, --))
|
||||
>fa : Symbol(fa, Decl(concatError.ts, 8, 3))
|
||||
>concat : Symbol(Array.concat, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>concat : Symbol(Array.concat, Decl(lib.d.ts, --, --))
|
||||
|
||||
fa = fa.concat(0);
|
||||
>fa : Symbol(fa, Decl(concatError.ts, 8, 3))
|
||||
>fa.concat : Symbol(Array.concat, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>fa.concat : Symbol(Array.concat, Decl(lib.d.ts, --, --))
|
||||
>fa : Symbol(fa, Decl(concatError.ts, 8, 3))
|
||||
>concat : Symbol(Array.concat, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>concat : Symbol(Array.concat, Decl(lib.d.ts, --, --))
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -16,9 +16,9 @@ fa = fa.concat([0]);
|
||||
>fa = fa.concat([0]) : number[]
|
||||
>fa : number[]
|
||||
>fa.concat([0]) : number[]
|
||||
>fa.concat : { <U extends number[]>(...items: U[]): number[]; (...items: number[]): number[]; }
|
||||
>fa.concat : (...items: (number | number[])[]) => number[]
|
||||
>fa : number[]
|
||||
>concat : { <U extends number[]>(...items: U[]): number[]; (...items: number[]): number[]; }
|
||||
>concat : (...items: (number | number[])[]) => number[]
|
||||
>[0] : number[]
|
||||
>0 : number
|
||||
|
||||
@@ -26,9 +26,9 @@ fa = fa.concat(0);
|
||||
>fa = fa.concat(0) : number[]
|
||||
>fa : number[]
|
||||
>fa.concat(0) : number[]
|
||||
>fa.concat : { <U extends number[]>(...items: U[]): number[]; (...items: number[]): number[]; }
|
||||
>fa.concat : (...items: (number | number[])[]) => number[]
|
||||
>fa : number[]
|
||||
>concat : { <U extends number[]>(...items: U[]): number[]; (...items: number[]): number[]; }
|
||||
>concat : (...items: (number | number[])[]) => number[]
|
||||
>0 : number
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
//// [declarationEmitIdentifierPredicates01.ts]
|
||||
|
||||
export function f(x: any): x is number {
|
||||
return typeof x === "number";
|
||||
}
|
||||
|
||||
//// [declarationEmitIdentifierPredicates01.js]
|
||||
"use strict";
|
||||
function f(x) {
|
||||
return typeof x === "number";
|
||||
}
|
||||
exports.f = f;
|
||||
|
||||
|
||||
//// [declarationEmitIdentifierPredicates01.d.ts]
|
||||
export declare function f(x: any): x is number;
|
||||
@@ -0,0 +1,10 @@
|
||||
=== tests/cases/conformance/declarationEmit/typePredicates/declarationEmitIdentifierPredicates01.ts ===
|
||||
|
||||
export function f(x: any): x is number {
|
||||
>f : Symbol(f, Decl(declarationEmitIdentifierPredicates01.ts, 0, 0))
|
||||
>x : Symbol(x, Decl(declarationEmitIdentifierPredicates01.ts, 1, 18))
|
||||
>x : Symbol(x, Decl(declarationEmitIdentifierPredicates01.ts, 1, 18))
|
||||
|
||||
return typeof x === "number";
|
||||
>x : Symbol(x, Decl(declarationEmitIdentifierPredicates01.ts, 1, 18))
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
=== tests/cases/conformance/declarationEmit/typePredicates/declarationEmitIdentifierPredicates01.ts ===
|
||||
|
||||
export function f(x: any): x is number {
|
||||
>f : (x: any) => x is number
|
||||
>x : any
|
||||
>x : any
|
||||
|
||||
return typeof x === "number";
|
||||
>typeof x === "number" : boolean
|
||||
>typeof x : string
|
||||
>x : any
|
||||
>"number" : string
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
tests/cases/conformance/declarationEmit/typePredicates/declarationEmitIdentifierPredicatesWithPrivateName01.ts(6,33): error TS4060: Return type of exported function has or is using private name 'I'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/declarationEmit/typePredicates/declarationEmitIdentifierPredicatesWithPrivateName01.ts (1 errors) ====
|
||||
|
||||
interface I {
|
||||
a: number;
|
||||
}
|
||||
|
||||
export function f(x: any): x is I {
|
||||
~
|
||||
!!! error TS4060: Return type of exported function has or is using private name 'I'.
|
||||
return typeof x.a === "number";
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
//// [declarationEmitIdentifierPredicatesWithPrivateName01.ts]
|
||||
|
||||
interface I {
|
||||
a: number;
|
||||
}
|
||||
|
||||
export function f(x: any): x is I {
|
||||
return typeof x.a === "number";
|
||||
}
|
||||
|
||||
//// [declarationEmitIdentifierPredicatesWithPrivateName01.js]
|
||||
"use strict";
|
||||
function f(x) {
|
||||
return typeof x.a === "number";
|
||||
}
|
||||
exports.f = f;
|
||||
43
tests/baselines/reference/declarationEmitThisPredicates01.js
Normal file
43
tests/baselines/reference/declarationEmitThisPredicates01.js
Normal file
@@ -0,0 +1,43 @@
|
||||
//// [declarationEmitThisPredicates01.ts]
|
||||
|
||||
export class C {
|
||||
m(): this is D {
|
||||
return this instanceof D;
|
||||
}
|
||||
}
|
||||
|
||||
export class D extends C {
|
||||
}
|
||||
|
||||
//// [declarationEmitThisPredicates01.js]
|
||||
"use strict";
|
||||
var __extends = (this && this.__extends) || function (d, b) {
|
||||
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
C.prototype.m = function () {
|
||||
return this instanceof D;
|
||||
};
|
||||
return C;
|
||||
}());
|
||||
exports.C = C;
|
||||
var D = (function (_super) {
|
||||
__extends(D, _super);
|
||||
function D() {
|
||||
_super.apply(this, arguments);
|
||||
}
|
||||
return D;
|
||||
}(C));
|
||||
exports.D = D;
|
||||
|
||||
|
||||
//// [declarationEmitThisPredicates01.d.ts]
|
||||
export declare class C {
|
||||
m(): this is D;
|
||||
}
|
||||
export declare class D extends C {
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
=== tests/cases/conformance/declarationEmit/typePredicates/declarationEmitThisPredicates01.ts ===
|
||||
|
||||
export class C {
|
||||
>C : Symbol(C, Decl(declarationEmitThisPredicates01.ts, 0, 0))
|
||||
|
||||
m(): this is D {
|
||||
>m : Symbol(m, Decl(declarationEmitThisPredicates01.ts, 1, 16))
|
||||
>D : Symbol(D, Decl(declarationEmitThisPredicates01.ts, 5, 1))
|
||||
|
||||
return this instanceof D;
|
||||
>this : Symbol(C, Decl(declarationEmitThisPredicates01.ts, 0, 0))
|
||||
>D : Symbol(D, Decl(declarationEmitThisPredicates01.ts, 5, 1))
|
||||
}
|
||||
}
|
||||
|
||||
export class D extends C {
|
||||
>D : Symbol(D, Decl(declarationEmitThisPredicates01.ts, 5, 1))
|
||||
>C : Symbol(C, Decl(declarationEmitThisPredicates01.ts, 0, 0))
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
=== tests/cases/conformance/declarationEmit/typePredicates/declarationEmitThisPredicates01.ts ===
|
||||
|
||||
export class C {
|
||||
>C : C
|
||||
|
||||
m(): this is D {
|
||||
>m : () => this is D
|
||||
>D : D
|
||||
|
||||
return this instanceof D;
|
||||
>this instanceof D : boolean
|
||||
>this : this
|
||||
>D : typeof D
|
||||
}
|
||||
}
|
||||
|
||||
export class D extends C {
|
||||
>D : D
|
||||
>C : C
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
tests/cases/conformance/declarationEmit/typePredicates/declarationEmitThisPredicates02.ts(9,10): error TS2526: A 'this' type is available only in a non-static member of a class or interface.
|
||||
|
||||
|
||||
==== tests/cases/conformance/declarationEmit/typePredicates/declarationEmitThisPredicates02.ts (1 errors) ====
|
||||
|
||||
export interface Foo {
|
||||
a: string;
|
||||
b: number;
|
||||
c: boolean;
|
||||
}
|
||||
|
||||
export const obj = {
|
||||
m(): this is Foo {
|
||||
~~~~
|
||||
!!! error TS2526: A 'this' type is available only in a non-static member of a class or interface.
|
||||
let dis = this as Foo;
|
||||
return dis.a != null && dis.b != null && dis.c != null;
|
||||
}
|
||||
}
|
||||
34
tests/baselines/reference/declarationEmitThisPredicates02.js
Normal file
34
tests/baselines/reference/declarationEmitThisPredicates02.js
Normal file
@@ -0,0 +1,34 @@
|
||||
//// [declarationEmitThisPredicates02.ts]
|
||||
|
||||
export interface Foo {
|
||||
a: string;
|
||||
b: number;
|
||||
c: boolean;
|
||||
}
|
||||
|
||||
export const obj = {
|
||||
m(): this is Foo {
|
||||
let dis = this as Foo;
|
||||
return dis.a != null && dis.b != null && dis.c != null;
|
||||
}
|
||||
}
|
||||
|
||||
//// [declarationEmitThisPredicates02.js]
|
||||
"use strict";
|
||||
exports.obj = {
|
||||
m: function () {
|
||||
var dis = this;
|
||||
return dis.a != null && dis.b != null && dis.c != null;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
//// [declarationEmitThisPredicates02.d.ts]
|
||||
export interface Foo {
|
||||
a: string;
|
||||
b: number;
|
||||
c: boolean;
|
||||
}
|
||||
export declare const obj: {
|
||||
m(): this is Foo;
|
||||
};
|
||||
@@ -0,0 +1,15 @@
|
||||
tests/cases/conformance/declarationEmit/typePredicates/declarationEmitThisPredicatesWithPrivateName01.ts(3,18): error TS4055: Return type of public method from exported class has or is using private name 'D'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/declarationEmit/typePredicates/declarationEmitThisPredicatesWithPrivateName01.ts (1 errors) ====
|
||||
|
||||
export class C {
|
||||
m(): this is D {
|
||||
~
|
||||
!!! error TS4055: Return type of public method from exported class has or is using private name 'D'.
|
||||
return this instanceof D;
|
||||
}
|
||||
}
|
||||
|
||||
class D extends C {
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
//// [declarationEmitThisPredicatesWithPrivateName01.ts]
|
||||
|
||||
export class C {
|
||||
m(): this is D {
|
||||
return this instanceof D;
|
||||
}
|
||||
}
|
||||
|
||||
class D extends C {
|
||||
}
|
||||
|
||||
//// [declarationEmitThisPredicatesWithPrivateName01.js]
|
||||
"use strict";
|
||||
var __extends = (this && this.__extends) || function (d, b) {
|
||||
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
C.prototype.m = function () {
|
||||
return this instanceof D;
|
||||
};
|
||||
return C;
|
||||
}());
|
||||
exports.C = C;
|
||||
var D = (function (_super) {
|
||||
__extends(D, _super);
|
||||
function D() {
|
||||
_super.apply(this, arguments);
|
||||
}
|
||||
return D;
|
||||
}(C));
|
||||
@@ -0,0 +1,22 @@
|
||||
tests/cases/conformance/declarationEmit/typePredicates/declarationEmitThisPredicatesWithPrivateName02.ts(8,14): error TS4025: Exported variable 'obj' has or is using private name 'Foo'.
|
||||
tests/cases/conformance/declarationEmit/typePredicates/declarationEmitThisPredicatesWithPrivateName02.ts(9,10): error TS2526: A 'this' type is available only in a non-static member of a class or interface.
|
||||
|
||||
|
||||
==== tests/cases/conformance/declarationEmit/typePredicates/declarationEmitThisPredicatesWithPrivateName02.ts (2 errors) ====
|
||||
|
||||
interface Foo {
|
||||
a: string;
|
||||
b: number;
|
||||
c: boolean;
|
||||
}
|
||||
|
||||
export const obj = {
|
||||
~~~
|
||||
!!! error TS4025: Exported variable 'obj' has or is using private name 'Foo'.
|
||||
m(): this is Foo {
|
||||
~~~~
|
||||
!!! error TS2526: A 'this' type is available only in a non-static member of a class or interface.
|
||||
let dis = this as Foo;
|
||||
return dis.a != null && dis.b != null && dis.c != null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
//// [declarationEmitThisPredicatesWithPrivateName02.ts]
|
||||
|
||||
interface Foo {
|
||||
a: string;
|
||||
b: number;
|
||||
c: boolean;
|
||||
}
|
||||
|
||||
export const obj = {
|
||||
m(): this is Foo {
|
||||
let dis = this as Foo;
|
||||
return dis.a != null && dis.b != null && dis.c != null;
|
||||
}
|
||||
}
|
||||
|
||||
//// [declarationEmitThisPredicatesWithPrivateName02.js]
|
||||
"use strict";
|
||||
exports.obj = {
|
||||
m: function () {
|
||||
var dis = this;
|
||||
return dis.a != null && dis.b != null && dis.c != null;
|
||||
}
|
||||
};
|
||||
61
tests/baselines/reference/destructuringInFunctionType.js
Normal file
61
tests/baselines/reference/destructuringInFunctionType.js
Normal file
@@ -0,0 +1,61 @@
|
||||
//// [destructuringInFunctionType.ts]
|
||||
|
||||
interface a { a }
|
||||
interface b { b }
|
||||
interface c { c }
|
||||
|
||||
type T1 = ([a, b, c]);
|
||||
type F1 = ([a, b, c]) => void;
|
||||
|
||||
type T2 = ({ a });
|
||||
type F2 = ({ a }) => void;
|
||||
|
||||
type T3 = ([{ a: b }, { b: a }]);
|
||||
type F3 = ([{ a: b }, { b: a }]) => void;
|
||||
|
||||
type T4 = ([{ a: [b, c] }]);
|
||||
type F4 = ([{ a: [b, c] }]) => void;
|
||||
|
||||
type C1 = new ([{ a: [b, c] }]) => void;
|
||||
|
||||
var v1 = ([a, b, c]) => "hello";
|
||||
var v2: ([a, b, c]) => string;
|
||||
|
||||
|
||||
//// [destructuringInFunctionType.js]
|
||||
var v1 = function (_a) {
|
||||
var a = _a[0], b = _a[1], c = _a[2];
|
||||
return "hello";
|
||||
};
|
||||
var v2;
|
||||
|
||||
|
||||
//// [destructuringInFunctionType.d.ts]
|
||||
interface a {
|
||||
a: any;
|
||||
}
|
||||
interface b {
|
||||
b: any;
|
||||
}
|
||||
interface c {
|
||||
c: any;
|
||||
}
|
||||
declare type T1 = ([a, b, c]);
|
||||
declare type F1 = ([a, b, c]) => void;
|
||||
declare type T2 = ({
|
||||
a;
|
||||
});
|
||||
declare type F2 = ({a}) => void;
|
||||
declare type T3 = ([{
|
||||
a: b;
|
||||
}, {
|
||||
b: a;
|
||||
}]);
|
||||
declare type F3 = ([{a: b}, {b: a}]) => void;
|
||||
declare type T4 = ([{
|
||||
a: [b, c];
|
||||
}]);
|
||||
declare type F4 = ([{a: [b, c]}]) => void;
|
||||
declare type C1 = new ([{a: [b, c]}]) => void;
|
||||
declare var v1: ([a, b, c]: [any, any, any]) => string;
|
||||
declare var v2: ([a, b, c]) => string;
|
||||
@@ -0,0 +1,78 @@
|
||||
=== tests/cases/conformance/es6/destructuring/destructuringInFunctionType.ts ===
|
||||
|
||||
interface a { a }
|
||||
>a : Symbol(a, Decl(destructuringInFunctionType.ts, 0, 0))
|
||||
>a : Symbol(a, Decl(destructuringInFunctionType.ts, 1, 13))
|
||||
|
||||
interface b { b }
|
||||
>b : Symbol(b, Decl(destructuringInFunctionType.ts, 1, 17))
|
||||
>b : Symbol(b, Decl(destructuringInFunctionType.ts, 2, 13))
|
||||
|
||||
interface c { c }
|
||||
>c : Symbol(c, Decl(destructuringInFunctionType.ts, 2, 17))
|
||||
>c : Symbol(c, Decl(destructuringInFunctionType.ts, 3, 13))
|
||||
|
||||
type T1 = ([a, b, c]);
|
||||
>T1 : Symbol(T1, Decl(destructuringInFunctionType.ts, 3, 17))
|
||||
>a : Symbol(a, Decl(destructuringInFunctionType.ts, 0, 0))
|
||||
>b : Symbol(b, Decl(destructuringInFunctionType.ts, 1, 17))
|
||||
>c : Symbol(c, Decl(destructuringInFunctionType.ts, 2, 17))
|
||||
|
||||
type F1 = ([a, b, c]) => void;
|
||||
>F1 : Symbol(F1, Decl(destructuringInFunctionType.ts, 5, 22))
|
||||
>a : Symbol(a, Decl(destructuringInFunctionType.ts, 6, 12))
|
||||
>b : Symbol(b, Decl(destructuringInFunctionType.ts, 6, 14))
|
||||
>c : Symbol(c, Decl(destructuringInFunctionType.ts, 6, 17))
|
||||
|
||||
type T2 = ({ a });
|
||||
>T2 : Symbol(T2, Decl(destructuringInFunctionType.ts, 6, 30))
|
||||
>a : Symbol(a, Decl(destructuringInFunctionType.ts, 8, 12))
|
||||
|
||||
type F2 = ({ a }) => void;
|
||||
>F2 : Symbol(F2, Decl(destructuringInFunctionType.ts, 8, 18))
|
||||
>a : Symbol(a, Decl(destructuringInFunctionType.ts, 9, 12))
|
||||
|
||||
type T3 = ([{ a: b }, { b: a }]);
|
||||
>T3 : Symbol(T3, Decl(destructuringInFunctionType.ts, 9, 26))
|
||||
>a : Symbol(a, Decl(destructuringInFunctionType.ts, 11, 13))
|
||||
>b : Symbol(b, Decl(destructuringInFunctionType.ts, 1, 17))
|
||||
>b : Symbol(b, Decl(destructuringInFunctionType.ts, 11, 23))
|
||||
>a : Symbol(a, Decl(destructuringInFunctionType.ts, 0, 0))
|
||||
|
||||
type F3 = ([{ a: b }, { b: a }]) => void;
|
||||
>F3 : Symbol(F3, Decl(destructuringInFunctionType.ts, 11, 33))
|
||||
>a : Symbol(a)
|
||||
>b : Symbol(b, Decl(destructuringInFunctionType.ts, 12, 13))
|
||||
>b : Symbol(b)
|
||||
>a : Symbol(a, Decl(destructuringInFunctionType.ts, 12, 23))
|
||||
|
||||
type T4 = ([{ a: [b, c] }]);
|
||||
>T4 : Symbol(T4, Decl(destructuringInFunctionType.ts, 12, 41))
|
||||
>a : Symbol(a, Decl(destructuringInFunctionType.ts, 14, 13))
|
||||
>b : Symbol(b, Decl(destructuringInFunctionType.ts, 1, 17))
|
||||
>c : Symbol(c, Decl(destructuringInFunctionType.ts, 2, 17))
|
||||
|
||||
type F4 = ([{ a: [b, c] }]) => void;
|
||||
>F4 : Symbol(F4, Decl(destructuringInFunctionType.ts, 14, 28))
|
||||
>a : Symbol(a)
|
||||
>b : Symbol(b, Decl(destructuringInFunctionType.ts, 15, 18))
|
||||
>c : Symbol(c, Decl(destructuringInFunctionType.ts, 15, 20))
|
||||
|
||||
type C1 = new ([{ a: [b, c] }]) => void;
|
||||
>C1 : Symbol(C1, Decl(destructuringInFunctionType.ts, 15, 36))
|
||||
>a : Symbol(a)
|
||||
>b : Symbol(b, Decl(destructuringInFunctionType.ts, 17, 22))
|
||||
>c : Symbol(c, Decl(destructuringInFunctionType.ts, 17, 24))
|
||||
|
||||
var v1 = ([a, b, c]) => "hello";
|
||||
>v1 : Symbol(v1, Decl(destructuringInFunctionType.ts, 19, 3))
|
||||
>a : Symbol(a, Decl(destructuringInFunctionType.ts, 19, 11))
|
||||
>b : Symbol(b, Decl(destructuringInFunctionType.ts, 19, 13))
|
||||
>c : Symbol(c, Decl(destructuringInFunctionType.ts, 19, 16))
|
||||
|
||||
var v2: ([a, b, c]) => string;
|
||||
>v2 : Symbol(v2, Decl(destructuringInFunctionType.ts, 20, 3))
|
||||
>a : Symbol(a, Decl(destructuringInFunctionType.ts, 20, 10))
|
||||
>b : Symbol(b, Decl(destructuringInFunctionType.ts, 20, 12))
|
||||
>c : Symbol(c, Decl(destructuringInFunctionType.ts, 20, 15))
|
||||
|
||||
80
tests/baselines/reference/destructuringInFunctionType.types
Normal file
80
tests/baselines/reference/destructuringInFunctionType.types
Normal file
@@ -0,0 +1,80 @@
|
||||
=== tests/cases/conformance/es6/destructuring/destructuringInFunctionType.ts ===
|
||||
|
||||
interface a { a }
|
||||
>a : a
|
||||
>a : any
|
||||
|
||||
interface b { b }
|
||||
>b : b
|
||||
>b : any
|
||||
|
||||
interface c { c }
|
||||
>c : c
|
||||
>c : any
|
||||
|
||||
type T1 = ([a, b, c]);
|
||||
>T1 : [a, b, c]
|
||||
>a : a
|
||||
>b : b
|
||||
>c : c
|
||||
|
||||
type F1 = ([a, b, c]) => void;
|
||||
>F1 : ([a, b, c]: [any, any, any]) => void
|
||||
>a : any
|
||||
>b : any
|
||||
>c : any
|
||||
|
||||
type T2 = ({ a });
|
||||
>T2 : { a: any; }
|
||||
>a : any
|
||||
|
||||
type F2 = ({ a }) => void;
|
||||
>F2 : ({ a }: { a: any; }) => void
|
||||
>a : any
|
||||
|
||||
type T3 = ([{ a: b }, { b: a }]);
|
||||
>T3 : [{ a: b; }, { b: a; }]
|
||||
>a : b
|
||||
>b : b
|
||||
>b : a
|
||||
>a : a
|
||||
|
||||
type F3 = ([{ a: b }, { b: a }]) => void;
|
||||
>F3 : ([{ a: b }, { b: a }]: [{ a: any; }, { b: any; }]) => void
|
||||
>a : any
|
||||
>b : any
|
||||
>b : any
|
||||
>a : any
|
||||
|
||||
type T4 = ([{ a: [b, c] }]);
|
||||
>T4 : [{ a: [b, c]; }]
|
||||
>a : [b, c]
|
||||
>b : b
|
||||
>c : c
|
||||
|
||||
type F4 = ([{ a: [b, c] }]) => void;
|
||||
>F4 : ([{ a: [b, c] }]: [{ a: [any, any]; }]) => void
|
||||
>a : any
|
||||
>b : any
|
||||
>c : any
|
||||
|
||||
type C1 = new ([{ a: [b, c] }]) => void;
|
||||
>C1 : new ([{ a: [b, c] }]: [{ a: [any, any]; }]) => void
|
||||
>a : any
|
||||
>b : any
|
||||
>c : any
|
||||
|
||||
var v1 = ([a, b, c]) => "hello";
|
||||
>v1 : ([a, b, c]: [any, any, any]) => string
|
||||
>([a, b, c]) => "hello" : ([a, b, c]: [any, any, any]) => string
|
||||
>a : any
|
||||
>b : any
|
||||
>c : any
|
||||
>"hello" : string
|
||||
|
||||
var v2: ([a, b, c]) => string;
|
||||
>v2 : ([a, b, c]: [any, any, any]) => string
|
||||
>a : any
|
||||
>b : any
|
||||
>c : any
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
tests/cases/conformance/externalModules/foo1.ts(3,1): error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
tests/cases/conformance/externalModules/foo1.ts(3,1): error TS2300: Duplicate identifier 'export='.
|
||||
tests/cases/conformance/externalModules/foo1.ts(4,1): error TS2300: Duplicate identifier 'export='.
|
||||
tests/cases/conformance/externalModules/foo2.ts(3,1): error TS2300: Duplicate identifier 'export='.
|
||||
@@ -12,13 +11,11 @@ tests/cases/conformance/externalModules/foo5.ts(5,1): error TS2300: Duplicate id
|
||||
tests/cases/conformance/externalModules/foo5.ts(6,1): error TS2300: Duplicate identifier 'export='.
|
||||
|
||||
|
||||
==== tests/cases/conformance/externalModules/foo1.ts (3 errors) ====
|
||||
==== tests/cases/conformance/externalModules/foo1.ts (2 errors) ====
|
||||
var x = 10;
|
||||
var y = 20;
|
||||
export = x;
|
||||
~~~~~~~~~~~
|
||||
!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
~~~~~~~~~~~
|
||||
!!! error TS2300: Duplicate identifier 'export='.
|
||||
export = y;
|
||||
~~~~~~~~~~~
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
tests/cases/compiler/duplicateLocalVariable1.ts(2,4): error TS1005: ';' expected.
|
||||
tests/cases/compiler/duplicateLocalVariable1.ts(2,11): error TS1146: Declaration expected.
|
||||
tests/cases/compiler/duplicateLocalVariable1.ts(2,13): error TS2304: Cannot find name 'commonjs'.
|
||||
tests/cases/compiler/duplicateLocalVariable1.ts(12,14): error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
tests/cases/compiler/duplicateLocalVariable1.ts(187,22): error TS2403: Subsequent variable declarations must have the same type. Variable 'i' must be of type 'string', but here has type 'number'.
|
||||
tests/cases/compiler/duplicateLocalVariable1.ts(187,29): error TS2365: Operator '<' cannot be applied to types 'string' and 'number'.
|
||||
tests/cases/compiler/duplicateLocalVariable1.ts(187,37): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
|
||||
|
||||
|
||||
==== tests/cases/compiler/duplicateLocalVariable1.ts (7 errors) ====
|
||||
==== tests/cases/compiler/duplicateLocalVariable1.ts (6 errors) ====
|
||||
|
||||
/ /@module: commonjs
|
||||
~
|
||||
@@ -26,8 +25,6 @@ tests/cases/compiler/duplicateLocalVariable1.ts(187,37): error TS2356: An arithm
|
||||
var TestFileDir = ".\\TempTestFiles";
|
||||
|
||||
export class TestCase {
|
||||
~~~~~~~~
|
||||
!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
constructor (public name: string, public test: ()=>boolean, public errorMessageRegEx?: string) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
//// [emitSuperCallBeforeEmitParameterPropertyDeclaration1.ts]
|
||||
class A {
|
||||
blub = 6;
|
||||
}
|
||||
|
||||
|
||||
class B extends A {
|
||||
constructor(public x: number) {
|
||||
"use strict";
|
||||
'someStringForEgngInject';
|
||||
super()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//// [emitSuperCallBeforeEmitParameterPropertyDeclaration1.js]
|
||||
var __extends = (this && this.__extends) || function (d, b) {
|
||||
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
var A = (function () {
|
||||
function A() {
|
||||
this.blub = 6;
|
||||
}
|
||||
return A;
|
||||
}());
|
||||
var B = (function (_super) {
|
||||
__extends(B, _super);
|
||||
function B(x) {
|
||||
"use strict";
|
||||
'someStringForEgngInject';
|
||||
_super.call(this);
|
||||
this.x = x;
|
||||
}
|
||||
return B;
|
||||
}(A));
|
||||
@@ -0,0 +1,23 @@
|
||||
=== tests/cases/compiler/emitSuperCallBeforeEmitParameterPropertyDeclaration1.ts ===
|
||||
class A {
|
||||
>A : Symbol(A, Decl(emitSuperCallBeforeEmitParameterPropertyDeclaration1.ts, 0, 0))
|
||||
|
||||
blub = 6;
|
||||
>blub : Symbol(blub, Decl(emitSuperCallBeforeEmitParameterPropertyDeclaration1.ts, 0, 9))
|
||||
}
|
||||
|
||||
|
||||
class B extends A {
|
||||
>B : Symbol(B, Decl(emitSuperCallBeforeEmitParameterPropertyDeclaration1.ts, 2, 1))
|
||||
>A : Symbol(A, Decl(emitSuperCallBeforeEmitParameterPropertyDeclaration1.ts, 0, 0))
|
||||
|
||||
constructor(public x: number) {
|
||||
>x : Symbol(x, Decl(emitSuperCallBeforeEmitParameterPropertyDeclaration1.ts, 6, 16))
|
||||
|
||||
"use strict";
|
||||
'someStringForEgngInject';
|
||||
super()
|
||||
>super : Symbol(A, Decl(emitSuperCallBeforeEmitParameterPropertyDeclaration1.ts, 0, 0))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
=== tests/cases/compiler/emitSuperCallBeforeEmitParameterPropertyDeclaration1.ts ===
|
||||
class A {
|
||||
>A : A
|
||||
|
||||
blub = 6;
|
||||
>blub : number
|
||||
>6 : number
|
||||
}
|
||||
|
||||
|
||||
class B extends A {
|
||||
>B : B
|
||||
>A : A
|
||||
|
||||
constructor(public x: number) {
|
||||
>x : number
|
||||
|
||||
"use strict";
|
||||
>"use strict" : string
|
||||
|
||||
'someStringForEgngInject';
|
||||
>'someStringForEgngInject' : string
|
||||
|
||||
super()
|
||||
>super() : void
|
||||
>super : typeof A
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
//// [emitSuperCallBeforeEmitParameterPropertyDeclaration1ES6.ts]
|
||||
class A {
|
||||
blub = 6;
|
||||
}
|
||||
|
||||
|
||||
class B extends A {
|
||||
constructor(public x: number) {
|
||||
"use strict";
|
||||
'someStringForEgngInject';
|
||||
super()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//// [emitSuperCallBeforeEmitParameterPropertyDeclaration1ES6.js]
|
||||
class A {
|
||||
constructor() {
|
||||
this.blub = 6;
|
||||
}
|
||||
}
|
||||
class B extends A {
|
||||
constructor(x) {
|
||||
"use strict";
|
||||
'someStringForEgngInject';
|
||||
super();
|
||||
this.x = x;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
=== tests/cases/compiler/emitSuperCallBeforeEmitParameterPropertyDeclaration1ES6.ts ===
|
||||
class A {
|
||||
>A : Symbol(A, Decl(emitSuperCallBeforeEmitParameterPropertyDeclaration1ES6.ts, 0, 0))
|
||||
|
||||
blub = 6;
|
||||
>blub : Symbol(blub, Decl(emitSuperCallBeforeEmitParameterPropertyDeclaration1ES6.ts, 0, 9))
|
||||
}
|
||||
|
||||
|
||||
class B extends A {
|
||||
>B : Symbol(B, Decl(emitSuperCallBeforeEmitParameterPropertyDeclaration1ES6.ts, 2, 1))
|
||||
>A : Symbol(A, Decl(emitSuperCallBeforeEmitParameterPropertyDeclaration1ES6.ts, 0, 0))
|
||||
|
||||
constructor(public x: number) {
|
||||
>x : Symbol(x, Decl(emitSuperCallBeforeEmitParameterPropertyDeclaration1ES6.ts, 6, 16))
|
||||
|
||||
"use strict";
|
||||
'someStringForEgngInject';
|
||||
super()
|
||||
>super : Symbol(A, Decl(emitSuperCallBeforeEmitParameterPropertyDeclaration1ES6.ts, 0, 0))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
=== tests/cases/compiler/emitSuperCallBeforeEmitParameterPropertyDeclaration1ES6.ts ===
|
||||
class A {
|
||||
>A : A
|
||||
|
||||
blub = 6;
|
||||
>blub : number
|
||||
>6 : number
|
||||
}
|
||||
|
||||
|
||||
class B extends A {
|
||||
>B : B
|
||||
>A : A
|
||||
|
||||
constructor(public x: number) {
|
||||
>x : number
|
||||
|
||||
"use strict";
|
||||
>"use strict" : string
|
||||
|
||||
'someStringForEgngInject';
|
||||
>'someStringForEgngInject' : string
|
||||
|
||||
super()
|
||||
>super() : void
|
||||
>super : typeof A
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
//// [emitSuperCallBeforeEmitPropertyDeclaration1.ts]
|
||||
class A {
|
||||
blub = 6;
|
||||
}
|
||||
|
||||
|
||||
class B extends A {
|
||||
|
||||
blub = 12;
|
||||
|
||||
constructor() {
|
||||
"use strict";
|
||||
'someStringForEgngInject';
|
||||
super()
|
||||
}
|
||||
}
|
||||
|
||||
//// [emitSuperCallBeforeEmitPropertyDeclaration1.js]
|
||||
var __extends = (this && this.__extends) || function (d, b) {
|
||||
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
var A = (function () {
|
||||
function A() {
|
||||
this.blub = 6;
|
||||
}
|
||||
return A;
|
||||
}());
|
||||
var B = (function (_super) {
|
||||
__extends(B, _super);
|
||||
function B() {
|
||||
"use strict";
|
||||
'someStringForEgngInject';
|
||||
_super.call(this);
|
||||
this.blub = 12;
|
||||
}
|
||||
return B;
|
||||
}(A));
|
||||
@@ -0,0 +1,23 @@
|
||||
=== tests/cases/compiler/emitSuperCallBeforeEmitPropertyDeclaration1.ts ===
|
||||
class A {
|
||||
>A : Symbol(A, Decl(emitSuperCallBeforeEmitPropertyDeclaration1.ts, 0, 0))
|
||||
|
||||
blub = 6;
|
||||
>blub : Symbol(blub, Decl(emitSuperCallBeforeEmitPropertyDeclaration1.ts, 0, 9))
|
||||
}
|
||||
|
||||
|
||||
class B extends A {
|
||||
>B : Symbol(B, Decl(emitSuperCallBeforeEmitPropertyDeclaration1.ts, 2, 1))
|
||||
>A : Symbol(A, Decl(emitSuperCallBeforeEmitPropertyDeclaration1.ts, 0, 0))
|
||||
|
||||
blub = 12;
|
||||
>blub : Symbol(blub, Decl(emitSuperCallBeforeEmitPropertyDeclaration1.ts, 5, 19))
|
||||
|
||||
constructor() {
|
||||
"use strict";
|
||||
'someStringForEgngInject';
|
||||
super()
|
||||
>super : Symbol(A, Decl(emitSuperCallBeforeEmitPropertyDeclaration1.ts, 0, 0))
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
=== tests/cases/compiler/emitSuperCallBeforeEmitPropertyDeclaration1.ts ===
|
||||
class A {
|
||||
>A : A
|
||||
|
||||
blub = 6;
|
||||
>blub : number
|
||||
>6 : number
|
||||
}
|
||||
|
||||
|
||||
class B extends A {
|
||||
>B : B
|
||||
>A : A
|
||||
|
||||
blub = 12;
|
||||
>blub : number
|
||||
>12 : number
|
||||
|
||||
constructor() {
|
||||
"use strict";
|
||||
>"use strict" : string
|
||||
|
||||
'someStringForEgngInject';
|
||||
>'someStringForEgngInject' : string
|
||||
|
||||
super()
|
||||
>super() : void
|
||||
>super : typeof A
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
//// [emitSuperCallBeforeEmitPropertyDeclaration1ES6.ts]
|
||||
class A {
|
||||
blub = 6;
|
||||
}
|
||||
|
||||
|
||||
class B extends A {
|
||||
|
||||
blub = 12;
|
||||
|
||||
constructor() {
|
||||
'someStringForEgngInject';
|
||||
super()
|
||||
}
|
||||
}
|
||||
|
||||
//// [emitSuperCallBeforeEmitPropertyDeclaration1ES6.js]
|
||||
class A {
|
||||
constructor() {
|
||||
this.blub = 6;
|
||||
}
|
||||
}
|
||||
class B extends A {
|
||||
constructor() {
|
||||
'someStringForEgngInject';
|
||||
super();
|
||||
this.blub = 12;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
=== tests/cases/compiler/emitSuperCallBeforeEmitPropertyDeclaration1ES6.ts ===
|
||||
class A {
|
||||
>A : Symbol(A, Decl(emitSuperCallBeforeEmitPropertyDeclaration1ES6.ts, 0, 0))
|
||||
|
||||
blub = 6;
|
||||
>blub : Symbol(blub, Decl(emitSuperCallBeforeEmitPropertyDeclaration1ES6.ts, 0, 9))
|
||||
}
|
||||
|
||||
|
||||
class B extends A {
|
||||
>B : Symbol(B, Decl(emitSuperCallBeforeEmitPropertyDeclaration1ES6.ts, 2, 1))
|
||||
>A : Symbol(A, Decl(emitSuperCallBeforeEmitPropertyDeclaration1ES6.ts, 0, 0))
|
||||
|
||||
blub = 12;
|
||||
>blub : Symbol(blub, Decl(emitSuperCallBeforeEmitPropertyDeclaration1ES6.ts, 5, 19))
|
||||
|
||||
constructor() {
|
||||
'someStringForEgngInject';
|
||||
super()
|
||||
>super : Symbol(A, Decl(emitSuperCallBeforeEmitPropertyDeclaration1ES6.ts, 0, 0))
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
=== tests/cases/compiler/emitSuperCallBeforeEmitPropertyDeclaration1ES6.ts ===
|
||||
class A {
|
||||
>A : A
|
||||
|
||||
blub = 6;
|
||||
>blub : number
|
||||
>6 : number
|
||||
}
|
||||
|
||||
|
||||
class B extends A {
|
||||
>B : B
|
||||
>A : A
|
||||
|
||||
blub = 12;
|
||||
>blub : number
|
||||
>12 : number
|
||||
|
||||
constructor() {
|
||||
'someStringForEgngInject';
|
||||
>'someStringForEgngInject' : string
|
||||
|
||||
super()
|
||||
>super() : void
|
||||
>super : typeof A
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
//// [emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1.ts]
|
||||
class A {
|
||||
blub = 6;
|
||||
}
|
||||
|
||||
|
||||
class B extends A {
|
||||
blah = 2;
|
||||
constructor(public x: number) {
|
||||
"use strict";
|
||||
'someStringForEgngInject';
|
||||
super()
|
||||
}
|
||||
}
|
||||
|
||||
//// [emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1.js]
|
||||
var __extends = (this && this.__extends) || function (d, b) {
|
||||
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
var A = (function () {
|
||||
function A() {
|
||||
this.blub = 6;
|
||||
}
|
||||
return A;
|
||||
}());
|
||||
var B = (function (_super) {
|
||||
__extends(B, _super);
|
||||
function B(x) {
|
||||
"use strict";
|
||||
'someStringForEgngInject';
|
||||
_super.call(this);
|
||||
this.x = x;
|
||||
this.blah = 2;
|
||||
}
|
||||
return B;
|
||||
}(A));
|
||||
@@ -0,0 +1,25 @@
|
||||
=== tests/cases/compiler/emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1.ts ===
|
||||
class A {
|
||||
>A : Symbol(A, Decl(emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1.ts, 0, 0))
|
||||
|
||||
blub = 6;
|
||||
>blub : Symbol(blub, Decl(emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1.ts, 0, 9))
|
||||
}
|
||||
|
||||
|
||||
class B extends A {
|
||||
>B : Symbol(B, Decl(emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1.ts, 2, 1))
|
||||
>A : Symbol(A, Decl(emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1.ts, 0, 0))
|
||||
|
||||
blah = 2;
|
||||
>blah : Symbol(blah, Decl(emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1.ts, 5, 19))
|
||||
|
||||
constructor(public x: number) {
|
||||
>x : Symbol(x, Decl(emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1.ts, 7, 16))
|
||||
|
||||
"use strict";
|
||||
'someStringForEgngInject';
|
||||
super()
|
||||
>super : Symbol(A, Decl(emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1.ts, 0, 0))
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
=== tests/cases/compiler/emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1.ts ===
|
||||
class A {
|
||||
>A : A
|
||||
|
||||
blub = 6;
|
||||
>blub : number
|
||||
>6 : number
|
||||
}
|
||||
|
||||
|
||||
class B extends A {
|
||||
>B : B
|
||||
>A : A
|
||||
|
||||
blah = 2;
|
||||
>blah : number
|
||||
>2 : number
|
||||
|
||||
constructor(public x: number) {
|
||||
>x : number
|
||||
|
||||
"use strict";
|
||||
>"use strict" : string
|
||||
|
||||
'someStringForEgngInject';
|
||||
>'someStringForEgngInject' : string
|
||||
|
||||
super()
|
||||
>super() : void
|
||||
>super : typeof A
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
//// [emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1ES6.ts]
|
||||
class A {
|
||||
blub = 6;
|
||||
}
|
||||
|
||||
|
||||
class B extends A {
|
||||
blah = 2;
|
||||
constructor(public x: number) {
|
||||
"use strict";
|
||||
'someStringForEgngInject';
|
||||
super()
|
||||
}
|
||||
}
|
||||
|
||||
//// [emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1ES6.js]
|
||||
class A {
|
||||
constructor() {
|
||||
this.blub = 6;
|
||||
}
|
||||
}
|
||||
class B extends A {
|
||||
constructor(x) {
|
||||
"use strict";
|
||||
'someStringForEgngInject';
|
||||
super();
|
||||
this.x = x;
|
||||
this.blah = 2;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
=== tests/cases/compiler/emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1ES6.ts ===
|
||||
class A {
|
||||
>A : Symbol(A, Decl(emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1ES6.ts, 0, 0))
|
||||
|
||||
blub = 6;
|
||||
>blub : Symbol(blub, Decl(emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1ES6.ts, 0, 9))
|
||||
}
|
||||
|
||||
|
||||
class B extends A {
|
||||
>B : Symbol(B, Decl(emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1ES6.ts, 2, 1))
|
||||
>A : Symbol(A, Decl(emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1ES6.ts, 0, 0))
|
||||
|
||||
blah = 2;
|
||||
>blah : Symbol(blah, Decl(emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1ES6.ts, 5, 19))
|
||||
|
||||
constructor(public x: number) {
|
||||
>x : Symbol(x, Decl(emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1ES6.ts, 7, 16))
|
||||
|
||||
"use strict";
|
||||
'someStringForEgngInject';
|
||||
super()
|
||||
>super : Symbol(A, Decl(emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1ES6.ts, 0, 0))
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
=== tests/cases/compiler/emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1ES6.ts ===
|
||||
class A {
|
||||
>A : A
|
||||
|
||||
blub = 6;
|
||||
>blub : number
|
||||
>6 : number
|
||||
}
|
||||
|
||||
|
||||
class B extends A {
|
||||
>B : B
|
||||
>A : A
|
||||
|
||||
blah = 2;
|
||||
>blah : number
|
||||
>2 : number
|
||||
|
||||
constructor(public x: number) {
|
||||
>x : number
|
||||
|
||||
"use strict";
|
||||
>"use strict" : string
|
||||
|
||||
'someStringForEgngInject';
|
||||
>'someStringForEgngInject' : string
|
||||
|
||||
super()
|
||||
>super() : void
|
||||
>super : typeof A
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
tests/cases/compiler/es5ModuleWithoutModuleGenTarget.ts(1,14): error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
|
||||
|
||||
==== tests/cases/compiler/es5ModuleWithoutModuleGenTarget.ts (1 errors) ====
|
||||
export class A
|
||||
~
|
||||
!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
{
|
||||
constructor ()
|
||||
{
|
||||
}
|
||||
|
||||
public B()
|
||||
{
|
||||
return 42;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
=== tests/cases/compiler/es5ModuleWithoutModuleGenTarget.ts ===
|
||||
export class A
|
||||
>A : Symbol(A, Decl(es5ModuleWithoutModuleGenTarget.ts, 0, 0))
|
||||
{
|
||||
constructor ()
|
||||
{
|
||||
}
|
||||
|
||||
public B()
|
||||
>B : Symbol(B, Decl(es5ModuleWithoutModuleGenTarget.ts, 4, 5))
|
||||
{
|
||||
return 42;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
=== tests/cases/compiler/es5ModuleWithoutModuleGenTarget.ts ===
|
||||
export class A
|
||||
>A : A
|
||||
{
|
||||
constructor ()
|
||||
{
|
||||
}
|
||||
|
||||
public B()
|
||||
>B : () => number
|
||||
{
|
||||
return 42;
|
||||
>42 : number
|
||||
}
|
||||
}
|
||||
@@ -17,3 +17,4 @@ import "es6ImportWithoutFromClause_0";
|
||||
//// [es6ImportWithoutFromClause_0.d.ts]
|
||||
export declare var a: number;
|
||||
//// [es6ImportWithoutFromClause_1.d.ts]
|
||||
import "es6ImportWithoutFromClause_0";
|
||||
|
||||
@@ -36,3 +36,5 @@ export declare var a: number;
|
||||
//// [es6ImportWithoutFromClauseAmd_1.d.ts]
|
||||
export declare var b: number;
|
||||
//// [es6ImportWithoutFromClauseAmd_2.d.ts]
|
||||
import "es6ImportWithoutFromClauseAmd_0";
|
||||
import "es6ImportWithoutFromClauseAmd_2";
|
||||
|
||||
@@ -18,3 +18,4 @@ require("es6ImportWithoutFromClauseInEs5_0");
|
||||
//// [es6ImportWithoutFromClauseInEs5_0.d.ts]
|
||||
export declare var a: number;
|
||||
//// [es6ImportWithoutFromClauseInEs5_1.d.ts]
|
||||
import "es6ImportWithoutFromClauseInEs5_0";
|
||||
|
||||
@@ -17,3 +17,4 @@ import "es6ImportWithoutFromClauseNonInstantiatedModule_0";
|
||||
export interface i {
|
||||
}
|
||||
//// [es6ImportWithoutFromClauseNonInstantiatedModule_1.d.ts]
|
||||
import "es6ImportWithoutFromClauseNonInstantiatedModule_0";
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
tests/cases/conformance/externalModules/foo1.ts(1,17): error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
|
||||
|
||||
==== tests/cases/conformance/externalModules/foo2.ts (0 errors) ====
|
||||
import foo1 = require('./foo1');
|
||||
export = foo1.x; // Ok
|
||||
|
||||
==== tests/cases/conformance/externalModules/foo1.ts (1 errors) ====
|
||||
export function x(){
|
||||
~
|
||||
!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
return true;
|
||||
}
|
||||
|
||||
16
tests/baselines/reference/exportAssignDottedName.symbols
Normal file
16
tests/baselines/reference/exportAssignDottedName.symbols
Normal file
@@ -0,0 +1,16 @@
|
||||
=== tests/cases/conformance/externalModules/foo2.ts ===
|
||||
import foo1 = require('./foo1');
|
||||
>foo1 : Symbol(foo1, Decl(foo2.ts, 0, 0))
|
||||
|
||||
export = foo1.x; // Ok
|
||||
>foo1.x : Symbol(foo1.x, Decl(foo1.ts, 0, 0))
|
||||
>foo1 : Symbol(foo1, Decl(foo2.ts, 0, 0))
|
||||
>x : Symbol(foo1.x, Decl(foo1.ts, 0, 0))
|
||||
|
||||
=== tests/cases/conformance/externalModules/foo1.ts ===
|
||||
export function x(){
|
||||
>x : Symbol(x, Decl(foo1.ts, 0, 0))
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
17
tests/baselines/reference/exportAssignDottedName.types
Normal file
17
tests/baselines/reference/exportAssignDottedName.types
Normal file
@@ -0,0 +1,17 @@
|
||||
=== tests/cases/conformance/externalModules/foo2.ts ===
|
||||
import foo1 = require('./foo1');
|
||||
>foo1 : typeof foo1
|
||||
|
||||
export = foo1.x; // Ok
|
||||
>foo1.x : () => boolean
|
||||
>foo1 : typeof foo1
|
||||
>x : () => boolean
|
||||
|
||||
=== tests/cases/conformance/externalModules/foo1.ts ===
|
||||
export function x(){
|
||||
>x : () => boolean
|
||||
|
||||
return true;
|
||||
>true : boolean
|
||||
}
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
tests/cases/conformance/externalModules/foo1.ts(1,17): error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
|
||||
|
||||
==== tests/cases/conformance/externalModules/foo3.ts (0 errors) ====
|
||||
import foo2 = require('./foo2');
|
||||
var x = foo2(); // should be boolean
|
||||
==== tests/cases/conformance/externalModules/foo1.ts (1 errors) ====
|
||||
export function x(){
|
||||
~
|
||||
!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
return true;
|
||||
}
|
||||
|
||||
==== tests/cases/conformance/externalModules/foo2.ts (0 errors) ====
|
||||
import foo1 = require('./foo1');
|
||||
var x = foo1.x;
|
||||
export = x;
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
=== tests/cases/conformance/externalModules/foo3.ts ===
|
||||
import foo2 = require('./foo2');
|
||||
>foo2 : Symbol(foo2, Decl(foo3.ts, 0, 0))
|
||||
|
||||
var x = foo2(); // should be boolean
|
||||
>x : Symbol(x, Decl(foo3.ts, 1, 3))
|
||||
>foo2 : Symbol(foo2, Decl(foo3.ts, 0, 0))
|
||||
|
||||
=== tests/cases/conformance/externalModules/foo1.ts ===
|
||||
export function x(){
|
||||
>x : Symbol(x, Decl(foo1.ts, 0, 0))
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
=== tests/cases/conformance/externalModules/foo2.ts ===
|
||||
import foo1 = require('./foo1');
|
||||
>foo1 : Symbol(foo1, Decl(foo2.ts, 0, 0))
|
||||
|
||||
var x = foo1.x;
|
||||
>x : Symbol(x, Decl(foo2.ts, 1, 3))
|
||||
>foo1.x : Symbol(foo1.x, Decl(foo1.ts, 0, 0))
|
||||
>foo1 : Symbol(foo1, Decl(foo2.ts, 0, 0))
|
||||
>x : Symbol(foo1.x, Decl(foo1.ts, 0, 0))
|
||||
|
||||
export = x;
|
||||
>x : Symbol(x, Decl(foo2.ts, 1, 3))
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
=== tests/cases/conformance/externalModules/foo3.ts ===
|
||||
import foo2 = require('./foo2');
|
||||
>foo2 : () => boolean
|
||||
|
||||
var x = foo2(); // should be boolean
|
||||
>x : boolean
|
||||
>foo2() : boolean
|
||||
>foo2 : () => boolean
|
||||
|
||||
=== tests/cases/conformance/externalModules/foo1.ts ===
|
||||
export function x(){
|
||||
>x : () => boolean
|
||||
|
||||
return true;
|
||||
>true : boolean
|
||||
}
|
||||
|
||||
=== tests/cases/conformance/externalModules/foo2.ts ===
|
||||
import foo1 = require('./foo1');
|
||||
>foo1 : typeof foo1
|
||||
|
||||
var x = foo1.x;
|
||||
>x : () => boolean
|
||||
>foo1.x : () => boolean
|
||||
>foo1 : typeof foo1
|
||||
>x : () => boolean
|
||||
|
||||
export = x;
|
||||
>x : () => boolean
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user