From 85173a07d3cbcbe02566bbb1f8ba929a3b64b1a4 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Mon, 11 Apr 2016 12:17:59 -0700 Subject: [PATCH] Accepting existing baselines --- .../reference/downlevelLetConst18.errors.txt | 40 ++++++++++ .../reference/downlevelLetConst18.symbols | 59 --------------- .../reference/downlevelLetConst18.types | 73 ------------------- .../reference/downlevelLetConst19.errors.txt | 25 +++++++ .../reference/downlevelLetConst19.symbols | 42 ----------- .../reference/downlevelLetConst19.types | 49 ------------- 6 files changed, 65 insertions(+), 223 deletions(-) create mode 100644 tests/baselines/reference/downlevelLetConst18.errors.txt delete mode 100644 tests/baselines/reference/downlevelLetConst18.symbols delete mode 100644 tests/baselines/reference/downlevelLetConst18.types create mode 100644 tests/baselines/reference/downlevelLetConst19.errors.txt delete mode 100644 tests/baselines/reference/downlevelLetConst19.symbols delete mode 100644 tests/baselines/reference/downlevelLetConst19.types diff --git a/tests/baselines/reference/downlevelLetConst18.errors.txt b/tests/baselines/reference/downlevelLetConst18.errors.txt new file mode 100644 index 0000000000..e1abafd86c --- /dev/null +++ b/tests/baselines/reference/downlevelLetConst18.errors.txt @@ -0,0 +1,40 @@ +tests/cases/compiler/downlevelLetConst18.ts(5,14): error TS1250: In ES5 or lower, function declarations are not allowed in block scope in strict mode. +tests/cases/compiler/downlevelLetConst18.ts(9,14): error TS1250: In ES5 or lower, function declarations are not allowed in block scope in strict mode. + + +==== tests/cases/compiler/downlevelLetConst18.ts (2 errors) ==== + + 'use strict' + + for (let x; ;) { + function foo() { x }; + ~~~ +!!! error TS1250: In ES5 or lower, function declarations are not allowed in block scope in strict mode. + } + + for (let x; ;) { + function foo1() { x }; + ~~~~ +!!! error TS1250: In ES5 or lower, function declarations are not allowed in block scope in strict mode. + } + + for (let x; ;) { + (() => { x })(); + } + + for (const x = 1; ;) { + (() => { x })(); + } + + for (let x; ;) { + ({ foo() { x }}) + } + + for (let x; ;) { + ({ get foo() { return x } }) + } + + for (let x; ;) { + ({ set foo(v) { x } }) + } + \ No newline at end of file diff --git a/tests/baselines/reference/downlevelLetConst18.symbols b/tests/baselines/reference/downlevelLetConst18.symbols deleted file mode 100644 index a1df0dc6ae..0000000000 --- a/tests/baselines/reference/downlevelLetConst18.symbols +++ /dev/null @@ -1,59 +0,0 @@ -=== tests/cases/compiler/downlevelLetConst18.ts === - -'use strict' - -for (let x; ;) { ->x : Symbol(x, Decl(downlevelLetConst18.ts, 3, 8)) - - function foo() { x }; ->foo : Symbol(foo, Decl(downlevelLetConst18.ts, 3, 16)) ->x : Symbol(x, Decl(downlevelLetConst18.ts, 3, 8)) -} - -for (let x; ;) { ->x : Symbol(x, Decl(downlevelLetConst18.ts, 7, 8)) - - function foo1() { x }; ->foo1 : Symbol(foo1, Decl(downlevelLetConst18.ts, 7, 16)) ->x : Symbol(x, Decl(downlevelLetConst18.ts, 7, 8)) -} - -for (let x; ;) { ->x : Symbol(x, Decl(downlevelLetConst18.ts, 11, 8)) - - (() => { x })(); ->x : Symbol(x, Decl(downlevelLetConst18.ts, 11, 8)) -} - -for (const x = 1; ;) { ->x : Symbol(x, Decl(downlevelLetConst18.ts, 15, 10)) - - (() => { x })(); ->x : Symbol(x, Decl(downlevelLetConst18.ts, 15, 10)) -} - -for (let x; ;) { ->x : Symbol(x, Decl(downlevelLetConst18.ts, 19, 8)) - - ({ foo() { x }}) ->foo : Symbol(foo, Decl(downlevelLetConst18.ts, 20, 6)) ->x : Symbol(x, Decl(downlevelLetConst18.ts, 19, 8)) -} - -for (let x; ;) { ->x : Symbol(x, Decl(downlevelLetConst18.ts, 23, 8)) - - ({ get foo() { return x } }) ->foo : Symbol(foo, Decl(downlevelLetConst18.ts, 24, 6)) ->x : Symbol(x, Decl(downlevelLetConst18.ts, 23, 8)) -} - -for (let x; ;) { ->x : Symbol(x, Decl(downlevelLetConst18.ts, 27, 8)) - - ({ set foo(v) { x } }) ->foo : Symbol(foo, Decl(downlevelLetConst18.ts, 28, 6)) ->v : Symbol(v, Decl(downlevelLetConst18.ts, 28, 15)) ->x : Symbol(x, Decl(downlevelLetConst18.ts, 27, 8)) -} - diff --git a/tests/baselines/reference/downlevelLetConst18.types b/tests/baselines/reference/downlevelLetConst18.types deleted file mode 100644 index 1f7be61612..0000000000 --- a/tests/baselines/reference/downlevelLetConst18.types +++ /dev/null @@ -1,73 +0,0 @@ -=== tests/cases/compiler/downlevelLetConst18.ts === - -'use strict' ->'use strict' : string - -for (let x; ;) { ->x : any - - function foo() { x }; ->foo : () => void ->x : any -} - -for (let x; ;) { ->x : any - - function foo1() { x }; ->foo1 : () => void ->x : any -} - -for (let x; ;) { ->x : any - - (() => { x })(); ->(() => { x })() : void ->(() => { x }) : () => void ->() => { x } : () => void ->x : any -} - -for (const x = 1; ;) { ->x : number ->1 : number - - (() => { x })(); ->(() => { x })() : void ->(() => { x }) : () => void ->() => { x } : () => void ->x : number -} - -for (let x; ;) { ->x : any - - ({ foo() { x }}) ->({ foo() { x }}) : { foo(): void; } ->{ foo() { x }} : { foo(): void; } ->foo : () => void ->x : any -} - -for (let x; ;) { ->x : any - - ({ get foo() { return x } }) ->({ get foo() { return x } }) : { readonly foo: any; } ->{ get foo() { return x } } : { readonly foo: any; } ->foo : any ->x : any -} - -for (let x; ;) { ->x : any - - ({ set foo(v) { x } }) ->({ set foo(v) { x } }) : { foo: any; } ->{ set foo(v) { x } } : { foo: any; } ->foo : any ->v : any ->x : any -} - diff --git a/tests/baselines/reference/downlevelLetConst19.errors.txt b/tests/baselines/reference/downlevelLetConst19.errors.txt new file mode 100644 index 0000000000..03ad2dd470 --- /dev/null +++ b/tests/baselines/reference/downlevelLetConst19.errors.txt @@ -0,0 +1,25 @@ +tests/cases/compiler/downlevelLetConst19.ts(9,14): error TS1250: In ES5 or lower, function declarations are not allowed in block scope in strict mode. + + +==== tests/cases/compiler/downlevelLetConst19.ts (1 errors) ==== + 'use strict' + declare function use(a: any); + var x; + function a() { + { + let x; + use(x); + + function b() { + ~ +!!! error TS1250: In ES5 or lower, function declarations are not allowed in block scope in strict mode. + { + let x; + use(x); + } + use(x); + } + } + use(x) + } + use(x) \ No newline at end of file diff --git a/tests/baselines/reference/downlevelLetConst19.symbols b/tests/baselines/reference/downlevelLetConst19.symbols deleted file mode 100644 index 9ed23e4344..0000000000 --- a/tests/baselines/reference/downlevelLetConst19.symbols +++ /dev/null @@ -1,42 +0,0 @@ -=== tests/cases/compiler/downlevelLetConst19.ts === -'use strict' -declare function use(a: any); ->use : Symbol(use, Decl(downlevelLetConst19.ts, 0, 12)) ->a : Symbol(a, Decl(downlevelLetConst19.ts, 1, 21)) - -var x; ->x : Symbol(x, Decl(downlevelLetConst19.ts, 2, 3)) - -function a() { ->a : Symbol(a, Decl(downlevelLetConst19.ts, 2, 6)) - { - let x; ->x : Symbol(x, Decl(downlevelLetConst19.ts, 5, 7)) - - use(x); ->use : Symbol(use, Decl(downlevelLetConst19.ts, 0, 12)) ->x : Symbol(x, Decl(downlevelLetConst19.ts, 5, 7)) - - function b() { ->b : Symbol(b, Decl(downlevelLetConst19.ts, 6, 11)) - { - let x; ->x : Symbol(x, Decl(downlevelLetConst19.ts, 10, 15)) - - use(x); ->use : Symbol(use, Decl(downlevelLetConst19.ts, 0, 12)) ->x : Symbol(x, Decl(downlevelLetConst19.ts, 10, 15)) - } - use(x); ->use : Symbol(use, Decl(downlevelLetConst19.ts, 0, 12)) ->x : Symbol(x, Decl(downlevelLetConst19.ts, 5, 7)) - } - } - use(x) ->use : Symbol(use, Decl(downlevelLetConst19.ts, 0, 12)) ->x : Symbol(x, Decl(downlevelLetConst19.ts, 2, 3)) -} -use(x) ->use : Symbol(use, Decl(downlevelLetConst19.ts, 0, 12)) ->x : Symbol(x, Decl(downlevelLetConst19.ts, 2, 3)) - diff --git a/tests/baselines/reference/downlevelLetConst19.types b/tests/baselines/reference/downlevelLetConst19.types deleted file mode 100644 index 687033c195..0000000000 --- a/tests/baselines/reference/downlevelLetConst19.types +++ /dev/null @@ -1,49 +0,0 @@ -=== tests/cases/compiler/downlevelLetConst19.ts === -'use strict' ->'use strict' : string - -declare function use(a: any); ->use : (a: any) => any ->a : any - -var x; ->x : any - -function a() { ->a : () => void - { - let x; ->x : any - - use(x); ->use(x) : any ->use : (a: any) => any ->x : any - - function b() { ->b : () => void - { - let x; ->x : any - - use(x); ->use(x) : any ->use : (a: any) => any ->x : any - } - use(x); ->use(x) : any ->use : (a: any) => any ->x : any - } - } - use(x) ->use(x) : any ->use : (a: any) => any ->x : any -} -use(x) ->use(x) : any ->use : (a: any) => any ->x : any -