10000 initial revision of reachability checks by vladima · Pull Request #4788 · microsoft/TypeScript · GitHub
[go: up one dir, main page]

Skip to content

initial revision of reachability checks #4788

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 25 commits into from
Nov 2, 2015
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
b62ef0d
initial revision of reachability checks in binder
vladima Sep 3, 2015
beb1aa3
addressed PR feedback
vladima Sep 15, 2015
9aeb0f8
merge with master
vladima Sep 15, 2015
682c14c
addressed PR feedback
vladima Sep 16, 2015
69321a0
merge with master
vladima Sep 16, 2015
4711f0e
merge with master
vladima Sep 22, 2015
98ac805
Merge branch 'master' into reachabilityChecks
vladima Sep 29, 2015
ae175d0
merge with master
vladima Oct 1, 2015
9d24e0f
Merge branch 'master' into reachabilityChecks
vladima Oct 2, 2015
ca0d580
merge with master, fix linter issues
vladima Oct 2, 2015
f0f5a0d
updated command line options, accepted baselines
vladima Oct 3, 2015
eb04f32
Merge branch 'master' into reachabilityChecks
vladima Oct 3, 2015
ebfcd25
merge with master
vladima Oct 11, 2015
938dd74
Merge branch 'master' into reachabilityChecks
vladima Oct 13, 2015
17716fb
accepted baselines
vladima Oct 13, 2015
bc02341
addressed PR feedback, updated tests to suppress reachability errors …
vladima Oct 13, 2015
238e1c6
partially suppress reachability errors in tests
vladima Oct 13, 2015
5532778
suppress reachability errors in remaining tests
vladima Oct 13, 2015
7b12617
Merge branch 'master' into reachabilityChecks
vladima Oct 16, 2015
f9eaed7
Merge branch 'master' into reachabilityChecks
vladima Oct 19, 2015
f96980d
merge with master
vladima Oct 22, 2015
2779352
make binder singleton, inline bindWithReachabilityChecks
vladima Oct 22, 2015
7d09f26
defer allocation of error message text in binder
vladima Oct 22, 2015
d2a11b5
merge with master
vladima Oct 27, 2015
3f11c0b
merge with master
vladima Oct 29, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
10000
Diff view
Prev Previous commit
Next Next commit
merge with master
  • Loading branch information
