From fc7be363f1859475e8db30bfc8540eaa0f62e06c Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Thu, 16 Apr 2015 12:29:49 -0700 Subject: [PATCH 1/4] Added tests from 'captureArguments' branch. --- ...s => emitArrowFunctionWhenUsingArguments01.ts} | 2 +- ... emitArrowFunctionWhenUsingArguments01_ES6.ts} | 0 .../emitArrowFunctionWhenUsingArguments02.ts | 3 +++ .../emitArrowFunctionWhenUsingArguments02_ES6.ts | 3 +++ .../emitArrowFunctionWhenUsingArguments03.ts | 4 ++++ .../emitArrowFunctionWhenUsingArguments03_ES6.ts | 4 ++++ .../emitArrowFunctionWhenUsingArguments04.ts | 6 ++++++ .../emitArrowFunctionWhenUsingArguments04_ES6.ts | 6 ++++++ .../emitArrowFunctionWhenUsingArguments05.ts | 5 +++++ .../emitArrowFunctionWhenUsingArguments05_ES6.ts | 5 +++++ .../emitArrowFunctionWhenUsingArguments06.ts | 5 +++++ .../emitArrowFunctionWhenUsingArguments06_ES6.ts | 5 +++++ .../emitArrowFunctionWhenUsingArguments07.ts | 5 +++++ .../emitArrowFunctionWhenUsingArguments07_ES6.ts | 5 +++++ .../emitArrowFunctionWhenUsingArguments08.ts | 5 +++++ .../emitArrowFunctionWhenUsingArguments08_ES6.ts | 5 +++++ .../emitArrowFunctionWhenUsingArguments09.ts | 5 +++++ .../emitArrowFunctionWhenUsingArguments09_ES6.ts | 5 +++++ .../emitArrowFunctionWhenUsingArguments10.ts | 6 ++++++ .../emitArrowFunctionWhenUsingArguments10_ES6.ts | 6 ++++++ .../emitArrowFunctionWhenUsingArguments11.ts | 6 ++++++ .../emitArrowFunctionWhenUsingArguments11_ES6.ts | 6 ++++++ .../emitArrowFunctionWhenUsingArguments12.ts | 7 +++++++ .../emitArrowFunctionWhenUsingArguments12_ES6.ts | 7 +++++++ .../emitArrowFunctionWhenUsingArguments13.ts | 6 ++++++ .../emitArrowFunctionWhenUsingArguments13_ES6.ts | 6 ++++++ .../emitArrowFunctionWhenUsingArguments14.ts | 8 ++++++++ .../emitArrowFunctionWhenUsingArguments14_ES6.ts | 8 ++++++++ .../emitArrowFunctionWhenUsingArguments15.ts | 9 +++++++++ .../emitArrowFunctionWhenUsingArguments15_ES6.ts | 9 +++++++++ .../emitArrowFunctionWhenUsingArguments16.ts | 9 +++++++++ .../emitArrowFunctionWhenUsingArguments16_ES6.ts | 9 +++++++++ .../emitArrowFunctionWhenUsingArguments17.ts | 9 +++++++++ .../emitArrowFunctionWhenUsingArguments17_ES6.ts | 9 +++++++++ .../emitArrowFunctionWhenUsingArguments18.ts | 8 ++++++++ .../emitArrowFunctionWhenUsingArguments18_ES6.ts | 8 ++++++++ .../emitArrowFunctionWhenUsingArguments19.ts | 15 +++++++++++++++ .../emitArrowFunctionWhenUsingArguments19_ES6.ts | 15 +++++++++++++++ 38 files changed, 243 insertions(+), 1 deletion(-) rename tests/cases/conformance/es6/arrowFunction/{emitArrowFunctionWhenUsingArgumentsES6.ts => emitArrowFunctionWhenUsingArguments01.ts} (89%) rename tests/cases/conformance/es6/arrowFunction/{emitArrowFunctionWhenUsingArguments.ts => emitArrowFunctionWhenUsingArguments01_ES6.ts} (100%) create mode 100644 tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments02.ts create mode 100644 tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments02_ES6.ts create mode 100644 tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments03.ts create mode 100644 tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments03_ES6.ts create mode 100644 tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments04.ts create mode 100644 tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments04_ES6.ts create mode 100644 tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments05.ts create mode 100644 tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments05_ES6.ts create mode 100644 tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments06.ts create mode 100644 tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments06_ES6.ts create mode 100644 tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments07.ts create mode 100644 tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments07_ES6.ts create mode 100644 tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments08.ts create mode 100644 tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments08_ES6.ts create mode 100644 tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments09.ts create mode 100644 tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments09_ES6.ts create mode 100644 tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments10.ts create mode 100644 tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments10_ES6.ts create mode 100644 tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments11.ts create mode 100644 tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments11_ES6.ts create mode 100644 tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments12.ts create mode 100644 tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments12_ES6.ts create mode 100644 tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments13.ts create mode 100644 tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments13_ES6.ts create mode 100644 tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments14.ts create mode 100644 tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments14_ES6.ts create mode 100644 tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments15.ts create mode 100644 tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments15_ES6.ts create mode 100644 tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments16.ts create mode 100644 tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments16_ES6.ts create mode 100644 tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments17.ts create mode 100644 tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments17_ES6.ts create mode 100644 tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments18.ts create mode 100644 tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments18_ES6.ts create mode 100644 tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments19.ts create mode 100644 tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments19_ES6.ts diff --git a/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArgumentsES6.ts b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments01.ts similarity index 89% rename from tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArgumentsES6.ts rename to tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments01.ts index fa92d48a4c0..762fd2a8e64 100644 --- a/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArgumentsES6.ts +++ b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments01.ts @@ -1,4 +1,4 @@ -// @target: es6 +// @target: es5 var a = () => { var arg = arguments[0]; // error } diff --git a/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments.ts b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments01_ES6.ts similarity index 100% rename from tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments.ts rename to tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments01_ES6.ts diff --git a/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments02.ts b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments02.ts new file mode 100644 index 00000000000..565c211724a --- /dev/null +++ b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments02.ts @@ -0,0 +1,3 @@ +// @target: es5 + +var a = () => arguments; \ No newline at end of file diff --git a/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments02_ES6.ts b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments02_ES6.ts new file mode 100644 index 00000000000..5a466c5fcda --- /dev/null +++ b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments02_ES6.ts @@ -0,0 +1,3 @@ +// @target: es6 + +var a = () => arguments; \ No newline at end of file diff --git a/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments03.ts b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments03.ts new file mode 100644 index 00000000000..d0de2a8e7c8 --- /dev/null +++ b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments03.ts @@ -0,0 +1,4 @@ +// @target: es5 + +var arguments; +var a = () => arguments; \ No newline at end of file diff --git a/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments03_ES6.ts b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments03_ES6.ts new file mode 100644 index 00000000000..69b08adf7ae --- /dev/null +++ b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments03_ES6.ts @@ -0,0 +1,4 @@ +// @target: es6 + +var arguments; +var a = () => arguments; \ No newline at end of file diff --git a/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments04.ts b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments04.ts new file mode 100644 index 00000000000..cba24887da7 --- /dev/null +++ b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments04.ts @@ -0,0 +1,6 @@ +// @target: es5 + +function f() { + var arguments; + var a = () => arguments; +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments04_ES6.ts b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments04_ES6.ts new file mode 100644 index 00000000000..14f6540c091 --- /dev/null +++ b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments04_ES6.ts @@ -0,0 +1,6 @@ +// @target: es6 + +function f() { + var arguments; + var a = () => arguments; +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments05.ts b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments05.ts new file mode 100644 index 00000000000..e2adfeba0fe --- /dev/null +++ b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments05.ts @@ -0,0 +1,5 @@ +// @target: es5 + +function f(arguments) { + var a = () => arguments; +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments05_ES6.ts b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments05_ES6.ts new file mode 100644 index 00000000000..b256ed6cd53 --- /dev/null +++ b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments05_ES6.ts @@ -0,0 +1,5 @@ +// @target: es6 + +function f(arguments) { + var a = () => arguments; +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments06.ts b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments06.ts new file mode 100644 index 00000000000..e235671a01a --- /dev/null +++ b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments06.ts @@ -0,0 +1,5 @@ +// @target: es5 + +function f(arguments) { + var a = () => () => arguments; +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments06_ES6.ts b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments06_ES6.ts new file mode 100644 index 00000000000..6defc6ec4a3 --- /dev/null +++ b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments06_ES6.ts @@ -0,0 +1,5 @@ +// @target: es6 + +function f(arguments) { + var a = () => () => arguments; +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments07.ts b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments07.ts new file mode 100644 index 00000000000..07fa34a0731 --- /dev/null +++ b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments07.ts @@ -0,0 +1,5 @@ +// @target: es5 + +function f(arguments) { + var a = (arguments) => () => arguments; +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments07_ES6.ts b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments07_ES6.ts new file mode 100644 index 00000000000..889fc141021 --- /dev/null +++ b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments07_ES6.ts @@ -0,0 +1,5 @@ +// @target: es6 + +function f(arguments) { + var a = (arguments) => () => arguments; +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments08.ts b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments08.ts new file mode 100644 index 00000000000..c53b8701fdc --- /dev/null +++ b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments08.ts @@ -0,0 +1,5 @@ +// @target: es5 + +function f(arguments) { + var a = () => (arguments) => arguments; +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments08_ES6.ts b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments08_ES6.ts new file mode 100644 index 00000000000..feae67a22be --- /dev/null +++ b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments08_ES6.ts @@ -0,0 +1,5 @@ +// @target: es6 + +function f(arguments) { + var a = () => (arguments) => arguments; +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments09.ts b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments09.ts new file mode 100644 index 00000000000..06e305f4048 --- /dev/null +++ b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments09.ts @@ -0,0 +1,5 @@ +// @target: es5 + +function f(_arguments) { + var a = () => () => arguments; +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments09_ES6.ts b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments09_ES6.ts new file mode 100644 index 00000000000..c1b2f3d5cda --- /dev/null +++ b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments09_ES6.ts @@ -0,0 +1,5 @@ +// @target: es6 + +function f(_arguments) { + var a = () => () => arguments; +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments10.ts b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments10.ts new file mode 100644 index 00000000000..9122bb746b2 --- /dev/null +++ b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments10.ts @@ -0,0 +1,6 @@ +// @target: es5 + +function f() { + var _arguments = 10; + var a = () => () => arguments; +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments10_ES6.ts b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments10_ES6.ts new file mode 100644 index 00000000000..d5e616d5d28 --- /dev/null +++ b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments10_ES6.ts @@ -0,0 +1,6 @@ +// @target: es6 + +function f() { + var _arguments = 10; + var a = () => () => arguments; +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments11.ts b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments11.ts new file mode 100644 index 00000000000..37542b860f4 --- /dev/null +++ b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments11.ts @@ -0,0 +1,6 @@ +// @target: es5 + +function f(arguments) { + var _arguments = 10; + var a = () => () => arguments; +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments11_ES6.ts b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments11_ES6.ts new file mode 100644 index 00000000000..fb77b177b76 --- /dev/null +++ b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments11_ES6.ts @@ -0,0 +1,6 @@ +// @target: es6 + +function f(arguments) { + var _arguments = 10; + var a = () => () => arguments; +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments12.ts b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments12.ts new file mode 100644 index 00000000000..39c9994bbd1 --- /dev/null +++ b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments12.ts @@ -0,0 +1,7 @@ +// @target: es5 + +class C { + f(arguments) { + var a = () => arguments; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments12_ES6.ts b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments12_ES6.ts new file mode 100644 index 00000000000..cdfed56ae22 --- /dev/null +++ b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments12_ES6.ts @@ -0,0 +1,7 @@ +// @target: es6 + +class C { + f(arguments) { + var a = () => arguments; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments13.ts b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments13.ts new file mode 100644 index 00000000000..6f4c2fccf55 --- /dev/null +++ b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments13.ts @@ -0,0 +1,6 @@ +// @target: es5 + +function f() { + var _arguments = 10; + var a = (arguments) => () => _arguments; +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments13_ES6.ts b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments13_ES6.ts new file mode 100644 index 00000000000..c23a2b105fc --- /dev/null +++ b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments13_ES6.ts @@ -0,0 +1,6 @@ +// @target: es6 + +function f() { + var _arguments = 10; + var a = (arguments) => () => _arguments; +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments14.ts b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments14.ts new file mode 100644 index 00000000000..0f7cee8ab97 --- /dev/null +++ b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments14.ts @@ -0,0 +1,8 @@ +// @target: es5 + +function f() { + if (Math.random()) { + const arguments = 100; + return () => arguments; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments14_ES6.ts b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments14_ES6.ts new file mode 100644 index 00000000000..c8c9da2bb30 --- /dev/null +++ b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments14_ES6.ts @@ -0,0 +1,8 @@ +// @target: es6 + +function f() { + if (Math.random()) { + let arguments = 100; + return () => arguments; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments15.ts b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments15.ts new file mode 100644 index 00000000000..cc347f9d512 --- /dev/null +++ b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments15.ts @@ -0,0 +1,9 @@ +// @target: es5 + +function f() { + var arguments = "hello"; + if (Math.random()) { + const arguments = 100; + return () => arguments; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments15_ES6.ts b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments15_ES6.ts new file mode 100644 index 00000000000..056a51b8c1c --- /dev/null +++ b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments15_ES6.ts @@ -0,0 +1,9 @@ +// @target: es6 + +function f() { + var arguments = "hello"; + if (Math.random()) { + const arguments = 100; + return () => arguments; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments16.ts b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments16.ts new file mode 100644 index 00000000000..dbfd2c26e81 --- /dev/null +++ b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments16.ts @@ -0,0 +1,9 @@ +// @target: es5 + +function f() { + var arguments = "hello"; + if (Math.random()) { + return () => arguments[0]; + } + var arguments = "world"; +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments16_ES6.ts b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments16_ES6.ts new file mode 100644 index 00000000000..98261792871 --- /dev/null +++ b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments16_ES6.ts @@ -0,0 +1,9 @@ +// @target: es6 + +function f() { + var arguments = "hello"; + if (Math.random()) { + return () => arguments[0]; + } + var arguments = "world"; +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments17.ts b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments17.ts new file mode 100644 index 00000000000..77cbb07ede7 --- /dev/null +++ b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments17.ts @@ -0,0 +1,9 @@ +// @target: es5 + +function f() { + var { arguments } = { arguments: "hello" }; + if (Math.random()) { + return () => arguments[0]; + } + var arguments = "world"; +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments17_ES6.ts b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments17_ES6.ts new file mode 100644 index 00000000000..b27b6b4ba91 --- /dev/null +++ b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments17_ES6.ts @@ -0,0 +1,9 @@ +// @target: es6 + +function f() { + var { arguments } = { arguments: "hello" }; + if (Math.random()) { + return () => arguments[0]; + } + var arguments = "world"; +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments18.ts b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments18.ts new file mode 100644 index 00000000000..3d769ed6235 --- /dev/null +++ b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments18.ts @@ -0,0 +1,8 @@ +// @target: es5 + +function f() { + var { arguments: args } = { arguments }; + if (Math.random()) { + return () => arguments; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments18_ES6.ts b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments18_ES6.ts new file mode 100644 index 00000000000..0ec65f36d3b --- /dev/null +++ b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments18_ES6.ts @@ -0,0 +1,8 @@ +// @target: es6 + +function f() { + var { arguments: args } = { arguments }; + if (Math.random()) { + return () => arguments; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments19.ts b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments19.ts new file mode 100644 index 00000000000..a968ba28d9e --- /dev/null +++ b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments19.ts @@ -0,0 +1,15 @@ +// @target: es5 + +function f() { + function g() { + var _arguments = 10; // No capture in 'g', so no conflict. + function h() { + var capture = () => arguments; // Should trigger an '_arguments' capture into function 'h' + foo(_arguments); // Error as this does not resolve to the user defined '_arguments' + } + } + + function foo(x: any) { + return 100; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments19_ES6.ts b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments19_ES6.ts new file mode 100644 index 00000000000..50ede7a8e4d --- /dev/null +++ b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments19_ES6.ts @@ -0,0 +1,15 @@ +// @target: es6 + +function f() { + function g() { + var _arguments = 10; // No capture in 'g', so no conflict. + function h() { + var capture = () => arguments; // Should trigger an '_arguments' capture into function 'h' + foo(_arguments); // Error as this does not resolve to the user defined '_arguments' + } + } + + function foo(x: any) { + return 100; + } +} \ No newline at end of file From 42c66a159786517c552afcf72f762fbea061d085 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Thu, 16 Apr 2015 12:42:25 -0700 Subject: [PATCH 2/4] Add/rename baselines. --- ...owFunctionWhenUsingArguments01.errors.txt} | 10 +++---- ... emitArrowFunctionWhenUsingArguments01.js} | 14 ++++----- ...nctionWhenUsingArguments01_ES6.errors.txt} | 10 +++---- ...tArrowFunctionWhenUsingArguments01_ES6.js} | 4 +-- ...rowFunctionWhenUsingArguments02.errors.txt | 8 +++++ .../emitArrowFunctionWhenUsingArguments02.js | 6 ++++ ...unctionWhenUsingArguments02_ES6.errors.txt | 8 +++++ ...itArrowFunctionWhenUsingArguments02_ES6.js | 6 ++++ ...rowFunctionWhenUsingArguments03.errors.txt | 9 ++++++ .../emitArrowFunctionWhenUsingArguments03.js | 8 +++++ ...unctionWhenUsingArguments03_ES6.errors.txt | 9 ++++++ ...itArrowFunctionWhenUsingArguments03_ES6.js | 8 +++++ ...rowFunctionWhenUsingArguments04.errors.txt | 11 +++++++ .../emitArrowFunctionWhenUsingArguments04.js | 12 ++++++++ ...unctionWhenUsingArguments04_ES6.errors.txt | 11 +++++++ ...itArrowFunctionWhenUsingArguments04_ES6.js | 12 ++++++++ ...rowFunctionWhenUsingArguments05.errors.txt | 10 +++++++ .../emitArrowFunctionWhenUsingArguments05.js | 10 +++++++ ...unctionWhenUsingArguments05_ES6.errors.txt | 10 +++++++ ...itArrowFunctionWhenUsingArguments05_ES6.js | 10 +++++++ ...rowFunctionWhenUsingArguments06.errors.txt | 10 +++++++ .../emitArrowFunctionWhenUsingArguments06.js | 10 +++++++ ...unctionWhenUsingArguments06_ES6.errors.txt | 10 +++++++ ...itArrowFunctionWhenUsingArguments06_ES6.js | 10 +++++++ ...rowFunctionWhenUsingArguments07.errors.txt | 10 +++++++ .../emitArrowFunctionWhenUsingArguments07.js | 10 +++++++ ...unctionWhenUsingArguments07_ES6.errors.txt | 10 +++++++ ...itArrowFunctionWhenUsingArguments07_ES6.js | 10 +++++++ .../emitArrowFunctionWhenUsingArguments08.js | 10 +++++++ ...mitArrowFunctionWhenUsingArguments08.types | 13 +++++++++ ...itArrowFunctionWhenUsingArguments08_ES6.js | 10 +++++++ ...rrowFunctionWhenUsingArguments08_ES6.types | 13 +++++++++ ...rowFunctionWhenUsingArguments09.errors.txt | 10 +++++++ .../emitArrowFunctionWhenUsingArguments09.js | 10 +++++++ ...unctionWhenUsingArguments09_ES6.errors.txt | 10 +++++++ ...itArrowFunctionWhenUsingArguments09_ES6.js | 10 +++++++ ...rowFunctionWhenUsingArguments10.errors.txt | 11 +++++++ .../emitArrowFunctionWhenUsingArguments10.js | 12 ++++++++ ...unctionWhenUsingArguments10_ES6.errors.txt | 11 +++++++ ...itArrowFunctionWhenUsingArguments10_ES6.js | 12 ++++++++ ...rowFunctionWhenUsingArguments11.errors.txt | 11 +++++++ .../emitArrowFunctionWhenUsingArguments11.js | 12 ++++++++ ...unctionWhenUsingArguments11_ES6.errors.txt | 11 +++++++ ...itArrowFunctionWhenUsingArguments11_ES6.js | 12 ++++++++ ...rowFunctionWhenUsingArguments12.errors.txt | 15 ++++++++++ .../emitArrowFunctionWhenUsingArguments12.js | 17 +++++++++++ ...unctionWhenUsingArguments12_ES6.errors.txt | 15 ++++++++++ ...itArrowFunctionWhenUsingArguments12_ES6.js | 14 +++++++++ .../emitArrowFunctionWhenUsingArguments13.js | 12 ++++++++ ...mitArrowFunctionWhenUsingArguments13.types | 16 ++++++++++ ...itArrowFunctionWhenUsingArguments13_ES6.js | 12 ++++++++ ...rrowFunctionWhenUsingArguments13_ES6.types | 16 ++++++++++ ...rowFunctionWhenUsingArguments14.errors.txt | 13 +++++++++ .../emitArrowFunctionWhenUsingArguments14.js | 16 ++++++++++ ...unctionWhenUsingArguments14_ES6.errors.txt | 13 +++++++++ ...itArrowFunctionWhenUsingArguments14_ES6.js | 16 ++++++++++ ...rowFunctionWhenUsingArguments15.errors.txt | 14 +++++++++ .../emitArrowFunctionWhenUsingArguments15.js | 18 ++++++++++++ ...unctionWhenUsingArguments15_ES6.errors.txt | 14 +++++++++ ...itArrowFunctionWhenUsingArguments15_ES6.js | 18 ++++++++++++ ...rowFunctionWhenUsingArguments16.errors.txt | 14 +++++++++ .../emitArrowFunctionWhenUsingArguments16.js | 18 ++++++++++++ ...unctionWhenUsingArguments16_ES6.errors.txt | 14 +++++++++ ...itArrowFunctionWhenUsingArguments16_ES6.js | 18 ++++++++++++ ...rowFunctionWhenUsingArguments17.errors.txt | 14 +++++++++ .../emitArrowFunctionWhenUsingArguments17.js | 18 ++++++++++++ ...unctionWhenUsingArguments17_ES6.errors.txt | 14 +++++++++ ...itArrowFunctionWhenUsingArguments17_ES6.js | 18 ++++++++++++ ...rowFunctionWhenUsingArguments18.errors.txt | 13 +++++++++ .../emitArrowFunctionWhenUsingArguments18.js | 16 ++++++++++ ...unctionWhenUsingArguments18_ES6.errors.txt | 13 +++++++++ ...itArrowFunctionWhenUsingArguments18_ES6.js | 16 ++++++++++ ...rowFunctionWhenUsingArguments19.errors.txt | 20 +++++++++++++ .../emitArrowFunctionWhenUsingArguments19.js | 29 +++++++++++++++++++ ...unctionWhenUsingArguments19_ES6.errors.txt | 20 +++++++++++++ ...itArrowFunctionWhenUsingArguments19_ES6.js | 29 +++++++++++++++++++ 76 files changed, 948 insertions(+), 19 deletions(-) rename tests/baselines/reference/{emitArrowFunctionWhenUsingArgumentsES6.errors.txt => emitArrowFunctionWhenUsingArguments01.errors.txt} (76%) rename tests/baselines/reference/{emitArrowFunctionWhenUsingArgumentsES6.js => emitArrowFunctionWhenUsingArguments01.js} (78%) rename tests/baselines/reference/{emitArrowFunctionWhenUsingArguments.errors.txt => emitArrowFunctionWhenUsingArguments01_ES6.errors.txt} (67%) rename tests/baselines/reference/{emitArrowFunctionWhenUsingArguments.js => emitArrowFunctionWhenUsingArguments01_ES6.js} (86%) create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments02.errors.txt create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments02.js create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments02_ES6.errors.txt create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments02_ES6.js create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments03.errors.txt create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments03.js create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments03_ES6.errors.txt create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments03_ES6.js create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments04.errors.txt create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments04.js create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments04_ES6.errors.txt create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments04_ES6.js create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments05.errors.txt create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments05.js create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments05_ES6.errors.txt create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments05_ES6.js create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments06.errors.txt create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments06.js create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments06_ES6.errors.txt create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments06_ES6.js create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments07.errors.txt create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments07.js create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments07_ES6.errors.txt create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments07_ES6.js create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments08.js create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments08.types create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments08_ES6.js create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments08_ES6.types create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments09.errors.txt create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments09.js create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments09_ES6.errors.txt create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments09_ES6.js create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments10.errors.txt create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments10.js create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments10_ES6.errors.txt create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments10_ES6.js create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments11.errors.txt create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments11.js create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments11_ES6.errors.txt create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments11_ES6.js create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments12.errors.txt create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments12.js create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments12_ES6.errors.txt create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments12_ES6.js create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments13.js create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments13.types create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments13_ES6.js create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments13_ES6.types create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments14.errors.txt create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments14.js create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments14_ES6.errors.txt create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments14_ES6.js create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments15.errors.txt create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments15.js create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments15_ES6.errors.txt create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments15_ES6.js create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments16.errors.txt create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments16.js create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments16_ES6.errors.txt create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments16_ES6.js create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments17.errors.txt create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments17.js create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments17_ES6.errors.txt create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments17_ES6.js create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments18.errors.txt create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments18.js create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments18_ES6.errors.txt create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments18_ES6.js create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments19.errors.txt create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments19.js create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments19_ES6.errors.txt create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments19_ES6.js diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArgumentsES6.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments01.errors.txt similarity index 76% rename from tests/baselines/reference/emitArrowFunctionWhenUsingArgumentsES6.errors.txt rename to tests/baselines/reference/emitArrowFunctionWhenUsingArguments01.errors.txt index 26f204d3ee6..ddae6bca8a4 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArgumentsES6.errors.txt +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments01.errors.txt @@ -1,10 +1,10 @@ -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArgumentsES6.ts(2,15): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArgumentsES6.ts(7,19): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArgumentsES6.ts(13,13): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArgumentsES6.ts(19,15): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments01.ts(2,15): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments01.ts(7,19): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments01.ts(13,13): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments01.ts(19,15): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. -==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArgumentsES6.ts (4 errors) ==== +==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments01.ts (4 errors) ==== var a = () => { var arg = arguments[0]; // error ~~~~~~~~~ diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArgumentsES6.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments01.js similarity index 78% rename from tests/baselines/reference/emitArrowFunctionWhenUsingArgumentsES6.js rename to tests/baselines/reference/emitArrowFunctionWhenUsingArguments01.js index 2f84d0843de..40a2748fdae 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArgumentsES6.js +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments01.js @@ -1,4 +1,4 @@ -//// [emitArrowFunctionWhenUsingArgumentsES6.ts] +//// [emitArrowFunctionWhenUsingArguments01.ts] var a = () => { var arg = arguments[0]; // error } @@ -31,28 +31,28 @@ function bar() { } } -//// [emitArrowFunctionWhenUsingArgumentsES6.js] -var a = () => { +//// [emitArrowFunctionWhenUsingArguments01.js] +var a = function () { var arg = arguments[0]; // error }; var b = function () { - var a = () => { + var a = function () { var arg = arguments[0]; // error }; }; function baz() { - (() => { + (function () { var arg = arguments[0]; }); } function foo(inputFunc) { } -foo(() => { +foo(function () { var arg = arguments[0]; // error }); function bar() { var arg = arguments[0]; // no error } -(() => { +(function () { function foo() { var arg = arguments[0]; // no error } diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments01_ES6.errors.txt similarity index 67% rename from tests/baselines/reference/emitArrowFunctionWhenUsingArguments.errors.txt rename to tests/baselines/reference/emitArrowFunctionWhenUsingArguments01_ES6.errors.txt index 2f5ca2a387c..3eb07e965ba 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments.errors.txt +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments01_ES6.errors.txt @@ -1,10 +1,10 @@ -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments.ts(2,15): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments.ts(7,19): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments.ts(13,13): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments.ts(19,15): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments01_ES6.ts(2,15): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments01_ES6.ts(7,19): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments01_ES6.ts(13,13): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments01_ES6.ts(19,15): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. -==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments.ts (4 errors) ==== +==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments01_ES6.ts (4 errors) ==== var a = () => { var arg = arguments[0]; // error ~~~~~~~~~ diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments01_ES6.js similarity index 86% rename from tests/baselines/reference/emitArrowFunctionWhenUsingArguments.js rename to tests/baselines/reference/emitArrowFunctionWhenUsingArguments01_ES6.js index 589449fad62..6641e28b867 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments.js +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments01_ES6.js @@ -1,4 +1,4 @@ -//// [emitArrowFunctionWhenUsingArguments.ts] +//// [emitArrowFunctionWhenUsingArguments01_ES6.ts] var a = () => { var arg = arguments[0]; // error } @@ -31,7 +31,7 @@ function bar() { } } -//// [emitArrowFunctionWhenUsingArguments.js] +//// [emitArrowFunctionWhenUsingArguments01_ES6.js] var a = () => { var arg = arguments[0]; // error }; diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments02.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments02.errors.txt new file mode 100644 index 00000000000..47ffcccd216 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments02.errors.txt @@ -0,0 +1,8 @@ +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments02.ts(2,15): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. + + +==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments02.ts (1 errors) ==== + + var a = () => arguments; + ~~~~~~~~~ +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments02.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments02.js new file mode 100644 index 00000000000..b6774dd5407 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments02.js @@ -0,0 +1,6 @@ +//// [emitArrowFunctionWhenUsingArguments02.ts] + +var a = () => arguments; + +//// [emitArrowFunctionWhenUsingArguments02.js] +var a = function () { return arguments; }; diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments02_ES6.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments02_ES6.errors.txt new file mode 100644 index 00000000000..860700e0086 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments02_ES6.errors.txt @@ -0,0 +1,8 @@ +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments02_ES6.ts(2,15): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. + + +==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments02_ES6.ts (1 errors) ==== + + var a = () => arguments; + ~~~~~~~~~ +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments02_ES6.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments02_ES6.js new file mode 100644 index 00000000000..0f35b8898b2 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments02_ES6.js @@ -0,0 +1,6 @@ +//// [emitArrowFunctionWhenUsingArguments02_ES6.ts] + +var a = () => arguments; + +//// [emitArrowFunctionWhenUsingArguments02_ES6.js] +var a = () => arguments; diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments03.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments03.errors.txt new file mode 100644 index 00000000000..153ea8003e0 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments03.errors.txt @@ -0,0 +1,9 @@ +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments03.ts(3,15): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. + + +==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments03.ts (1 errors) ==== + + var arguments; + var a = () => arguments; + ~~~~~~~~~ +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments03.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments03.js new file mode 100644 index 00000000000..5b57f7acf0d --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments03.js @@ -0,0 +1,8 @@ +//// [emitArrowFunctionWhenUsingArguments03.ts] + +var arguments; +var a = () => arguments; + +//// [emitArrowFunctionWhenUsingArguments03.js] +var arguments; +var a = function () { return arguments; }; diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments03_ES6.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments03_ES6.errors.txt new file mode 100644 index 00000000000..60b752bc569 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments03_ES6.errors.txt @@ -0,0 +1,9 @@ +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments03_ES6.ts(3,15): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. + + +==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments03_ES6.ts (1 errors) ==== + + var arguments; + var a = () => arguments; + ~~~~~~~~~ +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments03_ES6.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments03_ES6.js new file mode 100644 index 00000000000..d4d35e7abdc --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments03_ES6.js @@ -0,0 +1,8 @@ +//// [emitArrowFunctionWhenUsingArguments03_ES6.ts] + +var arguments; +var a = () => arguments; + +//// [emitArrowFunctionWhenUsingArguments03_ES6.js] +var arguments; +var a = () => arguments; diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments04.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments04.errors.txt new file mode 100644 index 00000000000..2c7a08d7479 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments04.errors.txt @@ -0,0 +1,11 @@ +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments04.ts(4,19): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. + + +==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments04.ts (1 errors) ==== + + function f() { + var arguments; + var a = () => arguments; + ~~~~~~~~~ +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. + } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments04.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments04.js new file mode 100644 index 00000000000..588610a4022 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments04.js @@ -0,0 +1,12 @@ +//// [emitArrowFunctionWhenUsingArguments04.ts] + +function f() { + var arguments; + var a = () => arguments; +} + +//// [emitArrowFunctionWhenUsingArguments04.js] +function f() { + var arguments; + var a = function () { return arguments; }; +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments04_ES6.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments04_ES6.errors.txt new file mode 100644 index 00000000000..8ff3b9bc16e --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments04_ES6.errors.txt @@ -0,0 +1,11 @@ +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments04_ES6.ts(4,19): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. + + +==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments04_ES6.ts (1 errors) ==== + + function f() { + var arguments; + var a = () => arguments; + ~~~~~~~~~ +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. + } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments04_ES6.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments04_ES6.js new file mode 100644 index 00000000000..63e896039c9 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments04_ES6.js @@ -0,0 +1,12 @@ +//// [emitArrowFunctionWhenUsingArguments04_ES6.ts] + +function f() { + var arguments; + var a = () => arguments; +} + +//// [emitArrowFunctionWhenUsingArguments04_ES6.js] +function f() { + var arguments; + var a = () => arguments; +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments05.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments05.errors.txt new file mode 100644 index 00000000000..8802a13e539 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments05.errors.txt @@ -0,0 +1,10 @@ +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments05.ts(3,19): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. + + +==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments05.ts (1 errors) ==== + + function f(arguments) { + var a = () => arguments; + ~~~~~~~~~ +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. + } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments05.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments05.js new file mode 100644 index 00000000000..b4ed2b383b7 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments05.js @@ -0,0 +1,10 @@ +//// [emitArrowFunctionWhenUsingArguments05.ts] + +function f(arguments) { + var a = () => arguments; +} + +//// [emitArrowFunctionWhenUsingArguments05.js] +function f(arguments) { + var a = function () { return arguments; }; +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments05_ES6.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments05_ES6.errors.txt new file mode 100644 index 00000000000..bd13e0a36a7 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments05_ES6.errors.txt @@ -0,0 +1,10 @@ +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments05_ES6.ts(3,19): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. + + +==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments05_ES6.ts (1 errors) ==== + + function f(arguments) { + var a = () => arguments; + ~~~~~~~~~ +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. + } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments05_ES6.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments05_ES6.js new file mode 100644 index 00000000000..9fe68e9bb48 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments05_ES6.js @@ -0,0 +1,10 @@ +//// [emitArrowFunctionWhenUsingArguments05_ES6.ts] + +function f(arguments) { + var a = () => arguments; +} + +//// [emitArrowFunctionWhenUsingArguments05_ES6.js] +function f(arguments) { + var a = () => arguments; +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments06.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments06.errors.txt new file mode 100644 index 00000000000..138f9486d19 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments06.errors.txt @@ -0,0 +1,10 @@ +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments06.ts(3,25): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. + + +==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments06.ts (1 errors) ==== + + function f(arguments) { + var a = () => () => arguments; + ~~~~~~~~~ +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. + } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments06.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments06.js new file mode 100644 index 00000000000..d004b77e947 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments06.js @@ -0,0 +1,10 @@ +//// [emitArrowFunctionWhenUsingArguments06.ts] + +function f(arguments) { + var a = () => () => arguments; +} + +//// [emitArrowFunctionWhenUsingArguments06.js] +function f(arguments) { + var a = function () { return function () { return arguments; }; }; +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments06_ES6.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments06_ES6.errors.txt new file mode 100644 index 00000000000..08b9c64b49b --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments06_ES6.errors.txt @@ -0,0 +1,10 @@ +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments06_ES6.ts(3,25): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. + + +==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments06_ES6.ts (1 errors) ==== + + function f(arguments) { + var a = () => () => arguments; + ~~~~~~~~~ +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. + } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments06_ES6.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments06_ES6.js new file mode 100644 index 00000000000..6b83e0c60d9 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments06_ES6.js @@ -0,0 +1,10 @@ +//// [emitArrowFunctionWhenUsingArguments06_ES6.ts] + +function f(arguments) { + var a = () => () => arguments; +} + +//// [emitArrowFunctionWhenUsingArguments06_ES6.js] +function f(arguments) { + var a = () => () => arguments; +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments07.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments07.errors.txt new file mode 100644 index 00000000000..a9c9638780e --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments07.errors.txt @@ -0,0 +1,10 @@ +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments07.ts(3,34): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. + + +==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments07.ts (1 errors) ==== + + function f(arguments) { + var a = (arguments) => () => arguments; + ~~~~~~~~~ +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. + } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments07.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments07.js new file mode 100644 index 00000000000..7f06036dfc1 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments07.js @@ -0,0 +1,10 @@ +//// [emitArrowFunctionWhenUsingArguments07.ts] + +function f(arguments) { + var a = (arguments) => () => arguments; +} + +//// [emitArrowFunctionWhenUsingArguments07.js] +function f(arguments) { + var a = function (arguments) { return function () { return arguments; }; }; +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments07_ES6.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments07_ES6.errors.txt new file mode 100644 index 00000000000..51cac68f529 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments07_ES6.errors.txt @@ -0,0 +1,10 @@ +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments07_ES6.ts(3,34): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. + + +==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments07_ES6.ts (1 errors) ==== + + function f(arguments) { + var a = (arguments) => () => arguments; + ~~~~~~~~~ +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. + } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments07_ES6.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments07_ES6.js new file mode 100644 index 00000000000..bdc8cf82d44 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments07_ES6.js @@ -0,0 +1,10 @@ +//// [emitArrowFunctionWhenUsingArguments07_ES6.ts] + +function f(arguments) { + var a = (arguments) => () => arguments; +} + +//// [emitArrowFunctionWhenUsingArguments07_ES6.js] +function f(arguments) { + var a = (arguments) => () => arguments; +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments08.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments08.js new file mode 100644 index 00000000000..dbb89d4eb6b --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments08.js @@ -0,0 +1,10 @@ +//// [emitArrowFunctionWhenUsingArguments08.ts] + +function f(arguments) { + var a = () => (arguments) => arguments; +} + +//// [emitArrowFunctionWhenUsingArguments08.js] +function f(arguments) { + var a = function () { return function (arguments) { return arguments; }; }; +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments08.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments08.types new file mode 100644 index 00000000000..4b6d1e19b4a --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments08.types @@ -0,0 +1,13 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments08.ts === + +function f(arguments) { +>f : (arguments: any) => void +>arguments : any + + var a = () => (arguments) => arguments; +>a : () => (arguments: any) => any +>() => (arguments) => arguments : () => (arguments: any) => any +>(arguments) => arguments : (arguments: any) => any +>arguments : any +>arguments : any +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments08_ES6.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments08_ES6.js new file mode 100644 index 00000000000..ee568185c0a --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments08_ES6.js @@ -0,0 +1,10 @@ +//// [emitArrowFunctionWhenUsingArguments08_ES6.ts] + +function f(arguments) { + var a = () => (arguments) => arguments; +} + +//// [emitArrowFunctionWhenUsingArguments08_ES6.js] +function f(arguments) { + var a = () => (arguments) => arguments; +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments08_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments08_ES6.types new file mode 100644 index 00000000000..ffa0f7f0bca --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments08_ES6.types @@ -0,0 +1,13 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments08_ES6.ts === + +function f(arguments) { +>f : (arguments: any) => void +>arguments : any + + var a = () => (arguments) => arguments; +>a : () => (arguments: any) => any +>() => (arguments) => arguments : () => (arguments: any) => any +>(arguments) => arguments : (arguments: any) => any +>arguments : any +>arguments : any +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments09.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments09.errors.txt new file mode 100644 index 00000000000..c5908cac978 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments09.errors.txt @@ -0,0 +1,10 @@ +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments09.ts(3,25): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. + + +==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments09.ts (1 errors) ==== + + function f(_arguments) { + var a = () => () => arguments; + ~~~~~~~~~ +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. + } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments09.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments09.js new file mode 100644 index 00000000000..c879e6f1ce9 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments09.js @@ -0,0 +1,10 @@ +//// [emitArrowFunctionWhenUsingArguments09.ts] + +function f(_arguments) { + var a = () => () => arguments; +} + +//// [emitArrowFunctionWhenUsingArguments09.js] +function f(_arguments) { + var a = function () { return function () { return arguments; }; }; +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments09_ES6.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments09_ES6.errors.txt new file mode 100644 index 00000000000..20f316a0a4c --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments09_ES6.errors.txt @@ -0,0 +1,10 @@ +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments09_ES6.ts(3,25): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. + + +==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments09_ES6.ts (1 errors) ==== + + function f(_arguments) { + var a = () => () => arguments; + ~~~~~~~~~ +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. + } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments09_ES6.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments09_ES6.js new file mode 100644 index 00000000000..15932510d39 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments09_ES6.js @@ -0,0 +1,10 @@ +//// [emitArrowFunctionWhenUsingArguments09_ES6.ts] + +function f(_arguments) { + var a = () => () => arguments; +} + +//// [emitArrowFunctionWhenUsingArguments09_ES6.js] +function f(_arguments) { + var a = () => () => arguments; +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments10.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments10.errors.txt new file mode 100644 index 00000000000..4267d0d923f --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments10.errors.txt @@ -0,0 +1,11 @@ +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments10.ts(4,25): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. + + +==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments10.ts (1 errors) ==== + + function f() { + var _arguments = 10; + var a = () => () => arguments; + ~~~~~~~~~ +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. + } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments10.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments10.js new file mode 100644 index 00000000000..a0da99f796c --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments10.js @@ -0,0 +1,12 @@ +//// [emitArrowFunctionWhenUsingArguments10.ts] + +function f() { + var _arguments = 10; + var a = () => () => arguments; +} + +//// [emitArrowFunctionWhenUsingArguments10.js] +function f() { + var _arguments = 10; + var a = function () { return function () { return arguments; }; }; +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments10_ES6.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments10_ES6.errors.txt new file mode 100644 index 00000000000..348e1088643 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments10_ES6.errors.txt @@ -0,0 +1,11 @@ +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments10_ES6.ts(4,25): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. + + +==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments10_ES6.ts (1 errors) ==== + + function f() { + var _arguments = 10; + var a = () => () => arguments; + ~~~~~~~~~ +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. + } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments10_ES6.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments10_ES6.js new file mode 100644 index 00000000000..83d2b735829 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments10_ES6.js @@ -0,0 +1,12 @@ +//// [emitArrowFunctionWhenUsingArguments10_ES6.ts] + +function f() { + var _arguments = 10; + var a = () => () => arguments; +} + +//// [emitArrowFunctionWhenUsingArguments10_ES6.js] +function f() { + var _arguments = 10; + var a = () => () => arguments; +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments11.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments11.errors.txt new file mode 100644 index 00000000000..3b63ccd44a2 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments11.errors.txt @@ -0,0 +1,11 @@ +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments11.ts(4,25): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. + + +==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments11.ts (1 errors) ==== + + function f(arguments) { + var _arguments = 10; + var a = () => () => arguments; + ~~~~~~~~~ +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. + } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments11.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments11.js new file mode 100644 index 00000000000..13c1c771c34 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments11.js @@ -0,0 +1,12 @@ +//// [emitArrowFunctionWhenUsingArguments11.ts] + +function f(arguments) { + var _arguments = 10; + var a = () => () => arguments; +} + +//// [emitArrowFunctionWhenUsingArguments11.js] +function f(arguments) { + var _arguments = 10; + var a = function () { return function () { return arguments; }; }; +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments11_ES6.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments11_ES6.errors.txt new file mode 100644 index 00000000000..1dbeff0c45e --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments11_ES6.errors.txt @@ -0,0 +1,11 @@ +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments11_ES6.ts(4,25): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. + + +==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments11_ES6.ts (1 errors) ==== + + function f(arguments) { + var _arguments = 10; + var a = () => () => arguments; + ~~~~~~~~~ +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. + } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments11_ES6.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments11_ES6.js new file mode 100644 index 00000000000..9616d2d351c --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments11_ES6.js @@ -0,0 +1,12 @@ +//// [emitArrowFunctionWhenUsingArguments11_ES6.ts] + +function f(arguments) { + var _arguments = 10; + var a = () => () => arguments; +} + +//// [emitArrowFunctionWhenUsingArguments11_ES6.js] +function f(arguments) { + var _arguments = 10; + var a = () => () => arguments; +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments12.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments12.errors.txt new file mode 100644 index 00000000000..f641faebcca --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments12.errors.txt @@ -0,0 +1,15 @@ +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments12.ts(3,7): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments12.ts(4,23): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. + + +==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments12.ts (2 errors) ==== + + class C { + f(arguments) { + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. + var a = () => arguments; + ~~~~~~~~~ +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments12.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments12.js new file mode 100644 index 00000000000..df4fddd3b32 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments12.js @@ -0,0 +1,17 @@ +//// [emitArrowFunctionWhenUsingArguments12.ts] + +class C { + f(arguments) { + var a = () => arguments; + } +} + +//// [emitArrowFunctionWhenUsingArguments12.js] +var C = (function () { + function C() { + } + C.prototype.f = function (arguments) { + var a = function () { return arguments; }; + }; + return C; +})(); diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments12_ES6.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments12_ES6.errors.txt new file mode 100644 index 00000000000..bcc926d83eb --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments12_ES6.errors.txt @@ -0,0 +1,15 @@ +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments12_ES6.ts(3,7): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments12_ES6.ts(4,23): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. + + +==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments12_ES6.ts (2 errors) ==== + + class C { + f(arguments) { + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. + var a = () => arguments; + ~~~~~~~~~ +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments12_ES6.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments12_ES6.js new file mode 100644 index 00000000000..8e7631f6fed --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments12_ES6.js @@ -0,0 +1,14 @@ +//// [emitArrowFunctionWhenUsingArguments12_ES6.ts] + +class C { + f(arguments) { + var a = () => arguments; + } +} + +//// [emitArrowFunctionWhenUsingArguments12_ES6.js] +class C { + f(arguments) { + var a = () => arguments; + } +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments13.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments13.js new file mode 100644 index 00000000000..ead0a96dacd --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments13.js @@ -0,0 +1,12 @@ +//// [emitArrowFunctionWhenUsingArguments13.ts] + +function f() { + var _arguments = 10; + var a = (arguments) => () => _arguments; +} + +//// [emitArrowFunctionWhenUsingArguments13.js] +function f() { + var _arguments = 10; + var a = function (arguments) { return function () { return _arguments; }; }; +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments13.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments13.types new file mode 100644 index 00000000000..6e5a7555315 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments13.types @@ -0,0 +1,16 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments13.ts === + +function f() { +>f : () => void + + var _arguments = 10; +>_arguments : number +>10 : number + + var a = (arguments) => () => _arguments; +>a : (arguments: any) => () => number +>(arguments) => () => _arguments : (arguments: any) => () => number +>arguments : any +>() => _arguments : () => number +>_arguments : number +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments13_ES6.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments13_ES6.js new file mode 100644 index 00000000000..818d27a1f57 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments13_ES6.js @@ -0,0 +1,12 @@ +//// [emitArrowFunctionWhenUsingArguments13_ES6.ts] + +function f() { + var _arguments = 10; + var a = (arguments) => () => _arguments; +} + +//// [emitArrowFunctionWhenUsingArguments13_ES6.js] +function f() { + var _arguments = 10; + var a = (arguments) => () => _arguments; +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments13_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments13_ES6.types new file mode 100644 index 00000000000..294f5c692e4 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments13_ES6.types @@ -0,0 +1,16 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments13_ES6.ts === + +function f() { +>f : () => void + + var _arguments = 10; +>_arguments : number +>10 : number + + var a = (arguments) => () => _arguments; +>a : (arguments: any) => () => number +>(arguments) => () => _arguments : (arguments: any) => () => number +>arguments : any +>() => _arguments : () => number +>_arguments : number +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14.errors.txt new file mode 100644 index 00000000000..ceb03631830 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14.errors.txt @@ -0,0 +1,13 @@ +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments14.ts(5,22): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. + + +==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments14.ts (1 errors) ==== + + function f() { + if (Math.random()) { + const arguments = 100; + return () => arguments; + ~~~~~~~~~ +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14.js new file mode 100644 index 00000000000..bd94a2fda9c --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14.js @@ -0,0 +1,16 @@ +//// [emitArrowFunctionWhenUsingArguments14.ts] + +function f() { + if (Math.random()) { + const arguments = 100; + return () => arguments; + } +} + +//// [emitArrowFunctionWhenUsingArguments14.js] +function f() { + if (Math.random()) { + var arguments_1 = 100; + return function () { return arguments; }; + } +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14_ES6.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14_ES6.errors.txt new file mode 100644 index 00000000000..d71a2518c07 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14_ES6.errors.txt @@ -0,0 +1,13 @@ +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments14_ES6.ts(5,22): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. + + +==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments14_ES6.ts (1 errors) ==== + + function f() { + if (Math.random()) { + let arguments = 100; + return () => arguments; + ~~~~~~~~~ +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14_ES6.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14_ES6.js new file mode 100644 index 00000000000..cea4589debb --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14_ES6.js @@ -0,0 +1,16 @@ +//// [emitArrowFunctionWhenUsingArguments14_ES6.ts] + +function f() { + if (Math.random()) { + let arguments = 100; + return () => arguments; + } +} + +//// [emitArrowFunctionWhenUsingArguments14_ES6.js] +function f() { + if (Math.random()) { + let arguments = 100; + return () => arguments; + } +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15.errors.txt new file mode 100644 index 00000000000..af684202b2f --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15.errors.txt @@ -0,0 +1,14 @@ +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments15.ts(6,22): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. + + +==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments15.ts (1 errors) ==== + + function f() { + var arguments = "hello"; + if (Math.random()) { + const arguments = 100; + return () => arguments; + ~~~~~~~~~ +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15.js new file mode 100644 index 00000000000..bc5f7dca7ee --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15.js @@ -0,0 +1,18 @@ +//// [emitArrowFunctionWhenUsingArguments15.ts] + +function f() { + var arguments = "hello"; + if (Math.random()) { + const arguments = 100; + return () => arguments; + } +} + +//// [emitArrowFunctionWhenUsingArguments15.js] +function f() { + var arguments = "hello"; + if (Math.random()) { + var arguments_1 = 100; + return function () { return arguments; }; + } +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15_ES6.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15_ES6.errors.txt new file mode 100644 index 00000000000..d26b919c16d --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15_ES6.errors.txt @@ -0,0 +1,14 @@ +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments15_ES6.ts(6,22): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. + + +==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments15_ES6.ts (1 errors) ==== + + function f() { + var arguments = "hello"; + if (Math.random()) { + const arguments = 100; + return () => arguments; + ~~~~~~~~~ +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15_ES6.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15_ES6.js new file mode 100644 index 00000000000..0fa3c9d5f64 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15_ES6.js @@ -0,0 +1,18 @@ +//// [emitArrowFunctionWhenUsingArguments15_ES6.ts] + +function f() { + var arguments = "hello"; + if (Math.random()) { + const arguments = 100; + return () => arguments; + } +} + +//// [emitArrowFunctionWhenUsingArguments15_ES6.js] +function f() { + var arguments = "hello"; + if (Math.random()) { + const arguments = 100; + return () => arguments; + } +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16.errors.txt new file mode 100644 index 00000000000..39ce66e2ce5 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16.errors.txt @@ -0,0 +1,14 @@ +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments16.ts(5,22): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. + + +==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments16.ts (1 errors) ==== + + function f() { + var arguments = "hello"; + if (Math.random()) { + return () => arguments[0]; + ~~~~~~~~~ +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. + } + var arguments = "world"; + } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16.js new file mode 100644 index 00000000000..0a87a3c6ac2 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16.js @@ -0,0 +1,18 @@ +//// [emitArrowFunctionWhenUsingArguments16.ts] + +function f() { + var arguments = "hello"; + if (Math.random()) { + return () => arguments[0]; + } + var arguments = "world"; +} + +//// [emitArrowFunctionWhenUsingArguments16.js] +function f() { + var arguments = "hello"; + if (Math.random()) { + return function () { return arguments[0]; }; + } + var arguments = "world"; +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16_ES6.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16_ES6.errors.txt new file mode 100644 index 00000000000..f3beb7f21b7 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16_ES6.errors.txt @@ -0,0 +1,14 @@ +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments16_ES6.ts(5,22): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. + + +==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments16_ES6.ts (1 errors) ==== + + function f() { + var arguments = "hello"; + if (Math.random()) { + return () => arguments[0]; + ~~~~~~~~~ +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. + } + var arguments = "world"; + } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16_ES6.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16_ES6.js new file mode 100644 index 00000000000..b9aaf7240a7 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16_ES6.js @@ -0,0 +1,18 @@ +//// [emitArrowFunctionWhenUsingArguments16_ES6.ts] + +function f() { + var arguments = "hello"; + if (Math.random()) { + return () => arguments[0]; + } + var arguments = "world"; +} + +//// [emitArrowFunctionWhenUsingArguments16_ES6.js] +function f() { + var arguments = "hello"; + if (Math.random()) { + return () => arguments[0]; + } + var arguments = "world"; +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17.errors.txt new file mode 100644 index 00000000000..3d53f02a286 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17.errors.txt @@ -0,0 +1,14 @@ +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments17.ts(5,22): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. + + +==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments17.ts (1 errors) ==== + + function f() { + var { arguments } = { arguments: "hello" }; + if (Math.random()) { + return () => arguments[0]; + ~~~~~~~~~ +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. + } + var arguments = "world"; + } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17.js new file mode 100644 index 00000000000..8a845ab0cb2 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17.js @@ -0,0 +1,18 @@ +//// [emitArrowFunctionWhenUsingArguments17.ts] + +function f() { + var { arguments } = { arguments: "hello" }; + if (Math.random()) { + return () => arguments[0]; + } + var arguments = "world"; +} + +//// [emitArrowFunctionWhenUsingArguments17.js] +function f() { + var arguments = { arguments: "hello" }.arguments; + if (Math.random()) { + return function () { return arguments[0]; }; + } + var arguments = "world"; +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17_ES6.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17_ES6.errors.txt new file mode 100644 index 00000000000..2082323f158 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17_ES6.errors.txt @@ -0,0 +1,14 @@ +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments17_ES6.ts(5,22): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. + + +==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments17_ES6.ts (1 errors) ==== + + function f() { + var { arguments } = { arguments: "hello" }; + if (Math.random()) { + return () => arguments[0]; + ~~~~~~~~~ +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. + } + var arguments = "world"; + } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17_ES6.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17_ES6.js new file mode 100644 index 00000000000..1d1a8ece338 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17_ES6.js @@ -0,0 +1,18 @@ +//// [emitArrowFunctionWhenUsingArguments17_ES6.ts] + +function f() { + var { arguments } = { arguments: "hello" }; + if (Math.random()) { + return () => arguments[0]; + } + var arguments = "world"; +} + +//// [emitArrowFunctionWhenUsingArguments17_ES6.js] +function f() { + var { arguments } = { arguments: "hello" }; + if (Math.random()) { + return () => arguments[0]; + } + var arguments = "world"; +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments18.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments18.errors.txt new file mode 100644 index 00000000000..4827559f277 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments18.errors.txt @@ -0,0 +1,13 @@ +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments18.ts(5,22): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. + + +==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments18.ts (1 errors) ==== + + function f() { + var { arguments: args } = { arguments }; + if (Math.random()) { + return () => arguments; + ~~~~~~~~~ +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments18.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments18.js new file mode 100644 index 00000000000..dc40302892b --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments18.js @@ -0,0 +1,16 @@ +//// [emitArrowFunctionWhenUsingArguments18.ts] + +function f() { + var { arguments: args } = { arguments }; + if (Math.random()) { + return () => arguments; + } +} + +//// [emitArrowFunctionWhenUsingArguments18.js] +function f() { + var args = { arguments: arguments }.arguments; + if (Math.random()) { + return function () { return arguments; }; + } +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments18_ES6.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments18_ES6.errors.txt new file mode 100644 index 00000000000..b73e4399587 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments18_ES6.errors.txt @@ -0,0 +1,13 @@ +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments18_ES6.ts(5,22): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. + + +==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments18_ES6.ts (1 errors) ==== + + function f() { + var { arguments: args } = { arguments }; + if (Math.random()) { + return () => arguments; + ~~~~~~~~~ +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments18_ES6.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments18_ES6.js new file mode 100644 index 00000000000..ae9e7e4ef10 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments18_ES6.js @@ -0,0 +1,16 @@ +//// [emitArrowFunctionWhenUsingArguments18_ES6.ts] + +function f() { + var { arguments: args } = { arguments }; + if (Math.random()) { + return () => arguments; + } +} + +//// [emitArrowFunctionWhenUsingArguments18_ES6.js] +function f() { + var { arguments: args } = { arguments }; + if (Math.random()) { + return () => arguments; + } +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments19.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments19.errors.txt new file mode 100644 index 00000000000..887cc4713c9 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments19.errors.txt @@ -0,0 +1,20 @@ +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments19.ts(6,33): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. + + +==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments19.ts (1 errors) ==== + + function f() { + function g() { + var _arguments = 10; // No capture in 'g', so no conflict. + function h() { + var capture = () => arguments; // Should trigger an '_arguments' capture into function 'h' + ~~~~~~~~~ +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. + foo(_arguments); // Error as this does not resolve to the user defined '_arguments' + } + } + + function foo(x: any) { + return 100; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments19.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments19.js new file mode 100644 index 00000000000..566c0aa49cd --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments19.js @@ -0,0 +1,29 @@ +//// [emitArrowFunctionWhenUsingArguments19.ts] + +function f() { + function g() { + var _arguments = 10; // No capture in 'g', so no conflict. + function h() { + var capture = () => arguments; // Should trigger an '_arguments' capture into function 'h' + foo(_arguments); // Error as this does not resolve to the user defined '_arguments' + } + } + + function foo(x: any) { + return 100; + } +} + +//// [emitArrowFunctionWhenUsingArguments19.js] +function f() { + function g() { + var _arguments = 10; // No capture in 'g', so no conflict. + function h() { + var capture = function () { return arguments; }; // Should trigger an '_arguments' capture into function 'h' + foo(_arguments); // Error as this does not resolve to the user defined '_arguments' + } + } + function foo(x) { + return 100; + } +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments19_ES6.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments19_ES6.errors.txt new file mode 100644 index 00000000000..1750cf065bb --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments19_ES6.errors.txt @@ -0,0 +1,20 @@ +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments19_ES6.ts(6,33): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. + + +==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments19_ES6.ts (1 errors) ==== + + function f() { + function g() { + var _arguments = 10; // No capture in 'g', so no conflict. + function h() { + var capture = () => arguments; // Should trigger an '_arguments' capture into function 'h' + ~~~~~~~~~ +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. + foo(_arguments); // Error as this does not resolve to the user defined '_arguments' + } + } + + function foo(x: any) { + return 100; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments19_ES6.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments19_ES6.js new file mode 100644 index 00000000000..e41aed4f4bf --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments19_ES6.js @@ -0,0 +1,29 @@ +//// [emitArrowFunctionWhenUsingArguments19_ES6.ts] + +function f() { + function g() { + var _arguments = 10; // No capture in 'g', so no conflict. + function h() { + var capture = () => arguments; // Should trigger an '_arguments' capture into function 'h' + foo(_arguments); // Error as this does not resolve to the user defined '_arguments' + } + } + + function foo(x: any) { + return 100; + } +} + +//// [emitArrowFunctionWhenUsingArguments19_ES6.js] +function f() { + function g() { + var _arguments = 10; // No capture in 'g', so no conflict. + function h() { + var capture = () => arguments; // Should trigger an '_arguments' capture into function 'h' + foo(_arguments); // Error as this does not resolve to the user defined '_arguments' + } + } + function foo(x) { + return 100; + } +} From 13c31296655030cd381f69fe662eab3c3c65bc08 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Thu, 16 Apr 2015 13:08:57 -0700 Subject: [PATCH 3/4] Only error in /// +/* @internal */ module ts { export var Diagnostics = { Unterminated_string_literal: { code: 1002, category: DiagnosticCategory.Error, key: "Unterminated string literal." }, @@ -357,7 +358,7 @@ module ts { Tuple_type_0_with_length_1_cannot_be_assigned_to_tuple_with_length_2: { code: 2493, category: DiagnosticCategory.Error, key: "Tuple type '{0}' with length '{1}' cannot be assigned to tuple with length '{2}'." }, Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher: { code: 2494, category: DiagnosticCategory.Error, key: "Using a string in a 'for...of' statement is only supported in ECMAScript 5 and higher." }, Type_0_is_not_an_array_type_or_a_string_type: { code: 2495, category: DiagnosticCategory.Error, key: "Type '{0}' is not an array type or a string type." }, - The_arguments_object_cannot_be_referenced_in_an_arrow_function_Consider_using_a_standard_function_expression: { code: 2496, category: DiagnosticCategory.Error, key: "The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression." }, + The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression: { code: 2496, category: DiagnosticCategory.Error, key: "The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression." }, External_module_0_resolves_to_a_non_module_entity_and_cannot_be_imported_using_this_construct: { code: 2497, category: DiagnosticCategory.Error, key: "External module '{0}' resolves to a non-module entity and cannot be imported using this construct." }, External_module_0_uses_export_and_cannot_be_used_with_export_Asterisk: { code: 2498, category: DiagnosticCategory.Error, key: "External module '{0}' uses 'export =' and cannot be used with 'export *'." }, An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments: { code: 2499, category: DiagnosticCategory.Error, key: "An interface can only extend an identifier/qualified-name with optional type arguments." }, diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 258f98357b7..61ce23c316b 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -1419,7 +1419,7 @@ "category": "Error", "code": 2495 }, - "The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression.": { + "The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression.": { "category": "Error", "code": 2496 }, diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments01.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments01.errors.txt index ddae6bca8a4..1137835c2c2 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments01.errors.txt +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments01.errors.txt @@ -1,21 +1,21 @@ -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments01.ts(2,15): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments01.ts(7,19): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments01.ts(13,13): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments01.ts(19,15): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments01.ts(2,15): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments01.ts(7,19): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments01.ts(13,13): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments01.ts(19,15): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. ==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments01.ts (4 errors) ==== var a = () => { var arg = arguments[0]; // error ~~~~~~~~~ -!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. } var b = function () { var a = () => { var arg = arguments[0]; // error ~~~~~~~~~ -!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. } } @@ -23,7 +23,7 @@ tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments01. () => { var arg = arguments[0]; ~~~~~~~~~ -!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. } } @@ -31,7 +31,7 @@ tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments01. foo(() => { var arg = arguments[0]; // error ~~~~~~~~~ -!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. }); function bar() { diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments01_ES6.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments01_ES6.errors.txt deleted file mode 100644 index 3eb07e965ba..00000000000 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments01_ES6.errors.txt +++ /dev/null @@ -1,46 +0,0 @@ -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments01_ES6.ts(2,15): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments01_ES6.ts(7,19): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments01_ES6.ts(13,13): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments01_ES6.ts(19,15): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. - - -==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments01_ES6.ts (4 errors) ==== - var a = () => { - var arg = arguments[0]; // error - ~~~~~~~~~ -!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. - } - - var b = function () { - var a = () => { - var arg = arguments[0]; // error - ~~~~~~~~~ -!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. - } - } - - function baz() { - () => { - var arg = arguments[0]; - ~~~~~~~~~ -!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. - } - } - - function foo(inputFunc: () => void) { } - foo(() => { - var arg = arguments[0]; // error - ~~~~~~~~~ -!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. - }); - - function bar() { - var arg = arguments[0]; // no error - } - - - () => { - function foo() { - var arg = arguments[0]; // no error - } - } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments01_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments01_ES6.types new file mode 100644 index 00000000000..669bf411e63 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments01_ES6.types @@ -0,0 +1,83 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments01_ES6.ts === +var a = () => { +>a : () => void +>() => { var arg = arguments[0]; // error} : () => void + + var arg = arguments[0]; // error +>arg : any +>arguments[0] : any +>arguments : IArguments +>0 : number +} + +var b = function () { +>b : () => void +>function () { var a = () => { var arg = arguments[0]; // error }} : () => void + + var a = () => { +>a : () => void +>() => { var arg = arguments[0]; // error } : () => void + + var arg = arguments[0]; // error +>arg : any +>arguments[0] : any +>arguments : IArguments +>0 : number + } +} + +function baz() { +>baz : () => void + + () => { +>() => { var arg = arguments[0]; } : () => void + + var arg = arguments[0]; +>arg : any +>arguments[0] : any +>arguments : IArguments +>0 : number + } +} + +function foo(inputFunc: () => void) { } +>foo : (inputFunc: () => void) => void +>inputFunc : () => void + +foo(() => { +>foo(() => { var arg = arguments[0]; // error}) : void +>foo : (inputFunc: () => void) => void +>() => { var arg = arguments[0]; // error} : () => void + + var arg = arguments[0]; // error +>arg : any +>arguments[0] : any +>arguments : IArguments +>0 : number + +}); + +function bar() { +>bar : () => void + + var arg = arguments[0]; // no error +>arg : any +>arguments[0] : any +>arguments : IArguments +>0 : number +} + + +() => { +>() => { function foo() { var arg = arguments[0]; // no error }} : () => void + + function foo() { +>foo : () => void + + var arg = arguments[0]; // no error +>arg : any +>arguments[0] : any +>arguments : IArguments +>0 : number + } +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments02.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments02.errors.txt index 47ffcccd216..55f0ce2230a 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments02.errors.txt +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments02.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments02.ts(2,15): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments02.ts(2,15): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. ==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments02.ts (1 errors) ==== var a = () => arguments; ~~~~~~~~~ -!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. \ No newline at end of file +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments02_ES6.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments02_ES6.errors.txt deleted file mode 100644 index 860700e0086..00000000000 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments02_ES6.errors.txt +++ /dev/null @@ -1,8 +0,0 @@ -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments02_ES6.ts(2,15): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. - - -==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments02_ES6.ts (1 errors) ==== - - var a = () => arguments; - ~~~~~~~~~ -!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments02_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments02_ES6.types new file mode 100644 index 00000000000..fe5ac353ce6 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments02_ES6.types @@ -0,0 +1,7 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments02_ES6.ts === + +var a = () => arguments; +>a : () => IArguments +>() => arguments : () => IArguments +>arguments : IArguments + diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments03.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments03.errors.txt index 153ea8003e0..d914e14d93a 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments03.errors.txt +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments03.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments03.ts(3,15): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments03.ts(3,15): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. ==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments03.ts (1 errors) ==== @@ -6,4 +6,4 @@ tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments03. var arguments; var a = () => arguments; ~~~~~~~~~ -!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. \ No newline at end of file +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments03_ES6.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments03_ES6.errors.txt deleted file mode 100644 index 60b752bc569..00000000000 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments03_ES6.errors.txt +++ /dev/null @@ -1,9 +0,0 @@ -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments03_ES6.ts(3,15): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. - - -==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments03_ES6.ts (1 errors) ==== - - var arguments; - var a = () => arguments; - ~~~~~~~~~ -!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments03_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments03_ES6.types new file mode 100644 index 00000000000..33a45a39af1 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments03_ES6.types @@ -0,0 +1,10 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments03_ES6.ts === + +var arguments; +>arguments : any + +var a = () => arguments; +>a : () => IArguments +>() => arguments : () => IArguments +>arguments : IArguments + diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments04.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments04.errors.txt index 2c7a08d7479..12e416f893f 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments04.errors.txt +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments04.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments04.ts(4,19): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments04.ts(4,19): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. ==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments04.ts (1 errors) ==== @@ -7,5 +7,5 @@ tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments04. var arguments; var a = () => arguments; ~~~~~~~~~ -!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments04_ES6.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments04_ES6.errors.txt deleted file mode 100644 index 8ff3b9bc16e..00000000000 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments04_ES6.errors.txt +++ /dev/null @@ -1,11 +0,0 @@ -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments04_ES6.ts(4,19): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. - - -==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments04_ES6.ts (1 errors) ==== - - function f() { - var arguments; - var a = () => arguments; - ~~~~~~~~~ -!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. - } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments04_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments04_ES6.types new file mode 100644 index 00000000000..495ca1582e6 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments04_ES6.types @@ -0,0 +1,13 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments04_ES6.ts === + +function f() { +>f : () => void + + var arguments; +>arguments : any + + var a = () => arguments; +>a : () => IArguments +>() => arguments : () => IArguments +>arguments : IArguments +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments05.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments05.errors.txt index 8802a13e539..4256dab30c2 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments05.errors.txt +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments05.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments05.ts(3,19): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments05.ts(3,19): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. ==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments05.ts (1 errors) ==== @@ -6,5 +6,5 @@ tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments05. function f(arguments) { var a = () => arguments; ~~~~~~~~~ -!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments05_ES6.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments05_ES6.errors.txt deleted file mode 100644 index bd13e0a36a7..00000000000 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments05_ES6.errors.txt +++ /dev/null @@ -1,10 +0,0 @@ -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments05_ES6.ts(3,19): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. - - -==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments05_ES6.ts (1 errors) ==== - - function f(arguments) { - var a = () => arguments; - ~~~~~~~~~ -!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. - } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments05_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments05_ES6.types new file mode 100644 index 00000000000..4e9da2f642b --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments05_ES6.types @@ -0,0 +1,11 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments05_ES6.ts === + +function f(arguments) { +>f : (arguments: any) => void +>arguments : any + + var a = () => arguments; +>a : () => IArguments +>() => arguments : () => IArguments +>arguments : IArguments +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments06.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments06.errors.txt index 138f9486d19..5b078f22f44 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments06.errors.txt +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments06.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments06.ts(3,25): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments06.ts(3,25): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. ==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments06.ts (1 errors) ==== @@ -6,5 +6,5 @@ tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments06. function f(arguments) { var a = () => () => arguments; ~~~~~~~~~ -!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments06_ES6.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments06_ES6.errors.txt deleted file mode 100644 index 08b9c64b49b..00000000000 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments06_ES6.errors.txt +++ /dev/null @@ -1,10 +0,0 @@ -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments06_ES6.ts(3,25): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. - - -==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments06_ES6.ts (1 errors) ==== - - function f(arguments) { - var a = () => () => arguments; - ~~~~~~~~~ -!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. - } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments06_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments06_ES6.types new file mode 100644 index 00000000000..82571174a1e --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments06_ES6.types @@ -0,0 +1,12 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments06_ES6.ts === + +function f(arguments) { +>f : (arguments: any) => void +>arguments : any + + var a = () => () => arguments; +>a : () => () => IArguments +>() => () => arguments : () => () => IArguments +>() => arguments : () => IArguments +>arguments : IArguments +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments07.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments07.errors.txt index a9c9638780e..da1f7dd28f9 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments07.errors.txt +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments07.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments07.ts(3,34): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments07.ts(3,34): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. ==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments07.ts (1 errors) ==== @@ -6,5 +6,5 @@ tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments07. function f(arguments) { var a = (arguments) => () => arguments; ~~~~~~~~~ -!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments07_ES6.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments07_ES6.errors.txt deleted file mode 100644 index 51cac68f529..00000000000 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments07_ES6.errors.txt +++ /dev/null @@ -1,10 +0,0 @@ -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments07_ES6.ts(3,34): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. - - -==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments07_ES6.ts (1 errors) ==== - - function f(arguments) { - var a = (arguments) => () => arguments; - ~~~~~~~~~ -!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. - } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments07_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments07_ES6.types new file mode 100644 index 00000000000..967631cc57b --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments07_ES6.types @@ -0,0 +1,13 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments07_ES6.ts === + +function f(arguments) { +>f : (arguments: any) => void +>arguments : any + + var a = (arguments) => () => arguments; +>a : (arguments: any) => () => IArguments +>(arguments) => () => arguments : (arguments: any) => () => IArguments +>arguments : any +>() => arguments : () => IArguments +>arguments : IArguments +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments08.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments08.symbols new file mode 100644 index 00000000000..80f7f507978 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments08.symbols @@ -0,0 +1,11 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments08.ts === + +function f(arguments) { +>f : Symbol(f, Decl(emitArrowFunctionWhenUsingArguments08.ts, 0, 0)) +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments08.ts, 1, 11)) + + var a = () => (arguments) => arguments; +>a : Symbol(a, Decl(emitArrowFunctionWhenUsingArguments08.ts, 2, 7)) +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments08.ts, 2, 19)) +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments08.ts, 2, 19)) +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments08_ES6.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments08_ES6.symbols new file mode 100644 index 00000000000..bfbb055cc32 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments08_ES6.symbols @@ -0,0 +1,11 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments08_ES6.ts === + +function f(arguments) { +>f : Symbol(f, Decl(emitArrowFunctionWhenUsingArguments08_ES6.ts, 0, 0)) +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments08_ES6.ts, 1, 11)) + + var a = () => (arguments) => arguments; +>a : Symbol(a, Decl(emitArrowFunctionWhenUsingArguments08_ES6.ts, 2, 7)) +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments08_ES6.ts, 2, 19)) +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments08_ES6.ts, 2, 19)) +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments09.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments09.errors.txt index c5908cac978..72239150cf3 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments09.errors.txt +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments09.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments09.ts(3,25): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments09.ts(3,25): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. ==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments09.ts (1 errors) ==== @@ -6,5 +6,5 @@ tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments09. function f(_arguments) { var a = () => () => arguments; ~~~~~~~~~ -!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments09_ES6.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments09_ES6.errors.txt deleted file mode 100644 index 20f316a0a4c..00000000000 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments09_ES6.errors.txt +++ /dev/null @@ -1,10 +0,0 @@ -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments09_ES6.ts(3,25): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. - - -==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments09_ES6.ts (1 errors) ==== - - function f(_arguments) { - var a = () => () => arguments; - ~~~~~~~~~ -!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. - } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments09_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments09_ES6.types new file mode 100644 index 00000000000..77f44eebfca --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments09_ES6.types @@ -0,0 +1,12 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments09_ES6.ts === + +function f(_arguments) { +>f : (_arguments: any) => void +>_arguments : any + + var a = () => () => arguments; +>a : () => () => IArguments +>() => () => arguments : () => () => IArguments +>() => arguments : () => IArguments +>arguments : IArguments +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments10.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments10.errors.txt index 4267d0d923f..254ad2cbc4d 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments10.errors.txt +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments10.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments10.ts(4,25): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments10.ts(4,25): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. ==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments10.ts (1 errors) ==== @@ -7,5 +7,5 @@ tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments10. var _arguments = 10; var a = () => () => arguments; ~~~~~~~~~ -!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments10_ES6.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments10_ES6.errors.txt deleted file mode 100644 index 348e1088643..00000000000 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments10_ES6.errors.txt +++ /dev/null @@ -1,11 +0,0 @@ -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments10_ES6.ts(4,25): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. - - -==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments10_ES6.ts (1 errors) ==== - - function f() { - var _arguments = 10; - var a = () => () => arguments; - ~~~~~~~~~ -!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. - } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments10_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments10_ES6.types new file mode 100644 index 00000000000..dd567d3bdca --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments10_ES6.types @@ -0,0 +1,15 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments10_ES6.ts === + +function f() { +>f : () => void + + var _arguments = 10; +>_arguments : number +>10 : number + + var a = () => () => arguments; +>a : () => () => IArguments +>() => () => arguments : () => () => IArguments +>() => arguments : () => IArguments +>arguments : IArguments +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments11.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments11.errors.txt index 3b63ccd44a2..0606a7784b3 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments11.errors.txt +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments11.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments11.ts(4,25): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments11.ts(4,25): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. ==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments11.ts (1 errors) ==== @@ -7,5 +7,5 @@ tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments11. var _arguments = 10; var a = () => () => arguments; ~~~~~~~~~ -!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments11_ES6.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments11_ES6.errors.txt deleted file mode 100644 index 1dbeff0c45e..00000000000 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments11_ES6.errors.txt +++ /dev/null @@ -1,11 +0,0 @@ -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments11_ES6.ts(4,25): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. - - -==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments11_ES6.ts (1 errors) ==== - - function f(arguments) { - var _arguments = 10; - var a = () => () => arguments; - ~~~~~~~~~ -!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. - } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments11_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments11_ES6.types new file mode 100644 index 00000000000..b977a77010c --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments11_ES6.types @@ -0,0 +1,16 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments11_ES6.ts === + +function f(arguments) { +>f : (arguments: any) => void +>arguments : any + + var _arguments = 10; +>_arguments : number +>10 : number + + var a = () => () => arguments; +>a : () => () => IArguments +>() => () => arguments : () => () => IArguments +>() => arguments : () => IArguments +>arguments : IArguments +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments12.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments12.errors.txt index f641faebcca..4b2dd76a5d0 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments12.errors.txt +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments12.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments12.ts(3,7): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments12.ts(4,23): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments12.ts(4,23): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. ==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments12.ts (2 errors) ==== @@ -10,6 +10,6 @@ tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments12. !!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. var a = () => arguments; ~~~~~~~~~ -!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. } } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments12_ES6.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments12_ES6.errors.txt index bcc926d83eb..8a3018ceb9c 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments12_ES6.errors.txt +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments12_ES6.errors.txt @@ -1,15 +1,12 @@ tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments12_ES6.ts(3,7): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments12_ES6.ts(4,23): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. -==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments12_ES6.ts (2 errors) ==== +==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments12_ES6.ts (1 errors) ==== class C { f(arguments) { ~~~~~~~~~ !!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. var a = () => arguments; - ~~~~~~~~~ -!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. } } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments13.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments13.symbols new file mode 100644 index 00000000000..b46d8ab1a63 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments13.symbols @@ -0,0 +1,13 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments13.ts === + +function f() { +>f : Symbol(f, Decl(emitArrowFunctionWhenUsingArguments13.ts, 0, 0)) + + var _arguments = 10; +>_arguments : Symbol(_arguments, Decl(emitArrowFunctionWhenUsingArguments13.ts, 2, 7)) + + var a = (arguments) => () => _arguments; +>a : Symbol(a, Decl(emitArrowFunctionWhenUsingArguments13.ts, 3, 7)) +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments13.ts, 3, 13)) +>_arguments : Symbol(_arguments, Decl(emitArrowFunctionWhenUsingArguments13.ts, 2, 7)) +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments13_ES6.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments13_ES6.symbols new file mode 100644 index 00000000000..5c4ec4cb687 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments13_ES6.symbols @@ -0,0 +1,13 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments13_ES6.ts === + +function f() { +>f : Symbol(f, Decl(emitArrowFunctionWhenUsingArguments13_ES6.ts, 0, 0)) + + var _arguments = 10; +>_arguments : Symbol(_arguments, Decl(emitArrowFunctionWhenUsingArguments13_ES6.ts, 2, 7)) + + var a = (arguments) => () => _arguments; +>a : Symbol(a, Decl(emitArrowFunctionWhenUsingArguments13_ES6.ts, 3, 7)) +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments13_ES6.ts, 3, 13)) +>_arguments : Symbol(_arguments, Decl(emitArrowFunctionWhenUsingArguments13_ES6.ts, 2, 7)) +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14.errors.txt index ceb03631830..8e38cb9d4d3 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14.errors.txt +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments14.ts(5,22): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments14.ts(5,22): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. ==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments14.ts (1 errors) ==== @@ -8,6 +8,6 @@ tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments14. const arguments = 100; return () => arguments; ~~~~~~~~~ -!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. } } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14_ES6.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14_ES6.errors.txt deleted file mode 100644 index d71a2518c07..00000000000 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14_ES6.errors.txt +++ /dev/null @@ -1,13 +0,0 @@ -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments14_ES6.ts(5,22): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. - - -==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments14_ES6.ts (1 errors) ==== - - function f() { - if (Math.random()) { - let arguments = 100; - return () => arguments; - ~~~~~~~~~ -!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. - } - } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14_ES6.types new file mode 100644 index 00000000000..29989ea0f9c --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14_ES6.types @@ -0,0 +1,20 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments14_ES6.ts === + +function f() { +>f : () => () => IArguments + + if (Math.random()) { +>Math.random() : number +>Math.random : () => number +>Math : Math +>random : () => number + + let arguments = 100; +>arguments : number +>100 : number + + return () => arguments; +>() => arguments : () => IArguments +>arguments : IArguments + } +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15.errors.txt index af684202b2f..02fb22861c5 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15.errors.txt +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments15.ts(6,22): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments15.ts(6,22): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. ==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments15.ts (1 errors) ==== @@ -9,6 +9,6 @@ tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments15. const arguments = 100; return () => arguments; ~~~~~~~~~ -!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. } } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15_ES6.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15_ES6.errors.txt deleted file mode 100644 index d26b919c16d..00000000000 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15_ES6.errors.txt +++ /dev/null @@ -1,14 +0,0 @@ -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments15_ES6.ts(6,22): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. - - -==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments15_ES6.ts (1 errors) ==== - - function f() { - var arguments = "hello"; - if (Math.random()) { - const arguments = 100; - return () => arguments; - ~~~~~~~~~ -!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. - } - } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15_ES6.types new file mode 100644 index 00000000000..0bb34b22eef --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15_ES6.types @@ -0,0 +1,24 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments15_ES6.ts === + +function f() { +>f : () => () => IArguments + + var arguments = "hello"; +>arguments : string +>"hello" : string + + if (Math.random()) { +>Math.random() : number +>Math.random : () => number +>Math : Math +>random : () => number + + const arguments = 100; +>arguments : number +>100 : number + + return () => arguments; +>() => arguments : () => IArguments +>arguments : IArguments + } +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16.errors.txt index 39ce66e2ce5..4480e0f570a 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16.errors.txt +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments16.ts(5,22): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments16.ts(5,22): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. ==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments16.ts (1 errors) ==== @@ -8,7 +8,7 @@ tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments16. if (Math.random()) { return () => arguments[0]; ~~~~~~~~~ -!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. } var arguments = "world"; } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16_ES6.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16_ES6.errors.txt deleted file mode 100644 index f3beb7f21b7..00000000000 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16_ES6.errors.txt +++ /dev/null @@ -1,14 +0,0 @@ -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments16_ES6.ts(5,22): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. - - -==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments16_ES6.ts (1 errors) ==== - - function f() { - var arguments = "hello"; - if (Math.random()) { - return () => arguments[0]; - ~~~~~~~~~ -!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. - } - var arguments = "world"; - } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16_ES6.types new file mode 100644 index 00000000000..41c6b87fb42 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16_ES6.types @@ -0,0 +1,25 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments16_ES6.ts === + +function f() { +>f : () => () => any + + var arguments = "hello"; +>arguments : string +>"hello" : string + + if (Math.random()) { +>Math.random() : number +>Math.random : () => number +>Math : Math +>random : () => number + + return () => arguments[0]; +>() => arguments[0] : () => any +>arguments[0] : any +>arguments : IArguments +>0 : number + } + var arguments = "world"; +>arguments : string +>"world" : string +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17.errors.txt index 3d53f02a286..a54d52e3475 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17.errors.txt +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments17.ts(5,22): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments17.ts(5,22): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. ==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments17.ts (1 errors) ==== @@ -8,7 +8,7 @@ tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments17. if (Math.random()) { return () => arguments[0]; ~~~~~~~~~ -!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. } var arguments = "world"; } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17_ES6.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17_ES6.errors.txt deleted file mode 100644 index 2082323f158..00000000000 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17_ES6.errors.txt +++ /dev/null @@ -1,14 +0,0 @@ -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments17_ES6.ts(5,22): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. - - -==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments17_ES6.ts (1 errors) ==== - - function f() { - var { arguments } = { arguments: "hello" }; - if (Math.random()) { - return () => arguments[0]; - ~~~~~~~~~ -!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. - } - var arguments = "world"; - } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17_ES6.types new file mode 100644 index 00000000000..f62a2dce84c --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17_ES6.types @@ -0,0 +1,27 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments17_ES6.ts === + +function f() { +>f : () => () => any + + var { arguments } = { arguments: "hello" }; +>arguments : string +>{ arguments: "hello" } : { arguments: string; } +>arguments : string +>"hello" : string + + if (Math.random()) { +>Math.random() : number +>Math.random : () => number +>Math : Math +>random : () => number + + return () => arguments[0]; +>() => arguments[0] : () => any +>arguments[0] : any +>arguments : IArguments +>0 : number + } + var arguments = "world"; +>arguments : string +>"world" : string +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments18.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments18.errors.txt index 4827559f277..2595b22801f 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments18.errors.txt +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments18.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments18.ts(5,22): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments18.ts(5,22): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. ==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments18.ts (1 errors) ==== @@ -8,6 +8,6 @@ tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments18. if (Math.random()) { return () => arguments; ~~~~~~~~~ -!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. } } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments18_ES6.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments18_ES6.errors.txt deleted file mode 100644 index b73e4399587..00000000000 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments18_ES6.errors.txt +++ /dev/null @@ -1,13 +0,0 @@ -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments18_ES6.ts(5,22): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. - - -==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments18_ES6.ts (1 errors) ==== - - function f() { - var { arguments: args } = { arguments }; - if (Math.random()) { - return () => arguments; - ~~~~~~~~~ -!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. - } - } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments18_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments18_ES6.types new file mode 100644 index 00000000000..f2fe76e8926 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments18_ES6.types @@ -0,0 +1,22 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments18_ES6.ts === + +function f() { +>f : () => () => IArguments + + var { arguments: args } = { arguments }; +>arguments : any +>args : IArguments +>{ arguments } : { arguments: IArguments; } +>arguments : IArguments + + if (Math.random()) { +>Math.random() : number +>Math.random : () => number +>Math : Math +>random : () => number + + return () => arguments; +>() => arguments : () => IArguments +>arguments : IArguments + } +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments19.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments19.errors.txt index 887cc4713c9..e6496443e7e 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments19.errors.txt +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments19.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments19.ts(6,33): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments19.ts(6,33): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. ==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments19.ts (1 errors) ==== @@ -9,7 +9,7 @@ tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments19. function h() { var capture = () => arguments; // Should trigger an '_arguments' capture into function 'h' ~~~~~~~~~ -!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. foo(_arguments); // Error as this does not resolve to the user defined '_arguments' } } diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments19_ES6.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments19_ES6.errors.txt deleted file mode 100644 index 1750cf065bb..00000000000 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments19_ES6.errors.txt +++ /dev/null @@ -1,20 +0,0 @@ -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments19_ES6.ts(6,33): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. - - -==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments19_ES6.ts (1 errors) ==== - - function f() { - function g() { - var _arguments = 10; // No capture in 'g', so no conflict. - function h() { - var capture = () => arguments; // Should trigger an '_arguments' capture into function 'h' - ~~~~~~~~~ -!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. - foo(_arguments); // Error as this does not resolve to the user defined '_arguments' - } - } - - function foo(x: any) { - return 100; - } - } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments19_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments19_ES6.types new file mode 100644 index 00000000000..a672389720a --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments19_ES6.types @@ -0,0 +1,35 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments19_ES6.ts === + +function f() { +>f : () => void + + function g() { +>g : () => void + + var _arguments = 10; // No capture in 'g', so no conflict. +>_arguments : number +>10 : number + + function h() { +>h : () => void + + var capture = () => arguments; // Should trigger an '_arguments' capture into function 'h' +>capture : () => IArguments +>() => arguments : () => IArguments +>arguments : IArguments + + foo(_arguments); // Error as this does not resolve to the user defined '_arguments' +>foo(_arguments) : number +>foo : (x: any) => number +>_arguments : number + } + } + + function foo(x: any) { +>foo : (x: any) => number +>x : any + + return 100; +>100 : number + } +} From ce00997693451b7230d898e5da40640a5b892606 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Thu, 16 Apr 2015 13:29:20 -0700 Subject: [PATCH 4/4] Added symbols files. --- ...owFunctionWhenUsingArguments01_ES6.symbols | 62 +++++++++++++++++++ ...owFunctionWhenUsingArguments02_ES6.symbols | 6 ++ ...owFunctionWhenUsingArguments03_ES6.symbols | 9 +++ ...owFunctionWhenUsingArguments04_ES6.symbols | 12 ++++ ...owFunctionWhenUsingArguments05_ES6.symbols | 10 +++ ...owFunctionWhenUsingArguments06_ES6.symbols | 10 +++ ...owFunctionWhenUsingArguments07_ES6.symbols | 11 ++++ ...owFunctionWhenUsingArguments09_ES6.symbols | 10 +++ ...owFunctionWhenUsingArguments10_ES6.symbols | 12 ++++ ...owFunctionWhenUsingArguments11_ES6.symbols | 13 ++++ ...owFunctionWhenUsingArguments14_ES6.symbols | 17 +++++ ...owFunctionWhenUsingArguments15_ES6.symbols | 20 ++++++ ...owFunctionWhenUsingArguments16_ES6.symbols | 19 ++++++ ...owFunctionWhenUsingArguments17_ES6.symbols | 20 ++++++ ...owFunctionWhenUsingArguments18_ES6.symbols | 18 ++++++ ...owFunctionWhenUsingArguments19_ES6.symbols | 31 ++++++++++ 16 files changed, 280 insertions(+) create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments01_ES6.symbols create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments02_ES6.symbols create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments03_ES6.symbols create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments04_ES6.symbols create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments05_ES6.symbols create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments06_ES6.symbols create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments07_ES6.symbols create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments09_ES6.symbols create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments10_ES6.symbols create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments11_ES6.symbols create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments14_ES6.symbols create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments15_ES6.symbols create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments16_ES6.symbols create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments17_ES6.symbols create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments18_ES6.symbols create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments19_ES6.symbols diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments01_ES6.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments01_ES6.symbols new file mode 100644 index 00000000000..698b32da7ad --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments01_ES6.symbols @@ -0,0 +1,62 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments01_ES6.ts === +var a = () => { +>a : Symbol(a, Decl(emitArrowFunctionWhenUsingArguments01_ES6.ts, 0, 3)) + + var arg = arguments[0]; // error +>arg : Symbol(arg, Decl(emitArrowFunctionWhenUsingArguments01_ES6.ts, 1, 7)) +>arguments : Symbol(arguments) +} + +var b = function () { +>b : Symbol(b, Decl(emitArrowFunctionWhenUsingArguments01_ES6.ts, 4, 3)) + + var a = () => { +>a : Symbol(a, Decl(emitArrowFunctionWhenUsingArguments01_ES6.ts, 5, 7)) + + var arg = arguments[0]; // error +>arg : Symbol(arg, Decl(emitArrowFunctionWhenUsingArguments01_ES6.ts, 6, 11)) +>arguments : Symbol(arguments) + } +} + +function baz() { +>baz : Symbol(baz, Decl(emitArrowFunctionWhenUsingArguments01_ES6.ts, 8, 1)) + + () => { + var arg = arguments[0]; +>arg : Symbol(arg, Decl(emitArrowFunctionWhenUsingArguments01_ES6.ts, 12, 5)) +>arguments : Symbol(arguments) + } +} + +function foo(inputFunc: () => void) { } +>foo : Symbol(foo, Decl(emitArrowFunctionWhenUsingArguments01_ES6.ts, 14, 1)) +>inputFunc : Symbol(inputFunc, Decl(emitArrowFunctionWhenUsingArguments01_ES6.ts, 16, 13)) + +foo(() => { +>foo : Symbol(foo, Decl(emitArrowFunctionWhenUsingArguments01_ES6.ts, 14, 1)) + + var arg = arguments[0]; // error +>arg : Symbol(arg, Decl(emitArrowFunctionWhenUsingArguments01_ES6.ts, 18, 7)) +>arguments : Symbol(arguments) + +}); + +function bar() { +>bar : Symbol(bar, Decl(emitArrowFunctionWhenUsingArguments01_ES6.ts, 19, 3)) + + var arg = arguments[0]; // no error +>arg : Symbol(arg, Decl(emitArrowFunctionWhenUsingArguments01_ES6.ts, 22, 7)) +>arguments : Symbol(arguments) +} + + +() => { + function foo() { +>foo : Symbol(foo, Decl(emitArrowFunctionWhenUsingArguments01_ES6.ts, 26, 7)) + + var arg = arguments[0]; // no error +>arg : Symbol(arg, Decl(emitArrowFunctionWhenUsingArguments01_ES6.ts, 28, 5)) +>arguments : Symbol(arguments) + } +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments02_ES6.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments02_ES6.symbols new file mode 100644 index 00000000000..e403a2c3da1 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments02_ES6.symbols @@ -0,0 +1,6 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments02_ES6.ts === + +var a = () => arguments; +>a : Symbol(a, Decl(emitArrowFunctionWhenUsingArguments02_ES6.ts, 1, 3)) +>arguments : Symbol(arguments) + diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments03_ES6.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments03_ES6.symbols new file mode 100644 index 00000000000..08bae382794 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments03_ES6.symbols @@ -0,0 +1,9 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments03_ES6.ts === + +var arguments; +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments03_ES6.ts, 1, 3)) + +var a = () => arguments; +>a : Symbol(a, Decl(emitArrowFunctionWhenUsingArguments03_ES6.ts, 2, 3)) +>arguments : Symbol(arguments) + diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments04_ES6.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments04_ES6.symbols new file mode 100644 index 00000000000..708615a95c6 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments04_ES6.symbols @@ -0,0 +1,12 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments04_ES6.ts === + +function f() { +>f : Symbol(f, Decl(emitArrowFunctionWhenUsingArguments04_ES6.ts, 0, 0)) + + var arguments; +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments04_ES6.ts, 2, 7)) + + var a = () => arguments; +>a : Symbol(a, Decl(emitArrowFunctionWhenUsingArguments04_ES6.ts, 3, 7)) +>arguments : Symbol(arguments) +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments05_ES6.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments05_ES6.symbols new file mode 100644 index 00000000000..379a5cf92f1 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments05_ES6.symbols @@ -0,0 +1,10 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments05_ES6.ts === + +function f(arguments) { +>f : Symbol(f, Decl(emitArrowFunctionWhenUsingArguments05_ES6.ts, 0, 0)) +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments05_ES6.ts, 1, 11)) + + var a = () => arguments; +>a : Symbol(a, Decl(emitArrowFunctionWhenUsingArguments05_ES6.ts, 2, 7)) +>arguments : Symbol(arguments) +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments06_ES6.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments06_ES6.symbols new file mode 100644 index 00000000000..e59f487f864 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments06_ES6.symbols @@ -0,0 +1,10 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments06_ES6.ts === + +function f(arguments) { +>f : Symbol(f, Decl(emitArrowFunctionWhenUsingArguments06_ES6.ts, 0, 0)) +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments06_ES6.ts, 1, 11)) + + var a = () => () => arguments; +>a : Symbol(a, Decl(emitArrowFunctionWhenUsingArguments06_ES6.ts, 2, 7)) +>arguments : Symbol(arguments) +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments07_ES6.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments07_ES6.symbols new file mode 100644 index 00000000000..5de21ffbebd --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments07_ES6.symbols @@ -0,0 +1,11 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments07_ES6.ts === + +function f(arguments) { +>f : Symbol(f, Decl(emitArrowFunctionWhenUsingArguments07_ES6.ts, 0, 0)) +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments07_ES6.ts, 1, 11)) + + var a = (arguments) => () => arguments; +>a : Symbol(a, Decl(emitArrowFunctionWhenUsingArguments07_ES6.ts, 2, 7)) +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments07_ES6.ts, 2, 13)) +>arguments : Symbol(arguments) +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments09_ES6.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments09_ES6.symbols new file mode 100644 index 00000000000..ff8f114c052 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments09_ES6.symbols @@ -0,0 +1,10 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments09_ES6.ts === + +function f(_arguments) { +>f : Symbol(f, Decl(emitArrowFunctionWhenUsingArguments09_ES6.ts, 0, 0)) +>_arguments : Symbol(_arguments, Decl(emitArrowFunctionWhenUsingArguments09_ES6.ts, 1, 11)) + + var a = () => () => arguments; +>a : Symbol(a, Decl(emitArrowFunctionWhenUsingArguments09_ES6.ts, 2, 7)) +>arguments : Symbol(arguments) +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments10_ES6.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments10_ES6.symbols new file mode 100644 index 00000000000..1d9965fa6ad --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments10_ES6.symbols @@ -0,0 +1,12 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments10_ES6.ts === + +function f() { +>f : Symbol(f, Decl(emitArrowFunctionWhenUsingArguments10_ES6.ts, 0, 0)) + + var _arguments = 10; +>_arguments : Symbol(_arguments, Decl(emitArrowFunctionWhenUsingArguments10_ES6.ts, 2, 7)) + + var a = () => () => arguments; +>a : Symbol(a, Decl(emitArrowFunctionWhenUsingArguments10_ES6.ts, 3, 7)) +>arguments : Symbol(arguments) +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments11_ES6.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments11_ES6.symbols new file mode 100644 index 00000000000..a8f9c86c1b2 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments11_ES6.symbols @@ -0,0 +1,13 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments11_ES6.ts === + +function f(arguments) { +>f : Symbol(f, Decl(emitArrowFunctionWhenUsingArguments11_ES6.ts, 0, 0)) +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments11_ES6.ts, 1, 11)) + + var _arguments = 10; +>_arguments : Symbol(_arguments, Decl(emitArrowFunctionWhenUsingArguments11_ES6.ts, 2, 7)) + + var a = () => () => arguments; +>a : Symbol(a, Decl(emitArrowFunctionWhenUsingArguments11_ES6.ts, 3, 7)) +>arguments : Symbol(arguments) +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14_ES6.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14_ES6.symbols new file mode 100644 index 00000000000..623cc4c9690 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14_ES6.symbols @@ -0,0 +1,17 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments14_ES6.ts === + +function f() { +>f : Symbol(f, Decl(emitArrowFunctionWhenUsingArguments14_ES6.ts, 0, 0)) + + if (Math.random()) { +>Math.random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) +>Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11), Decl(lib.d.ts, 1664, 1)) +>random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) + + let arguments = 100; +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments14_ES6.ts, 3, 11)) + + return () => arguments; +>arguments : Symbol(arguments) + } +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15_ES6.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15_ES6.symbols new file mode 100644 index 00000000000..d140c21284c --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15_ES6.symbols @@ -0,0 +1,20 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments15_ES6.ts === + +function f() { +>f : Symbol(f, Decl(emitArrowFunctionWhenUsingArguments15_ES6.ts, 0, 0)) + + var arguments = "hello"; +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments15_ES6.ts, 2, 7)) + + if (Math.random()) { +>Math.random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) +>Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11), Decl(lib.d.ts, 1664, 1)) +>random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) + + const arguments = 100; +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments15_ES6.ts, 4, 13)) + + return () => arguments; +>arguments : Symbol(arguments) + } +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16_ES6.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16_ES6.symbols new file mode 100644 index 00000000000..e970b527d56 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16_ES6.symbols @@ -0,0 +1,19 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments16_ES6.ts === + +function f() { +>f : Symbol(f, Decl(emitArrowFunctionWhenUsingArguments16_ES6.ts, 0, 0)) + + var arguments = "hello"; +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments16_ES6.ts, 2, 7), Decl(emitArrowFunctionWhenUsingArguments16_ES6.ts, 6, 7)) + + if (Math.random()) { +>Math.random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) +>Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11), Decl(lib.d.ts, 1664, 1)) +>random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) + + return () => arguments[0]; +>arguments : Symbol(arguments) + } + var arguments = "world"; +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments16_ES6.ts, 2, 7), Decl(emitArrowFunctionWhenUsingArguments16_ES6.ts, 6, 7)) +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17_ES6.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17_ES6.symbols new file mode 100644 index 00000000000..8612e0896d1 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17_ES6.symbols @@ -0,0 +1,20 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments17_ES6.ts === + +function f() { +>f : Symbol(f, Decl(emitArrowFunctionWhenUsingArguments17_ES6.ts, 0, 0)) + + var { arguments } = { arguments: "hello" }; +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments17_ES6.ts, 2, 9), Decl(emitArrowFunctionWhenUsingArguments17_ES6.ts, 6, 7)) +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments17_ES6.ts, 2, 25)) + + if (Math.random()) { +>Math.random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) +>Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11), Decl(lib.d.ts, 1664, 1)) +>random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) + + return () => arguments[0]; +>arguments : Symbol(arguments) + } + var arguments = "world"; +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments17_ES6.ts, 2, 9), Decl(emitArrowFunctionWhenUsingArguments17_ES6.ts, 6, 7)) +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments18_ES6.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments18_ES6.symbols new file mode 100644 index 00000000000..96f9712635c --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments18_ES6.symbols @@ -0,0 +1,18 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments18_ES6.ts === + +function f() { +>f : Symbol(f, Decl(emitArrowFunctionWhenUsingArguments18_ES6.ts, 0, 0)) + + var { arguments: args } = { arguments }; +>args : Symbol(args, Decl(emitArrowFunctionWhenUsingArguments18_ES6.ts, 2, 9)) +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments18_ES6.ts, 2, 31)) + + if (Math.random()) { +>Math.random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) +>Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11), Decl(lib.d.ts, 1664, 1)) +>random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) + + return () => arguments; +>arguments : Symbol(arguments) + } +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments19_ES6.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments19_ES6.symbols new file mode 100644 index 00000000000..9e6392daaf1 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments19_ES6.symbols @@ -0,0 +1,31 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments19_ES6.ts === + +function f() { +>f : Symbol(f, Decl(emitArrowFunctionWhenUsingArguments19_ES6.ts, 0, 0)) + + function g() { +>g : Symbol(g, Decl(emitArrowFunctionWhenUsingArguments19_ES6.ts, 1, 14)) + + var _arguments = 10; // No capture in 'g', so no conflict. +>_arguments : Symbol(_arguments, Decl(emitArrowFunctionWhenUsingArguments19_ES6.ts, 3, 11)) + + function h() { +>h : Symbol(h, Decl(emitArrowFunctionWhenUsingArguments19_ES6.ts, 3, 28)) + + var capture = () => arguments; // Should trigger an '_arguments' capture into function 'h' +>capture : Symbol(capture, Decl(emitArrowFunctionWhenUsingArguments19_ES6.ts, 5, 15)) +>arguments : Symbol(arguments) + + foo(_arguments); // Error as this does not resolve to the user defined '_arguments' +>foo : Symbol(foo, Decl(emitArrowFunctionWhenUsingArguments19_ES6.ts, 8, 5)) +>_arguments : Symbol(_arguments, Decl(emitArrowFunctionWhenUsingArguments19_ES6.ts, 3, 11)) + } + } + + function foo(x: any) { +>foo : Symbol(foo, Decl(emitArrowFunctionWhenUsingArguments19_ES6.ts, 8, 5)) +>x : Symbol(x, Decl(emitArrowFunctionWhenUsingArguments19_ES6.ts, 10, 17)) + + return 100; + } +}