vladima committed Oct 27, 2015
commit d2a11b55dcb3f84c3f540d09600ad0d85c4e82fb
12 changes: 6 additions & 6 deletions src/compiler/emitter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ namespace ts {

type DependencyGroup = Array<ImportDeclaration | ImportEqualsDeclaration | ExportDeclaration>;

const enum Jump {
Break = 1 << 1,
Continue = 1 << 2,
Return = 1 << 3
}

let entities: Map<number> = {
"quot": 0x0022,
"amp": 0x0026,
Expand Down Expand Up @@ -379,12 +385,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
return true;
}

const enum Jump {
Break = 1 << 1,
Continue = 1 << 2,
Return = 1 << 3
}

interface ConvertedLoopState {
/*
* set of labels that occured inside the converted loop
Expand Down
5 changes: 2 additions & 3 deletions tests/baselines/reference/capturedLetConstInLoop9.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,8 @@ function foo() {
break l0;
}

return 100;

() => b
return 100;
}


Expand Down Expand Up @@ -207,8 +206,8 @@ function foo() {
if (b === 2) {
return "break-l0";
}
return { value: 100 };
(function () { return b; });
return { value: 100 };
};
for (var _d = 0, _e = []; _d < _e.length; _d++) {
var b = _e[_d];
Expand Down
54 changes: 27 additions & 27 deletions tests/baselines/reference/capturedLetConstInLoop9.symbols
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,10 @@ function foo() {
break l0;
}

return 100;

() => b
>b : Symbol(b, Decl(capturedLetConstInLoop9.ts, 66, 16))

return 100;
}


Expand All @@ -171,25 +171,25 @@ function foo() {
}

function foo2() {
>foo2 : Symbol(foo2, Decl(capturedLetConstInLoop9.ts, 89, 1))
>foo2 : Symbol(foo2, Decl(capturedLetConstInLoop9.ts, 88, 1))

for (let x of []) {
>x : Symbol(x, Decl(capturedLetConstInLoop9.ts, 92, 12))
>x : Symbol(x, Decl(capturedLetConstInLoop9.ts, 91, 12))

if (x === 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop9.ts, 92, 12))
>x : Symbol(x, Decl(capturedLetConstInLoop9.ts, 91, 12))

break;
}
else if (x === 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop9.ts, 92, 12))
>x : Symbol(x, Decl(capturedLetConstInLoop9.ts, 91, 12))

continue;
}

while (1 === 1) {
if (x) {
>x : Symbol(x, Decl(capturedLetConstInLoop9.ts, 92, 12))
>x : Symbol(x, Decl(capturedLetConstInLoop9.ts, 91, 12))

break;
}
Expand All @@ -199,17 +199,17 @@ function foo2() {
}

switch(x) {
>x : Symbol(x, Decl(capturedLetConstInLoop9.ts, 92, 12))
>x : Symbol(x, Decl(capturedLetConstInLoop9.ts, 91, 12))

case 1: break;
case 2: continue;
}

for (let y of []) {
>y : Symbol(y, Decl(capturedLetConstInLoop9.ts, 114, 16))
>y : Symbol(y, Decl(capturedLetConstInLoop9.ts, 113, 16))

switch(y) {
>y : Symbol(y, Decl(capturedLetConstInLoop9.ts, 114, 16))
>y : Symbol(y, Decl(capturedLetConstInLoop9.ts, 113, 16))

case 1: break;
case 2: continue;
Expand All @@ -219,50 +219,50 @@ function foo2() {
}

class C {
>C : Symbol(C, Decl(capturedLetConstInLoop9.ts, 121, 1))
>C : Symbol(C, Decl(capturedLetConstInLoop9.ts, 120, 1))

constructor(private N: number) { }
>N : Symbol(N, Decl(capturedLetConstInLoop9.ts, 124, 16))
>N : Symbol(N, Decl(capturedLetConstInLoop9.ts, 123, 16))

foo() {
>foo : Symbol(foo, Decl(capturedLetConstInLoop9.ts, 124, 38))
>foo : Symbol(foo, Decl(capturedLetConstInLoop9.ts, 123, 38))

for (let i = 0; i < 100; i++) {
>i : Symbol(i, Decl(capturedLetConstInLoop9.ts, 126, 16))
>i : Symbol(i, Decl(capturedLetConstInLoop9.ts, 126, 16))
>i : Symbol(i, Decl(capturedLetConstInLoop9.ts, 126, 16))
>i : Symbol(i, Decl(capturedLetConstInLoop9.ts, 125, 16))
>i : Symbol(i, Decl(capturedLetConstInLoop9.ts, 125, 16))
>i : Symbol(i, Decl(capturedLetConstInLoop9.ts, 125, 16))

let f = () => this.N * i;
>f : Symbol(f, Decl(capturedLetConstInLoop9.ts, 127, 15))
>this.N : Symbol(N, Decl(capturedLetConstInLoop9.ts, 124, 16))
>this : Symbol(C, Decl(capturedLetConstInLoop9.ts, 121, 1))
>N : Symbol(N, Decl(capturedLetConstInLoop9.ts, 124, 16))
>i : Symbol(i, Decl(capturedLetConstInLoop9.ts, 126, 16))
>f : Symbol(f, Decl(capturedLetConstInLoop9.ts, 126, 15))
>this.N : Symbol(N, Decl(capturedLetConstInLoop9.ts, 123, 16))
>this : Symbol(C, Decl(capturedLetConstInLoop9.ts, 120, 1))
>N : Symbol(N, Decl(capturedLetConstInLoop9.ts, 123, 16))
>i : Symbol(i, Decl(capturedLetConstInLoop9.ts, 125, 16))
}
}
}

function foo3 () {
>foo3 : Symbol(foo3, Decl(capturedLetConstInLoop9.ts, 130, 1))
>foo3 : Symbol(foo3, Decl(capturedLetConstInLoop9.ts, 129, 1))

let x = arguments.length;
>x : Symbol(x, Decl(capturedLetConstInLoop9.ts, 133, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop9.ts, 132, 7))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))

for (let y of []) {
>y : Symbol(y, Decl(capturedLetConstInLoop9.ts, 134, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop9.ts, 133, 12))

let z = arguments.length;
>z : Symbol(z, Decl(capturedLetConstInLoop9.ts, 135, 11))
>z : Symbol(z, Decl(capturedLetConstInLoop9.ts, 134, 11))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))

(function() { return y + z + arguments.length; });
>y : Symbol(y, Decl(capturedLetConstInLoop9.ts, 134, 12))
>z : Symbol(z, Decl(capturedLetConstInLoop9.ts, 135, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop9.ts, 133, 12))
>z : Symbol(z, Decl(capturedLetConstInLoop9.ts, 134, 11))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
Expand Down
6 changes: 3 additions & 3 deletions tests/baselines/reference/capturedLetConstInLoop9.types
Original file line number Diff line number Diff line change
Expand Up @@ -197,12 +197,12 @@ function foo() {
>l0 : any
}

return 100;
>100 : number

() => b
>() => b : () => any
>b : any

return 100;
>100 : number
}


Expand Down
6 changes: 2 additions & 4 deletions tests/baselines/reference/capturedLetConstInLoop9_ES6.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,8 @@ function foo() {
if (b === 2) {
break l0;
}

return 100;

() => b
return 100;
}


Expand Down Expand Up @@ -198,8 +196,8 @@ function foo() {
if (b === 2) {
break l0;
}
return 100;
(() => b);
return 100;
}
(() => a);
}
Expand Down
55 changes: 27 additions & 28 deletions tests/baselines/reference/capturedLetConstInLoop9_ES6.symbols
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,10 @@ function foo() {

break l0;
}

return 100;

() => b
>b : Symbol(b, Decl(capturedLetConstInLoop9_ES6.ts, 67, 16))

return 100;
}


Expand All @@ -172,25 +171,25 @@ function foo() {
}

function foo2() {
>foo2 : Symbol(foo2, Decl(capturedLetConstInLoop9_ES6.ts, 90, 1))
>foo2 : Symbol(foo2, Decl(capturedLetConstInLoop9_ES6.ts, 88, 1))

for (let x of []) {
>x : Symbol(x, Decl(capturedLetConstInLoop9_ES6.ts, 93, 12))
>x : Symbol(x, Decl(capturedLetConstInLoop9_ES6.ts, 91, 12))

if (x === 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop9_ES6.ts, 93, 12))
>x : Symbol(x, Decl(capturedLetConstInLoop9_ES6.ts, 91, 12))

break;
}
else if (x === 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop9_ES6.ts, 93, 12))
>x : Symbol(x, Decl(capturedLetConstInLoop9_ES6.ts, 91, 12))

continue;
}

while (1 === 1) {
if (x) {
>x : Symbol(x, Decl(capturedLetConstInLoop9_ES6.ts, 93, 12))
>x : Symbol(x, Decl(capturedLetConstInLoop9_ES6.ts, 91, 12))

break;
}
Expand All @@ -200,17 +199,17 @@ function foo2() {
}

switch(x) {
>x : Symbol(x, Decl(capturedLetConstInLoop9_ES6.ts, 93, 12))
>x : Symbol(x, Decl(capturedLetConstInLoop9_ES6.ts, 91, 12))

case 1: break;
case 2: continue;
}

for (let y of []) {
>y : Symbol(y, Decl(capturedLetConstInLoop9_ES6.ts, 115, 16))
>y : Symbol(y, Decl(capturedLetConstInLoop9_ES6.ts, 113, 16))

switch(y) {
>y : Symbol(y, Decl(capturedLetConstInLoop9_ES6.ts, 115, 16))
>y : Symbol(y, Decl(capturedLetConstInLoop9_ES6.ts, 113, 16))

case 1: break;
case 2: continue;
Expand All @@ -220,50 +219,50 @@ function foo2() {
}

class C {
>C : Symbol(C, Decl(capturedLetConstInLoop9_ES6.ts, 122, 1))
>C : Symbol(C, Decl(capturedLetConstInLoop9_ES6.ts, 120, 1))

constructor(private N: number) { }
>N : Symbol(N, Decl(capturedLetConstInLoop9_ES6.ts, 125, 16))
>N : Symbol(N, Decl(capturedLetConstInLoop9_ES6.ts, 123, 16))

foo() {
>foo : Symbol(foo, Decl(capturedLetConstInLoop9_ES6.ts, 125, 38))
>foo : Symbol(foo, Decl(capturedLetConstInLoop9_ES6.ts, 123, 38))

for (let i = 0; i < 100; i++) {
>i : Symbol(i, Decl(capturedLetConstInLoop9_ES6.ts, 127, 16))
>i : Symbol(i, Decl(capturedLetConstInLoop9_ES6.ts, 127, 16))
>i : Symbol(i, Decl(capturedLetConstInLoop9_ES6.ts, 127, 16))
>i : Symbol(i, Decl(capturedLetConstInLoop9_ES6.ts, 125, 16))
>i : Symbol(i, Decl(capturedLetConstInLoop9_ES6.ts, 125, 16))
>i : Symbol(i, Decl(capturedLetConstInLoop9_ES6.ts, 125, 16))

let f = () => this.N * i;
>f : Symbol(f, Decl(capturedLetConstInLoop9_ES6.ts, 128, 15))
>this.N : Symbol(N, Decl(capturedLetConstInLoop9_ES6.ts, 125, 16))
>this : Symbol(C, Decl(capturedLetConstInLoop9_ES6.ts, 122, 1))
>N : Symbol(N, Decl(capturedLetConstInLoop9_ES6.ts, 125, 16))
>i : Symbol(i, Decl(capturedLetConstInLoop9_ES6.ts, 127, 16))
>f : Symbol(f, Decl(capturedLetConstInLoop9_ES6.ts, 126, 15))
>this.N : Symbol(N, Decl(capturedLetConstInLoop9_ES6.ts, 123, 16))
>this : Symbol(C, Decl(capturedLetConstInLoop9_ES6.ts, 120, 1))
>N : Symbol(N, Decl(capturedLetConstInLoop9_ES6.ts, 123, 16))
>i : Symbol(i, Decl(capturedLetConstInLoop9_ES6.ts, 125, 16))
}
}
}

function foo3 () {
>foo3 : Symbol(foo3, Decl(capturedLetConstInLoop9_ES6.ts, 131, 1))
>foo3 : Symbol(foo3, Decl(capturedLetConstInLoop9_ES6.ts, 129, 1))

let x = arguments.length;
>x : Symbol(x, Decl(capturedLetConstInLoop9_ES6.ts, 134, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop9_ES6.ts, 132, 7))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))

for (let y of []) {
>y : Symbol(y, Decl(capturedLetConstInLoop9_ES6.ts, 135, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop9_ES6.ts, 133, 12))

let z = arguments.length;
>z : Symbol(z, Decl(capturedLetConstInLoop9_ES6.ts, 136, 11))
>z : Symbol(z, Decl(capturedLetConstInLoop9_ES6.ts, 134, 11))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))

(function() { return y + z + arguments.length; });
>y : Symbol(y, Decl(capturedLetConstInLoop9_ES6.ts, 135, 12))
>z : Symbol(z, Decl(capturedLetConstInLoop9_ES6.ts, 136, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop9_ES6.ts, 133, 12))
>z : Symbol(z, Decl(capturedLetConstInLoop9_ES6.ts, 134, 11))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
Expand Down
7 changes: 3 additions & 4 deletions tests/baselines/reference/capturedLetConstInLoop9_ES6.types
Original file line number Diff line number Diff line change
Expand Up @@ -197,13 +197,12 @@ function foo() {
break l0;
>l0 : any
}

return 100;
>100 : number

() => b
>() => b : () => any
>b : any

return 100;
>100 : number
}


Expand Down
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.
0