From dcaea68240538ae24273fd3363fb48587cfc5d5b Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Sat, 18 Oct 2014 15:42:36 +1100 Subject: [PATCH] fix up test styling and add use-strict declarator --- test/fixtures/bin/6to5/--blacklist/stdout.txt | 1 + test/fixtures/bin/6to5/--whitelist/stdout.txt | 1 + .../out-files/lib/bar/bar.js | 4 +- .../out-files/lib/foo.js | 3 +- .../out-files/lib/bar/bar.js | 2 + .../out-files/lib/bar/bar.js.map | 2 +- .../out-files/lib/foo.js | 1 + .../out-files/lib/foo.js.map | 2 +- .../dir --out-dir/out-files/lib/bar/bar.js | 2 + .../6to5/dir --out-dir/out-files/lib/foo.js | 1 + .../out-files/script2.js | 3 +- .../filename --out-file/out-files/script2.js | 1 + .../out-files/script3.js | 4 +- .../out-files/script3.js | 2 + .../out-files/script3.js.map | 2 +- .../filenames --out-file/out-files/script3.js | 2 + .../out-files/test.js | 1 + .../out-files/test.js.map | 2 +- .../6to5/stdin --out-file/out-files/script.js | 1 + .../stdin --source-maps-inline/stdout.txt | 3 +- test/fixtures/bin/6to5/stdin/stdout.txt | 1 + test/fixtures/syntax/api/blacklist/actual.js | 2 +- .../fixtures/syntax/api/blacklist/expected.js | 7 ++- test/fixtures/syntax/api/blacklist/untitled | 0 test/fixtures/syntax/api/whitelist/actual.js | 2 +- .../fixtures/syntax/api/whitelist/expected.js | 6 ++- .../array-comprehension/arguments/expected.js | 7 ++- .../multiple-if/expected.js | 12 +++-- .../array-comprehension/multiple/expected.js | 10 ++-- .../array-comprehension/single-if/expected.js | 8 +-- .../array-comprehension/single/expected.js | 6 ++- .../array-comprehension/this/expected.js | 9 +++- .../arrow-functions/arguments/actual.js | 10 ++-- .../arrow-functions/arguments/expected.js | 53 ++++++++++++++----- .../empty-arguments/expected.js | 6 ++- .../arrow-functions/empty-block/expected.js | 4 +- .../arrow-functions/expression/expected.js | 6 ++- .../arrow-functions/inside-call/expected.js | 6 ++- .../multiple-arguments/expected.js | 6 ++- .../syntax/arrow-functions/nested/actual.js | 16 +++--- .../syntax/arrow-functions/nested/expected.js | 6 ++- .../paran-insertion/expected.js | 6 ++- .../single-argument/expected.js | 6 ++- .../arrow-functions/statement/actual.js | 2 +- .../arrow-functions/statement/expected.js | 6 ++- .../syntax/arrow-functions/this/expected.js | 6 ++- .../classes/accessing-super-class/actual.js | 28 +++++----- .../classes/accessing-super-class/expected.js | 15 ++---- .../accessing-super-properties/actual.js | 4 +- .../accessing-super-properties/expected.js | 4 +- .../calling-super-properties/actual.js | 6 +-- .../calling-super-properties/expected.js | 8 ++- .../syntax/classes/constructor/actual.js | 4 +- .../syntax/classes/constructor/expected.js | 7 ++- .../instance-getter-and-setter/actual.js | 4 +- .../instance-getter-and-setter/expected.js | 15 ++++-- .../syntax/classes/instance-getter/actual.js | 2 +- .../classes/instance-getter/expected.js | 12 +++-- .../syntax/classes/instance-method/actual.js | 2 +- .../classes/instance-method/expected.js | 13 +++-- .../syntax/classes/instance-setter/actual.js | 2 +- .../classes/instance-setter/expected.js | 12 +++-- .../syntax/classes/plain-class/expected.js | 8 +-- .../syntax/classes/statement/actual.js | 4 +- .../syntax/classes/statement/expected.js | 11 ++-- .../syntax/classes/static/expected.js | 4 +- .../expected.js | 12 +++-- .../expected.js | 6 ++- .../syntax/classes/super-class/expected.js | 8 ++- .../classes/super-function-fallback/actual.js | 2 +- .../super-function-fallback/expected.js | 7 ++- .../comments/preserve-multi-line/expected.js | 6 +-- .../comments/preserve-single-line/expected.js | 4 +- .../argument/expected.js | 4 +- .../assignment/expected.js | 4 +- .../computed-property-names/method/actual.js | 2 +- .../method/expected.js | 9 ++-- .../computed-property-names/mixed/expected.js | 6 ++- .../multiple/expected.js | 6 ++- .../single/expected.js | 6 ++- .../computed-property-names/this/expected.js | 6 ++- .../variable/expected.js | 4 +- .../constants/block-statement/expected.js | 4 +- .../constants/destructuring/expected.js | 6 ++- .../syntax/constants/program/expected.js | 3 +- .../default-parameters/multiple/expected.js | 12 +++-- .../default-parameters/single/expected.js | 7 ++- .../syntax/destructuring/array/expected.js | 3 +- .../destructuring/assignment/expected.js | 3 +- .../syntax/destructuring/empty/expected.js | 3 +- .../syntax/destructuring/for-in/expected.js | 4 +- .../syntax/destructuring/for-of/expected.js | 6 ++- .../syntax/destructuring/mixed/expected.js | 3 +- .../syntax/destructuring/multiple/expected.js | 3 +- .../destructuring/object-advanced/expected.js | 3 +- .../destructuring/object-basic/expected.js | 3 +- .../destructuring/parameters/expected.js | 17 +++--- .../syntax/for-of/identifier/expected.js | 4 +- test/fixtures/syntax/for-of/let/expected.js | 6 ++- .../syntax/for-of/multiple/expected.js | 4 +- test/fixtures/syntax/for-of/var/expected.js | 4 +- .../fixtures/syntax/generators/for-of/exec.js | 4 +- .../fixtures/syntax/generators/simple/exec.js | 4 +- .../syntax/jsx/annotation/expected.js | 5 +- test/fixtures/syntax/jsx/empty/expected.js | 3 +- .../syntax/jsx/everything/expected.js | 8 ++- .../syntax/jsx/expressions/expected.js | 9 +++- .../syntax/jsx/known-tags/expected.js | 3 +- .../syntax/jsx/member-expression/expected.js | 3 +- .../syntax/jsx/self-closing-tags/expected.js | 6 ++- .../syntax/jsx/simple-tags/expected.js | 3 +- .../syntax/jsx/tags-with-children/expected.js | 11 +++- .../syntax/jsx/tags-with-literals/expected.js | 9 ++-- .../syntax/let-scoping/deep-nested/exec.js | 8 +-- .../let-scoping/for-in-initializers/exec.js | 10 ++-- .../let-scoping/for-initializers/exec.js | 8 +-- .../syntax/let-scoping/in-class/exec.js | 10 ++-- .../syntax/let-scoping/in-closure/exec.js | 14 ++--- .../let-scoping/in-for-break-inner/exec.js | 8 +-- .../let-scoping/in-for-break-named/exec.js | 8 +-- .../syntax/let-scoping/in-for-break/exec.js | 2 +- .../let-scoping/in-for-continue-inner/exec.js | 8 +-- .../let-scoping/in-for-continue-named/exec.js | 8 +-- .../let-scoping/in-for-continue/exec.js | 2 +- .../syntax/let-scoping/in-properties/exec.js | 16 +++--- .../let-scoping/initializer-for-3/exec.js | 2 +- .../let-scoping/nested-conflict/exec.js | 12 ++--- .../let-scoping/nested-function-1/exec.js | 2 +- .../let-scoping/nested-function-2/exec.js | 2 +- .../no-nested-function-declarations/actual.js | 2 +- .../syntax/let-scoping/regress-1381/exec.js | 4 +- .../syntax/let-scoping/with-for-in/exec.js | 2 +- .../syntax/let-scoping/with-for/exec.js | 2 +- .../syntax/let-scoping/with-switch/exec.js | 12 ++--- .../modules/exports-default/expected.js | 14 +++-- .../syntax/modules/exports-from/expected.js | 15 ++---- .../syntax/modules/exports-named/expected.js | 7 +-- .../modules/exports-variable/expected.js | 17 +++--- .../modules/hoist-function-exports/actual.js | 2 +- .../hoist-function-exports/expected.js | 12 +++-- .../modules/imports-default/expected.js | 3 +- .../syntax/modules/imports-glob/expected.js | 3 +- .../syntax/modules/imports-mixing/expected.js | 4 +- .../syntax/modules/imports-named/expected.js | 6 +-- .../syntax/modules/imports/expected.js | 3 +- .../syntax/modules/overview/expected.js | 12 +---- .../getter-and-setter/actual.js | 4 +- .../getter-and-setter/expected.js | 12 +++-- .../getter/actual.js | 2 +- .../getter/expected.js | 9 ++-- .../method/actual.js | 2 +- .../method/expected.js | 6 ++- .../setter/actual.js | 2 +- .../setter/expected.js | 9 ++-- .../property-name-shorthand/mixed/expected.js | 4 +- .../multiple/expected.js | 4 +- .../single/expected.js | 4 +- .../actual.js | 2 +- .../expected.js | 5 +- .../react/display-name-if-missing/actual.js | 2 +- .../react/display-name-if-missing/expected.js | 5 +- .../display-name-object-declaration/actual.js | 6 +-- .../expected.js | 5 +- .../actual.js | 2 +- .../expected.js | 5 +- .../actual.js | 2 +- .../expected.js | 5 +- .../rest-parameters/multiple/expected.js | 5 +- .../syntax/rest-parameters/single/expected.js | 5 +- .../source-maps/arrow-function/expected.js | 4 +- .../arrow-function/source-mappings.json | 6 +-- .../syntax/source-maps/class/expected.js | 6 ++- .../source-maps/class/source-mappings.json | 2 +- .../syntax/source-maps/full/expected.js | 6 ++- .../syntax/source-maps/full/source-map.json | 2 +- .../syntax/source-maps/inline/expected.js | 6 ++- .../syntax/spread/arguments/expected.js | 11 ++-- .../syntax/spread/array-literals/expected.js | 8 +-- .../expected.js | 11 ++-- .../expected.js | 3 +- .../method-call-array-literal/expected.js | 3 +- .../method-call-multiple-args/expected.js | 6 +-- .../spread/method-call-single-arg/expected.js | 3 +- .../escape-quotes/expected.js | 3 +- .../template-literals/functions/expected.js | 3 +- .../template-literals/multiline/expected.js | 3 +- .../template-literals/multiple/expected.js | 3 +- .../syntax/template-literals/none/expected.js | 3 +- .../syntax/template-literals/only/expected.js | 3 +- .../template-literals/single/expected.js | 3 +- .../template-literals/statement/expected.js | 3 +- .../syntax/template-literals/tag/expected.js | 3 +- .../syntax/unicode-regex/basic/expected.js | 8 ++- .../ignore-non-unicode/expected.js | 5 +- test/fixtures/syntax/use-strict/add/actual.js | 1 + .../syntax/use-strict/add/expected.js | 2 + .../syntax/use-strict/exists/actual.js | 3 ++ .../syntax/use-strict/exists/expected.js | 2 + 198 files changed, 697 insertions(+), 447 deletions(-) create mode 100644 test/fixtures/syntax/api/blacklist/untitled create mode 100644 test/fixtures/syntax/use-strict/add/actual.js create mode 100644 test/fixtures/syntax/use-strict/add/expected.js create mode 100644 test/fixtures/syntax/use-strict/exists/actual.js create mode 100644 test/fixtures/syntax/use-strict/exists/expected.js diff --git a/test/fixtures/bin/6to5/--blacklist/stdout.txt b/test/fixtures/bin/6to5/--blacklist/stdout.txt index 4bc9539528..4f64e641b1 100644 --- a/test/fixtures/bin/6to5/--blacklist/stdout.txt +++ b/test/fixtures/bin/6to5/--blacklist/stdout.txt @@ -1 +1,2 @@ +"use strict"; arr.map(x => x * MULTIPLIER); diff --git a/test/fixtures/bin/6to5/--whitelist/stdout.txt b/test/fixtures/bin/6to5/--whitelist/stdout.txt index bb8db60f68..ae40157425 100644 --- a/test/fixtures/bin/6to5/--whitelist/stdout.txt +++ b/test/fixtures/bin/6to5/--whitelist/stdout.txt @@ -1,3 +1,4 @@ +"use strict"; let MULTIPLER = 5; arr.map(function(x) { return x * MULTIPLIER; diff --git a/test/fixtures/bin/6to5/dir --out-dir --source-maps-inline/out-files/lib/bar/bar.js b/test/fixtures/bin/6to5/dir --out-dir --source-maps-inline/out-files/lib/bar/bar.js index 1bf5b4ff3b..19335839e3 100644 --- a/test/fixtures/bin/6to5/dir --out-dir --source-maps-inline/out-files/lib/bar/bar.js +++ b/test/fixtures/bin/6to5/dir --out-dir --source-maps-inline/out-files/lib/bar/bar.js @@ -1,5 +1,7 @@ +"use strict"; + var Test = function() { var Test = function Test() {}; return Test; }(); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibGliL2Jhci9iYXIuanMiLCJzb3VyY2VzIjpbInNyYy9iYXIvYmFyLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJJQUFNLENBQUMsQ0FBQyxDQUFDO01BQUgsQ0FBQyxDQUFDLENBQUMsYUFBSCxDQUFDLENBQUMsQ0FBQztTQUFILENBQUMsQ0FBQyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiY2xhc3MgVGVzdCB7XG5cbn0iXX0= +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3JjL2Jhci9iYXIuanMiLCJzb3VyY2VzIjpbInNyYy9iYXIvYmFyLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0lBQU0sQ0FBQyxDQUFDLENBQUM7TUFBSCxDQUFDLENBQUMsQ0FBQyxhQUFILENBQUMsQ0FBQyxDQUFDO1NBQUgsQ0FBQyxDQUFDLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJjbGFzcyBUZXN0IHtcblxufSJdfQ== diff --git a/test/fixtures/bin/6to5/dir --out-dir --source-maps-inline/out-files/lib/foo.js b/test/fixtures/bin/6to5/dir --out-dir --source-maps-inline/out-files/lib/foo.js index dd723202cc..189b9f0309 100644 --- a/test/fixtures/bin/6to5/dir --out-dir --source-maps-inline/out-files/lib/foo.js +++ b/test/fixtures/bin/6to5/dir --out-dir --source-maps-inline/out-files/lib/foo.js @@ -1,4 +1,5 @@ +"use strict"; arr.map(function(x) { return x * MULTIPLIER; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibGliL2Zvby5qcyIsInNvdXJjZXMiOlsic3JjL2Zvby5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLFVBQUM7U0FBSyxFQUFFLEVBQUUsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7Q0FBQyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiYXJyLm1hcCh4ID0+IHggKiBNVUxUSVBMSUVSKTsiXX0= +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3JjL2Zvby5qcyIsInNvdXJjZXMiOlsic3JjL2Zvby5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxVQUFDO1NBQUssRUFBRSxFQUFFLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0NBQUMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImFyci5tYXAoeCA9PiB4ICogTVVMVElQTElFUik7Il19 diff --git a/test/fixtures/bin/6to5/dir --out-dir --source-maps/out-files/lib/bar/bar.js b/test/fixtures/bin/6to5/dir --out-dir --source-maps/out-files/lib/bar/bar.js index b3f271de91..3730bcb807 100644 --- a/test/fixtures/bin/6to5/dir --out-dir --source-maps/out-files/lib/bar/bar.js +++ b/test/fixtures/bin/6to5/dir --out-dir --source-maps/out-files/lib/bar/bar.js @@ -1,3 +1,5 @@ +"use strict"; + var Test = function() { var Test = function Test() {}; return Test; diff --git a/test/fixtures/bin/6to5/dir --out-dir --source-maps/out-files/lib/bar/bar.js.map b/test/fixtures/bin/6to5/dir --out-dir --source-maps/out-files/lib/bar/bar.js.map index c105aa503e..c014dcbac1 100644 --- a/test/fixtures/bin/6to5/dir --out-dir --source-maps/out-files/lib/bar/bar.js.map +++ b/test/fixtures/bin/6to5/dir --out-dir --source-maps/out-files/lib/bar/bar.js.map @@ -1 +1 @@ -{"version":3,"file":"lib/bar/bar.js","sources":["src/bar/bar.js"],"names":[],"mappings":"IAAM,CAAC,CAAC,CAAC;MAAH,CAAC,CAAC,CAAC,aAAH,CAAC,CAAC,CAAC;SAAH,CAAC,CAAC,CAAC","sourcesContent":["class Test {\n\n}"]} +{"version":3,"file":"src/bar/bar.js","sources":["src/bar/bar.js"],"names":[],"mappings":";;IAAM,CAAC,CAAC,CAAC;MAAH,CAAC,CAAC,CAAC,aAAH,CAAC,CAAC,CAAC;SAAH,CAAC,CAAC,CAAC","sourcesContent":["class Test {\n\n}"]} diff --git a/test/fixtures/bin/6to5/dir --out-dir --source-maps/out-files/lib/foo.js b/test/fixtures/bin/6to5/dir --out-dir --source-maps/out-files/lib/foo.js index a075212f08..1c04e0dad5 100644 --- a/test/fixtures/bin/6to5/dir --out-dir --source-maps/out-files/lib/foo.js +++ b/test/fixtures/bin/6to5/dir --out-dir --source-maps/out-files/lib/foo.js @@ -1,3 +1,4 @@ +"use strict"; arr.map(function(x) { return x * MULTIPLIER; }); diff --git a/test/fixtures/bin/6to5/dir --out-dir --source-maps/out-files/lib/foo.js.map b/test/fixtures/bin/6to5/dir --out-dir --source-maps/out-files/lib/foo.js.map index d477110472..fdea7f96d5 100644 --- a/test/fixtures/bin/6to5/dir --out-dir --source-maps/out-files/lib/foo.js.map +++ b/test/fixtures/bin/6to5/dir --out-dir --source-maps/out-files/lib/foo.js.map @@ -1 +1 @@ -{"version":3,"file":"lib/foo.js","sources":["src/foo.js"],"names":[],"mappings":"AAAA,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAC;SAAK,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAC,CAAC","sourcesContent":["arr.map(x => x * MULTIPLIER);"]} +{"version":3,"file":"src/foo.js","sources":["src/foo.js"],"names":[],"mappings":";AAAA,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAC;SAAK,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAC,CAAC","sourcesContent":["arr.map(x => x * MULTIPLIER);"]} diff --git a/test/fixtures/bin/6to5/dir --out-dir/out-files/lib/bar/bar.js b/test/fixtures/bin/6to5/dir --out-dir/out-files/lib/bar/bar.js index b3f271de91..3730bcb807 100644 --- a/test/fixtures/bin/6to5/dir --out-dir/out-files/lib/bar/bar.js +++ b/test/fixtures/bin/6to5/dir --out-dir/out-files/lib/bar/bar.js @@ -1,3 +1,5 @@ +"use strict"; + var Test = function() { var Test = function Test() {}; return Test; diff --git a/test/fixtures/bin/6to5/dir --out-dir/out-files/lib/foo.js b/test/fixtures/bin/6to5/dir --out-dir/out-files/lib/foo.js index a075212f08..1c04e0dad5 100644 --- a/test/fixtures/bin/6to5/dir --out-dir/out-files/lib/foo.js +++ b/test/fixtures/bin/6to5/dir --out-dir/out-files/lib/foo.js @@ -1,3 +1,4 @@ +"use strict"; arr.map(function(x) { return x * MULTIPLIER; }); diff --git a/test/fixtures/bin/6to5/filename --out-file --source-maps-inline/out-files/script2.js b/test/fixtures/bin/6to5/filename --out-file --source-maps-inline/out-files/script2.js index 39576f49e1..e89e3b4250 100644 --- a/test/fixtures/bin/6to5/filename --out-file --source-maps-inline/out-files/script2.js +++ b/test/fixtures/bin/6to5/filename --out-file --source-maps-inline/out-files/script2.js @@ -1,5 +1,6 @@ +"use strict"; arr.map(function(x) { return x * MULTIPLIER; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNjcmlwdC5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLFVBQUM7U0FBSyxFQUFFLEVBQUUsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7Q0FBQyxDQUFDIiwiZmlsZSI6InNjcmlwdDIuanMiLCJzb3VyY2VzQ29udGVudCI6WyJhcnIubWFwKHggPT4geCAqIE1VTFRJUExJRVIpOyJdfQ== +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNjcmlwdC5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxVQUFDO1NBQUssRUFBRSxFQUFFLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0NBQUMsQ0FBQyIsImZpbGUiOiJzY3JpcHQyLmpzIiwic291cmNlc0NvbnRlbnQiOlsiYXJyLm1hcCh4ID0+IHggKiBNVUxUSVBMSUVSKTsiXX0= diff --git a/test/fixtures/bin/6to5/filename --out-file/out-files/script2.js b/test/fixtures/bin/6to5/filename --out-file/out-files/script2.js index a075212f08..1c04e0dad5 100644 --- a/test/fixtures/bin/6to5/filename --out-file/out-files/script2.js +++ b/test/fixtures/bin/6to5/filename --out-file/out-files/script2.js @@ -1,3 +1,4 @@ +"use strict"; arr.map(function(x) { return x * MULTIPLIER; }); diff --git a/test/fixtures/bin/6to5/filenames --out-file --source-maps-inline/out-files/script3.js b/test/fixtures/bin/6to5/filenames --out-file --source-maps-inline/out-files/script3.js index a178b67b5c..6e0fa4b40a 100644 --- a/test/fixtures/bin/6to5/filenames --out-file --source-maps-inline/out-files/script3.js +++ b/test/fixtures/bin/6to5/filenames --out-file --source-maps-inline/out-files/script3.js @@ -1,3 +1,5 @@ +"use strict"; + var Test = function() { var Test = function Test() {}; return Test; @@ -6,4 +8,4 @@ arr.map(function(x) { return x * MULTIPLIER; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNjcmlwdC5qcyIsInNjcmlwdDIuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IklBQU0sQ0FBQyxDQUFDLENBQUM7TUFBSCxDQUFDLENBQUMsQ0FBQyxhQUFILENBQUMsQ0FBQyxDQUFDO1NBQUgsQ0FBQyxDQUFDLENBQUM7OztBQ0FULENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsVUFBQztTQUFLLEVBQUUsRUFBRSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztDQUFDLENBQUMiLCJmaWxlIjoic2NyaXB0My5qcyIsInNvdXJjZXNDb250ZW50IjpbImNsYXNzIFRlc3Qge1xuXG59IiwiYXJyLm1hcCh4ID0+IHggKiBNVUxUSVBMSUVSKTsiXX0= +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNjcmlwdC5qcyIsInNjcmlwdDIuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7SUFBTSxDQUFDLENBQUMsQ0FBQztNQUFILENBQUMsQ0FBQyxDQUFDLGFBQUgsQ0FBQyxDQUFDLENBQUM7U0FBSCxDQUFDLENBQUMsQ0FBQzs7O0FDQVQsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxVQUFDO1NBQUssRUFBRSxFQUFFLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0NBQUMsQ0FBQyIsImZpbGUiOiJzY3JpcHQzLmpzIiwic291cmNlc0NvbnRlbnQiOlsiY2xhc3MgVGVzdCB7XG5cbn0iLCJhcnIubWFwKHggPT4geCAqIE1VTFRJUExJRVIpOyJdfQ== diff --git a/test/fixtures/bin/6to5/filenames --out-file --source-maps/out-files/script3.js b/test/fixtures/bin/6to5/filenames --out-file --source-maps/out-files/script3.js index 92cf41bd5a..9504a5acfb 100644 --- a/test/fixtures/bin/6to5/filenames --out-file --source-maps/out-files/script3.js +++ b/test/fixtures/bin/6to5/filenames --out-file --source-maps/out-files/script3.js @@ -1,3 +1,5 @@ +"use strict"; + var Test = function() { var Test = function Test() {}; return Test; diff --git a/test/fixtures/bin/6to5/filenames --out-file --source-maps/out-files/script3.js.map b/test/fixtures/bin/6to5/filenames --out-file --source-maps/out-files/script3.js.map index 730b2f7ee8..cd028d5e0f 100644 --- a/test/fixtures/bin/6to5/filenames --out-file --source-maps/out-files/script3.js.map +++ b/test/fixtures/bin/6to5/filenames --out-file --source-maps/out-files/script3.js.map @@ -1 +1 @@ -{"version":3,"sources":["script.js","script2.js"],"names":[],"mappings":"IAAM,CAAC,CAAC,CAAC;MAAH,CAAC,CAAC,CAAC,aAAH,CAAC,CAAC,CAAC;SAAH,CAAC,CAAC,CAAC;;;ACAT,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAC;SAAK,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAC,CAAC","file":"script3.js","sourcesContent":["class Test {\n\n}","arr.map(x => x * MULTIPLIER);"]} +{"version":3,"sources":["script.js","script2.js"],"names":[],"mappings":";;IAAM,CAAC,CAAC,CAAC;MAAH,CAAC,CAAC,CAAC,aAAH,CAAC,CAAC,CAAC;SAAH,CAAC,CAAC,CAAC;;;ACAT,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAC;SAAK,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAC,CAAC","file":"script3.js","sourcesContent":["class Test {\n\n}","arr.map(x => x * MULTIPLIER);"]} diff --git a/test/fixtures/bin/6to5/filenames --out-file/out-files/script3.js b/test/fixtures/bin/6to5/filenames --out-file/out-files/script3.js index 92cf41bd5a..9504a5acfb 100644 --- a/test/fixtures/bin/6to5/filenames --out-file/out-files/script3.js +++ b/test/fixtures/bin/6to5/filenames --out-file/out-files/script3.js @@ -1,3 +1,5 @@ +"use strict"; + var Test = function() { var Test = function Test() {}; return Test; diff --git a/test/fixtures/bin/6to5/stdin --out-file --source-maps/out-files/test.js b/test/fixtures/bin/6to5/stdin --out-file --source-maps/out-files/test.js index 2522e0b627..471925e927 100644 --- a/test/fixtures/bin/6to5/stdin --out-file --source-maps/out-files/test.js +++ b/test/fixtures/bin/6to5/stdin --out-file --source-maps/out-files/test.js @@ -1,3 +1,4 @@ +"use strict"; arr.map(function(x) { return x * x; }); diff --git a/test/fixtures/bin/6to5/stdin --out-file --source-maps/out-files/test.js.map b/test/fixtures/bin/6to5/stdin --out-file --source-maps/out-files/test.js.map index 890457fe53..81c63f2629 100644 --- a/test/fixtures/bin/6to5/stdin --out-file --source-maps/out-files/test.js.map +++ b/test/fixtures/bin/6to5/stdin --out-file --source-maps/out-files/test.js.map @@ -1 +1 @@ -{"version":3,"sources":["stdin"],"names":[],"mappings":"AAAA,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAC;SAAK,EAAE,EAAE;CAAC,CAAC","file":"test.js","sourcesContent":["arr.map(x => x * x);"]} +{"version":3,"sources":["stdin"],"names":[],"mappings":";AAAA,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAC;SAAK,EAAE,EAAE;CAAC,CAAC","file":"test.js","sourcesContent":["arr.map(x => x * x);"]} diff --git a/test/fixtures/bin/6to5/stdin --out-file/out-files/script.js b/test/fixtures/bin/6to5/stdin --out-file/out-files/script.js index a075212f08..1c04e0dad5 100644 --- a/test/fixtures/bin/6to5/stdin --out-file/out-files/script.js +++ b/test/fixtures/bin/6to5/stdin --out-file/out-files/script.js @@ -1,3 +1,4 @@ +"use strict"; arr.map(function(x) { return x * MULTIPLIER; }); diff --git a/test/fixtures/bin/6to5/stdin --source-maps-inline/stdout.txt b/test/fixtures/bin/6to5/stdin --source-maps-inline/stdout.txt index 78fab9f691..bbb43402ff 100644 --- a/test/fixtures/bin/6to5/stdin --source-maps-inline/stdout.txt +++ b/test/fixtures/bin/6to5/stdin --source-maps-inline/stdout.txt @@ -1,5 +1,6 @@ +"use strict"; arr.map(function(x) { return x * x; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0ZGluIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsVUFBQztTQUFLLEVBQUUsRUFBRTtDQUFDLENBQUMiLCJmaWxlIjoic3Rkb3V0Iiwic291cmNlc0NvbnRlbnQiOlsiYXJyLm1hcCh4ID0+IHggKiB4KTsiXX0= +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0ZGluIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLFVBQUM7U0FBSyxFQUFFLEVBQUU7Q0FBQyxDQUFDIiwiZmlsZSI6InN0ZG91dCIsInNvdXJjZXNDb250ZW50IjpbImFyci5tYXAoeCA9PiB4ICogeCk7Il19 diff --git a/test/fixtures/bin/6to5/stdin/stdout.txt b/test/fixtures/bin/6to5/stdin/stdout.txt index a075212f08..1c04e0dad5 100644 --- a/test/fixtures/bin/6to5/stdin/stdout.txt +++ b/test/fixtures/bin/6to5/stdin/stdout.txt @@ -1,3 +1,4 @@ +"use strict"; arr.map(function(x) { return x * MULTIPLIER; }); diff --git a/test/fixtures/syntax/api/blacklist/actual.js b/test/fixtures/syntax/api/blacklist/actual.js index 8ec84a062e..deaf9a91ef 100644 --- a/test/fixtures/syntax/api/blacklist/actual.js +++ b/test/fixtures/syntax/api/blacklist/actual.js @@ -1,5 +1,5 @@ class Test { constructor() { - arr.map(x => x * x); + arr.map(x => x * x); } } diff --git a/test/fixtures/syntax/api/blacklist/expected.js b/test/fixtures/syntax/api/blacklist/expected.js index c8515d28fd..5c7dbf6a7d 100644 --- a/test/fixtures/syntax/api/blacklist/expected.js +++ b/test/fixtures/syntax/api/blacklist/expected.js @@ -1,6 +1,9 @@ -var Test = function () { +"use strict"; + +var Test = function() { var Test = function Test() { arr.map(x => x * x); }; + return Test; -}(); +}(); \ No newline at end of file diff --git a/test/fixtures/syntax/api/blacklist/untitled b/test/fixtures/syntax/api/blacklist/untitled new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/fixtures/syntax/api/whitelist/actual.js b/test/fixtures/syntax/api/whitelist/actual.js index 8ec84a062e..deaf9a91ef 100644 --- a/test/fixtures/syntax/api/whitelist/actual.js +++ b/test/fixtures/syntax/api/whitelist/actual.js @@ -1,5 +1,5 @@ class Test { constructor() { - arr.map(x => x * x); + arr.map(x => x * x); } } diff --git a/test/fixtures/syntax/api/whitelist/expected.js b/test/fixtures/syntax/api/whitelist/expected.js index 6b57623869..64cc3616ec 100644 --- a/test/fixtures/syntax/api/whitelist/expected.js +++ b/test/fixtures/syntax/api/whitelist/expected.js @@ -1,7 +1,9 @@ +"use strict"; + class Test { constructor() { - arr.map(function (x) { + arr.map(function(x) { return x * x; }); } -} +} \ No newline at end of file diff --git a/test/fixtures/syntax/array-comprehension/arguments/expected.js b/test/fixtures/syntax/array-comprehension/arguments/expected.js index 4756c8e512..954bd30308 100644 --- a/test/fixtures/syntax/array-comprehension/arguments/expected.js +++ b/test/fixtures/syntax/array-comprehension/arguments/expected.js @@ -1,8 +1,11 @@ +"use strict"; + function add() { var _arguments = arguments; - return [1, 2, 3].map(function (i) { + + return [1, 2, 3].map(function(i) { return i * _arguments[0]; }); } -add(5); +add(5); \ No newline at end of file diff --git a/test/fixtures/syntax/array-comprehension/multiple-if/expected.js b/test/fixtures/syntax/array-comprehension/multiple-if/expected.js index 41f1912827..0d1c14d6b8 100644 --- a/test/fixtures/syntax/array-comprehension/multiple-if/expected.js +++ b/test/fixtures/syntax/array-comprehension/multiple-if/expected.js @@ -1,7 +1,10 @@ -var seattlers = function () { +"use strict"; + +var seattlers = function() { var _arr = []; - countries.forEach(function (customers) { - customers.forEach(function (c) { + + countries.forEach(function(customers) { + customers.forEach(function(c) { if (c.city == "Seattle") { _arr.push({ name: c.name, @@ -10,5 +13,6 @@ var seattlers = function () { } }); }); + return _arr; -}(); +}(); \ No newline at end of file diff --git a/test/fixtures/syntax/array-comprehension/multiple/expected.js b/test/fixtures/syntax/array-comprehension/multiple/expected.js index 0e1a5ed400..1bedd8be79 100644 --- a/test/fixtures/syntax/array-comprehension/multiple/expected.js +++ b/test/fixtures/syntax/array-comprehension/multiple/expected.js @@ -1,11 +1,13 @@ -var arr = (function () { +"use strict"; + +var arr = function() { var _arr = []; - "abcdefgh".split("").forEach(function (x) { - "12345678".split("").forEach(function (y) { + "abcdefgh".split("").forEach(function(x) { + "12345678".split("").forEach(function(y) { _arr.push(x + y); }); }); return _arr; -})(); +}(); \ No newline at end of file diff --git a/test/fixtures/syntax/array-comprehension/single-if/expected.js b/test/fixtures/syntax/array-comprehension/single-if/expected.js index 270bee8271..a2d0917ebc 100644 --- a/test/fixtures/syntax/array-comprehension/single-if/expected.js +++ b/test/fixtures/syntax/array-comprehension/single-if/expected.js @@ -1,8 +1,10 @@ -var seattlers = customers.filter(function (c) { +"use strict"; + +var seattlers = customers.filter(function(c) { return c.city == "Seattle"; -}).map(function (c) { +}).map(function(c) { return { name: c.name, age: c.age }; -}); +}); \ No newline at end of file diff --git a/test/fixtures/syntax/array-comprehension/single/expected.js b/test/fixtures/syntax/array-comprehension/single/expected.js index 3fa8f55c9b..619ae58bec 100644 --- a/test/fixtures/syntax/array-comprehension/single/expected.js +++ b/test/fixtures/syntax/array-comprehension/single/expected.js @@ -1,3 +1,5 @@ -var arr = [1, 2, 3].map(function (i) { +"use strict"; + +var arr = [1, 2, 3].map(function(i) { return i * i; -}); +}); \ No newline at end of file diff --git a/test/fixtures/syntax/array-comprehension/this/expected.js b/test/fixtures/syntax/array-comprehension/this/expected.js index c2875a91e0..d42443a592 100644 --- a/test/fixtures/syntax/array-comprehension/this/expected.js +++ b/test/fixtures/syntax/array-comprehension/this/expected.js @@ -1,8 +1,13 @@ +"use strict"; + function add() { var _this = this; - return [1, 2, 3].map(function (i) { + + return [1, 2, 3].map(function(i) { return i * _this.multiplier; }); } -add.call({ multiplier: 5 }); +add.call({ + multiplier: 5 +}); \ No newline at end of file diff --git a/test/fixtures/syntax/arrow-functions/arguments/actual.js b/test/fixtures/syntax/arrow-functions/arguments/actual.js index 198ac999f6..295bbe475e 100644 --- a/test/fixtures/syntax/arrow-functions/arguments/actual.js +++ b/test/fixtures/syntax/arrow-functions/arguments/actual.js @@ -8,7 +8,7 @@ function two() { var inner = () => arguments; var another = function () { - var inner2 = () => arguments; + var inner2 = () => arguments; }; return [].slice.call(inner()); @@ -35,10 +35,10 @@ five({ arguments: ["foo"] }); function six(obj) { var fn = () => { - var fn2 = function () { - return arguments[0]; - }; - return fn2("foobar"); + var fn2 = function () { + return arguments[0]; + }; + return fn2("foobar"); }; return fn(); } diff --git a/test/fixtures/syntax/arrow-functions/arguments/expected.js b/test/fixtures/syntax/arrow-functions/arguments/expected.js index cdaea83b94..3b375c58d4 100644 --- a/test/fixtures/syntax/arrow-functions/arguments/expected.js +++ b/test/fixtures/syntax/arrow-functions/arguments/expected.js @@ -1,56 +1,85 @@ +"use strict"; + function one() { var _arguments = arguments; - var inner = function () { return _arguments; }; + + var inner = function() { + return _arguments; + }; + return [].slice.call(inner()); } + one(1, 2); function two() { var _arguments2 = arguments; - var inner = function () { return _arguments2; }; - var another = function () { + var inner = function() { + return _arguments2; + }; + + var another = function() { var _arguments3 = arguments; - var inner2 = function () { return _arguments3; }; + + var inner2 = function() { + return _arguments3; + }; }; return [].slice.call(inner()); } + two(1, 2); function three() { var _arguments4 = arguments; - var fn = function () { + + var fn = function() { return _arguments4[0] + "bar"; }; + return fn(); } + three("foo"); function four() { var _arguments5 = arguments; - var fn = function () { + + var fn = function() { return _arguments5[0].foo + "bar"; }; + return fn(); } -four({ foo: "foo" }); + +four({ + foo: "foo" +}); function five(obj) { - var fn = function () { + var fn = function() { return obj.arguments[0].foo + "bar"; }; + return fn(); } -five({ arguments: ["foo"] }); + +five({ + arguments: ["foo"] +}); function six(obj) { - var fn = function () { - var fn2 = function () { + var fn = function() { + var fn2 = function() { return arguments[0]; }; + return fn2("foobar"); }; + return fn(); } -six(); + +six(); \ No newline at end of file diff --git a/test/fixtures/syntax/arrow-functions/empty-arguments/expected.js b/test/fixtures/syntax/arrow-functions/empty-arguments/expected.js index 4f6faf9601..b466d764b4 100644 --- a/test/fixtures/syntax/arrow-functions/empty-arguments/expected.js +++ b/test/fixtures/syntax/arrow-functions/empty-arguments/expected.js @@ -1,3 +1,5 @@ -var t = function () { +"use strict"; + +var t = function() { return 5 + 5; -}; +}; \ No newline at end of file diff --git a/test/fixtures/syntax/arrow-functions/empty-block/expected.js b/test/fixtures/syntax/arrow-functions/empty-block/expected.js index 846044c23e..ea38a60c98 100644 --- a/test/fixtures/syntax/arrow-functions/empty-block/expected.js +++ b/test/fixtures/syntax/arrow-functions/empty-block/expected.js @@ -1,2 +1,2 @@ -var t = function () { -}; +"use strict"; +var t = function() {}; \ No newline at end of file diff --git a/test/fixtures/syntax/arrow-functions/expression/expected.js b/test/fixtures/syntax/arrow-functions/expression/expected.js index e2bcfeb4cd..9691f5dcbf 100644 --- a/test/fixtures/syntax/arrow-functions/expression/expected.js +++ b/test/fixtures/syntax/arrow-functions/expression/expected.js @@ -1,3 +1,5 @@ -arr.map(function (x) { +"use strict"; + +arr.map(function(x) { return x * x; -}); +}); \ No newline at end of file diff --git a/test/fixtures/syntax/arrow-functions/inside-call/expected.js b/test/fixtures/syntax/arrow-functions/inside-call/expected.js index 61defa50d6..aad9088914 100644 --- a/test/fixtures/syntax/arrow-functions/inside-call/expected.js +++ b/test/fixtures/syntax/arrow-functions/inside-call/expected.js @@ -1,3 +1,5 @@ -arr.map(function (i) { +"use strict"; + +arr.map(function(i) { return i + 1; -}); +}); \ No newline at end of file diff --git a/test/fixtures/syntax/arrow-functions/multiple-arguments/expected.js b/test/fixtures/syntax/arrow-functions/multiple-arguments/expected.js index 8a79fc9fe8..e1d0026d1e 100644 --- a/test/fixtures/syntax/arrow-functions/multiple-arguments/expected.js +++ b/test/fixtures/syntax/arrow-functions/multiple-arguments/expected.js @@ -1,3 +1,5 @@ -var t = function (i, x) { +"use strict"; + +var t = function(i, x) { return i * x; -}; +}; \ No newline at end of file diff --git a/test/fixtures/syntax/arrow-functions/nested/actual.js b/test/fixtures/syntax/arrow-functions/nested/actual.js index 9387606df0..44bc6bd411 100644 --- a/test/fixtures/syntax/arrow-functions/nested/actual.js +++ b/test/fixtures/syntax/arrow-functions/nested/actual.js @@ -1,13 +1,13 @@ module.exports = { init() { - return new Promise((resolve, reject) => { - MongoClient.connect(config.mongodb, (err, db) => { - if (err) { - return reject(err); - } - this.db = db; - resolve(this); - }); + return new Promise((resolve, reject) => { + MongoClient.connect(config.mongodb, (err, db) => { + if (err) { + return reject(err); + } + this.db = db; + resolve(this); }); + }); } }; diff --git a/test/fixtures/syntax/arrow-functions/nested/expected.js b/test/fixtures/syntax/arrow-functions/nested/expected.js index 4c579ac3f0..dd88d22cb4 100644 --- a/test/fixtures/syntax/arrow-functions/nested/expected.js +++ b/test/fixtures/syntax/arrow-functions/nested/expected.js @@ -1,14 +1,18 @@ +"use strict"; + module.exports = { init: function() { var _this = this; + return new Promise(function(resolve, reject) { MongoClient.connect(config.mongodb, function(err, db) { if (err) { return reject(err); } + _this.db = db; resolve(_this); }); }); } -}; +}; \ No newline at end of file diff --git a/test/fixtures/syntax/arrow-functions/paran-insertion/expected.js b/test/fixtures/syntax/arrow-functions/paran-insertion/expected.js index 689ec63907..09605cc5a7 100644 --- a/test/fixtures/syntax/arrow-functions/paran-insertion/expected.js +++ b/test/fixtures/syntax/arrow-functions/paran-insertion/expected.js @@ -1,3 +1,5 @@ -var t = function (i) { +"use strict"; + +var t = function(i) { return i * 5; -}; +}; \ No newline at end of file diff --git a/test/fixtures/syntax/arrow-functions/single-argument/expected.js b/test/fixtures/syntax/arrow-functions/single-argument/expected.js index 689ec63907..09605cc5a7 100644 --- a/test/fixtures/syntax/arrow-functions/single-argument/expected.js +++ b/test/fixtures/syntax/arrow-functions/single-argument/expected.js @@ -1,3 +1,5 @@ -var t = function (i) { +"use strict"; + +var t = function(i) { return i * 5; -}; +}; \ No newline at end of file diff --git a/test/fixtures/syntax/arrow-functions/statement/actual.js b/test/fixtures/syntax/arrow-functions/statement/actual.js index 668b7483d2..f40cea5724 100644 --- a/test/fixtures/syntax/arrow-functions/statement/actual.js +++ b/test/fixtures/syntax/arrow-functions/statement/actual.js @@ -1,5 +1,5 @@ nums.forEach(v => { if (v % 5 === 0) { - fives.push(v); + fives.push(v); } }); diff --git a/test/fixtures/syntax/arrow-functions/statement/expected.js b/test/fixtures/syntax/arrow-functions/statement/expected.js index 40ecaad572..ec15fece3a 100644 --- a/test/fixtures/syntax/arrow-functions/statement/expected.js +++ b/test/fixtures/syntax/arrow-functions/statement/expected.js @@ -1,5 +1,7 @@ -nums.forEach(function (v) { +"use strict"; + +nums.forEach(function(v) { if (v % 5 === 0) { fives.push(v); } -}); +}); \ No newline at end of file diff --git a/test/fixtures/syntax/arrow-functions/this/expected.js b/test/fixtures/syntax/arrow-functions/this/expected.js index 3a88dcf154..6d2e107762 100644 --- a/test/fixtures/syntax/arrow-functions/this/expected.js +++ b/test/fixtures/syntax/arrow-functions/this/expected.js @@ -1,4 +1,6 @@ +"use strict"; var _this = this; -var t = function (x) { + +var t = function(x) { return _this.x + x; -}; +}; \ No newline at end of file diff --git a/test/fixtures/syntax/classes/accessing-super-class/actual.js b/test/fixtures/syntax/classes/accessing-super-class/actual.js index 64b349152c..c27fcb5ecb 100644 --- a/test/fixtures/syntax/classes/accessing-super-class/actual.js +++ b/test/fixtures/syntax/classes/accessing-super-class/actual.js @@ -1,26 +1,26 @@ class Test extends Foo { constructor() { - woops.super.test(); - super(); - super.test(); - foob(super); + woops.super.test(); + super(); + super.test(); + foob(super); - super(...arguments); - super("test", ...arguments); + super(...arguments); + super("test", ...arguments); - super.test(...arguments); - super.test("test", ...arguments); + super.test(...arguments); + super.test("test", ...arguments); } test() { - super(); - super(...arguments); - super("test", ...arguments); + super(); + super(...arguments); + super("test", ...arguments); } static foo() { - super(); - super(...arguments); - super("test", ...arguments); + super(); + super(...arguments); + super("test", ...arguments); } } diff --git a/test/fixtures/syntax/classes/accessing-super-class/expected.js b/test/fixtures/syntax/classes/accessing-super-class/expected.js index 70e4ced969..29748aca2e 100644 --- a/test/fixtures/syntax/classes/accessing-super-class/expected.js +++ b/test/fixtures/syntax/classes/accessing-super-class/expected.js @@ -1,3 +1,4 @@ +"use strict"; var _slice = Array.prototype.slice; var Test = function(Foo) { @@ -9,11 +10,7 @@ var Test = function(Foo) { Foo.call.apply(Foo, [this].concat(_slice.call(arguments))); Foo.call.apply(Foo, [this, "test"].concat(_slice.call(arguments))); Foo.prototype.test.call.apply(Foo.prototype, [this].concat(_slice.call(arguments))); - - Foo.prototype.test.call.apply( - Foo.prototype, - [this, "test"].concat(_slice.call(arguments)) - ); + Foo.prototype.test.call.apply(Foo.prototype, [this, "test"].concat(_slice.call(arguments))); }; Test.prototype = Object.create(Foo.prototype, { @@ -34,11 +31,7 @@ var Test = function(Foo) { value: function() { Foo.prototype.test.call(this); Foo.prototype.test.call.apply(Foo.prototype.test, [this].concat(_slice.call(arguments))); - - Foo.prototype.test.call.apply( - Foo.prototype.test, - [this, "test"].concat(_slice.call(arguments)) - ); + Foo.prototype.test.call.apply(Foo.prototype.test, [this, "test"].concat(_slice.call(arguments))); } } }); @@ -56,4 +49,4 @@ var Test = function(Foo) { }); return Test; -}(Foo); +}(Foo); \ No newline at end of file diff --git a/test/fixtures/syntax/classes/accessing-super-properties/actual.js b/test/fixtures/syntax/classes/accessing-super-properties/actual.js index 524a05eaa4..5ae821c032 100644 --- a/test/fixtures/syntax/classes/accessing-super-properties/actual.js +++ b/test/fixtures/syntax/classes/accessing-super-properties/actual.js @@ -1,6 +1,6 @@ class Test extends Foo { constructor() { - super.test; - super.test.whatever; + super.test; + super.test.whatever; } } diff --git a/test/fixtures/syntax/classes/accessing-super-properties/expected.js b/test/fixtures/syntax/classes/accessing-super-properties/expected.js index dceca76b06..5013de099b 100644 --- a/test/fixtures/syntax/classes/accessing-super-properties/expected.js +++ b/test/fixtures/syntax/classes/accessing-super-properties/expected.js @@ -1,3 +1,5 @@ +"use strict"; + var Test = function(Foo) { var Test = function Test() { Foo.prototype.test; @@ -15,4 +17,4 @@ var Test = function(Foo) { Test.__proto__ = Foo; return Test; -}(Foo); +}(Foo); \ No newline at end of file diff --git a/test/fixtures/syntax/classes/calling-super-properties/actual.js b/test/fixtures/syntax/classes/calling-super-properties/actual.js index 993109dc24..e0aa30ef4e 100644 --- a/test/fixtures/syntax/classes/calling-super-properties/actual.js +++ b/test/fixtures/syntax/classes/calling-super-properties/actual.js @@ -1,10 +1,10 @@ class Test extends Foo { constructor() { - super.test.whatever(); - super.test(); + super.test.whatever(); + super.test(); } static test() { - return super.wow(); + return super.wow(); } } diff --git a/test/fixtures/syntax/classes/calling-super-properties/expected.js b/test/fixtures/syntax/classes/calling-super-properties/expected.js index a509647767..c5efd91967 100644 --- a/test/fixtures/syntax/classes/calling-super-properties/expected.js +++ b/test/fixtures/syntax/classes/calling-super-properties/expected.js @@ -1,8 +1,11 @@ +"use strict"; + var Test = function(Foo) { var Test = function Test() { Foo.prototype.test.whatever(); Foo.prototype.test.call(this); }; + Test.prototype = Object.create(Foo.prototype, { constructor: { value: Test, @@ -11,7 +14,9 @@ var Test = function(Foo) { configurable: true } }); + Test.__proto__ = Foo; + Object.defineProperties(Test, { test: { writable: true, @@ -21,5 +26,6 @@ var Test = function(Foo) { } } }); + return Test; -}(Foo); +}(Foo); \ No newline at end of file diff --git a/test/fixtures/syntax/classes/constructor/actual.js b/test/fixtures/syntax/classes/constructor/actual.js index 2d26f87082..af62512cf9 100644 --- a/test/fixtures/syntax/classes/constructor/actual.js +++ b/test/fixtures/syntax/classes/constructor/actual.js @@ -1,11 +1,11 @@ class Test { constructor() { - this.state = "test"; + this.state = "test"; } } class Foo extends Bar { constructor() { - this.state = "test"; + this.state = "test"; } } diff --git a/test/fixtures/syntax/classes/constructor/expected.js b/test/fixtures/syntax/classes/constructor/expected.js index 9fff13ac23..b5657cfd8a 100644 --- a/test/fixtures/syntax/classes/constructor/expected.js +++ b/test/fixtures/syntax/classes/constructor/expected.js @@ -1,7 +1,10 @@ -var Test = function () { +"use strict"; + +var Test = function() { var Test = function Test() { this.state = "test"; }; + return Test; }(); @@ -21,4 +24,4 @@ var Foo = function(Bar) { Foo.__proto__ = Bar; return Foo; -}(Bar); +}(Bar); \ No newline at end of file diff --git a/test/fixtures/syntax/classes/instance-getter-and-setter/actual.js b/test/fixtures/syntax/classes/instance-getter-and-setter/actual.js index 52503296ec..d89f8ca733 100644 --- a/test/fixtures/syntax/classes/instance-getter-and-setter/actual.js +++ b/test/fixtures/syntax/classes/instance-getter-and-setter/actual.js @@ -1,8 +1,8 @@ class Test { get test() { - return 5 + 5; + return 5 + 5; } set test(val) { - this._test = val; + this._test = val; } } diff --git a/test/fixtures/syntax/classes/instance-getter-and-setter/expected.js b/test/fixtures/syntax/classes/instance-getter-and-setter/expected.js index 17b381a1f2..9a769db762 100644 --- a/test/fixtures/syntax/classes/instance-getter-and-setter/expected.js +++ b/test/fixtures/syntax/classes/instance-getter-and-setter/expected.js @@ -1,14 +1,19 @@ -var Test = function () { - var Test = function Test() { }; +"use strict"; + +var Test = function() { + var Test = function Test() {}; + Object.defineProperties(Test.prototype, { test: { - get: function () { + get: function() { return 5 + 5; }, - set: function (val) { + + set: function(val) { this._test = val; } } }); + return Test; -}(); +}(); \ No newline at end of file diff --git a/test/fixtures/syntax/classes/instance-getter/actual.js b/test/fixtures/syntax/classes/instance-getter/actual.js index 9eb0098289..01e0431985 100644 --- a/test/fixtures/syntax/classes/instance-getter/actual.js +++ b/test/fixtures/syntax/classes/instance-getter/actual.js @@ -1,5 +1,5 @@ class Test { get test() { - return 5 + 5; + return 5 + 5; } } diff --git a/test/fixtures/syntax/classes/instance-getter/expected.js b/test/fixtures/syntax/classes/instance-getter/expected.js index 30a11c3716..079333bb38 100644 --- a/test/fixtures/syntax/classes/instance-getter/expected.js +++ b/test/fixtures/syntax/classes/instance-getter/expected.js @@ -1,11 +1,15 @@ -var Test = function () { - var Test = function Test() { }; +"use strict"; + +var Test = function() { + var Test = function Test() {}; + Object.defineProperties(Test.prototype, { test: { - get: function () { + get: function() { return 5 + 5; } } }); + return Test; -}(); +}(); \ No newline at end of file diff --git a/test/fixtures/syntax/classes/instance-method/actual.js b/test/fixtures/syntax/classes/instance-method/actual.js index 2e89d3e4ec..441187c44f 100644 --- a/test/fixtures/syntax/classes/instance-method/actual.js +++ b/test/fixtures/syntax/classes/instance-method/actual.js @@ -1,5 +1,5 @@ class Test { test() { - return 5 + 5; + return 5 + 5; } } diff --git a/test/fixtures/syntax/classes/instance-method/expected.js b/test/fixtures/syntax/classes/instance-method/expected.js index 2bccbfb4ab..6c969044fb 100644 --- a/test/fixtures/syntax/classes/instance-method/expected.js +++ b/test/fixtures/syntax/classes/instance-method/expected.js @@ -1,12 +1,17 @@ -var Test = function () { - var Test = function Test() { }; +"use strict"; + +var Test = function() { + var Test = function Test() {}; + Object.defineProperties(Test.prototype, { test: { writable: true, - value: function () { + + value: function() { return 5 + 5; } } }); + return Test; -}(); +}(); \ No newline at end of file diff --git a/test/fixtures/syntax/classes/instance-setter/actual.js b/test/fixtures/syntax/classes/instance-setter/actual.js index abaadb738e..a109f5c218 100644 --- a/test/fixtures/syntax/classes/instance-setter/actual.js +++ b/test/fixtures/syntax/classes/instance-setter/actual.js @@ -1,5 +1,5 @@ class Test { set test(val) { - this._test = val; + this._test = val; } } diff --git a/test/fixtures/syntax/classes/instance-setter/expected.js b/test/fixtures/syntax/classes/instance-setter/expected.js index 4699c69f8a..a1e757f281 100644 --- a/test/fixtures/syntax/classes/instance-setter/expected.js +++ b/test/fixtures/syntax/classes/instance-setter/expected.js @@ -1,11 +1,15 @@ -var Test = function () { - var Test = function Test() { }; +"use strict"; + +var Test = function() { + var Test = function Test() {}; + Object.defineProperties(Test.prototype, { test: { - set: function (val) { + set: function(val) { this._test = val; } } }); + return Test; -}(); +}(); \ No newline at end of file diff --git a/test/fixtures/syntax/classes/plain-class/expected.js b/test/fixtures/syntax/classes/plain-class/expected.js index 4f3d4d5dab..8a01ecc89b 100644 --- a/test/fixtures/syntax/classes/plain-class/expected.js +++ b/test/fixtures/syntax/classes/plain-class/expected.js @@ -1,4 +1,6 @@ -var Test = function () { - var Test = function Test() { }; +"use strict"; + +var Test = function() { + var Test = function Test() {}; return Test; -}(); +}(); \ No newline at end of file diff --git a/test/fixtures/syntax/classes/statement/actual.js b/test/fixtures/syntax/classes/statement/actual.js index 310a60a07c..9c91c07071 100644 --- a/test/fixtures/syntax/classes/statement/actual.js +++ b/test/fixtures/syntax/classes/statement/actual.js @@ -1,11 +1,11 @@ var BaseView = class BaseView { constructor() { - this.autoRender = true; + this.autoRender = true; } } var BaseView = class { constructor() { - this.autoRender = true; + this.autoRender = true; } } diff --git a/test/fixtures/syntax/classes/statement/expected.js b/test/fixtures/syntax/classes/statement/expected.js index 609f9b176b..d0927c7d9c 100644 --- a/test/fixtures/syntax/classes/statement/expected.js +++ b/test/fixtures/syntax/classes/statement/expected.js @@ -1,4 +1,6 @@ -var BaseView = function () { +"use strict"; + +var BaseView = function() { var BaseView = function BaseView() { this.autoRender = true; }; @@ -6,9 +8,10 @@ var BaseView = function () { return BaseView; }(); -var BaseView = function () { - var _class = function () { +var BaseView = function() { + var _class = function() { this.autoRender = true; }; + return _class; -}(); +}(); \ No newline at end of file diff --git a/test/fixtures/syntax/classes/static/expected.js b/test/fixtures/syntax/classes/static/expected.js index e41390aeb8..75abf10471 100644 --- a/test/fixtures/syntax/classes/static/expected.js +++ b/test/fixtures/syntax/classes/static/expected.js @@ -1,3 +1,5 @@ +"use strict"; + var A = function() { var A = function A() {}; @@ -14,4 +16,4 @@ var A = function() { }); return A; -}(); +}(); \ No newline at end of file diff --git a/test/fixtures/syntax/classes/super-class-id-member-expression/expected.js b/test/fixtures/syntax/classes/super-class-id-member-expression/expected.js index b5c03b4ff5..3ff37e333e 100644 --- a/test/fixtures/syntax/classes/super-class-id-member-expression/expected.js +++ b/test/fixtures/syntax/classes/super-class-id-member-expression/expected.js @@ -1,7 +1,10 @@ -var BaseController = function (Chaplin) { +"use strict"; + +var BaseController = function(Chaplin) { var BaseController = function BaseController() { Chaplin.Controller.apply(this, arguments); }; + BaseController.prototype = Object.create(Chaplin.Controller.prototype, { constructor: { value: BaseController, @@ -10,14 +13,16 @@ var BaseController = function (Chaplin) { configurable: true } }); + BaseController.__proto__ = Chaplin.Controller; return BaseController; }(Chaplin); -var BaseController2 = function (Chaplin) { +var BaseController2 = function(Chaplin) { var BaseController2 = function BaseController2() { Chaplin.Controller.Another.apply(this, arguments); }; + BaseController2.prototype = Object.create(Chaplin.Controller.Another.prototype, { constructor: { value: BaseController2, @@ -26,6 +31,7 @@ var BaseController2 = function (Chaplin) { configurable: true } }); + BaseController2.__proto__ = Chaplin.Controller.Another; return BaseController2; -}(Chaplin); +}(Chaplin); \ No newline at end of file diff --git a/test/fixtures/syntax/classes/super-class-id-non-identifiers/expected.js b/test/fixtures/syntax/classes/super-class-id-non-identifiers/expected.js index 40b8fcc61b..f238d5aa06 100644 --- a/test/fixtures/syntax/classes/super-class-id-non-identifiers/expected.js +++ b/test/fixtures/syntax/classes/super-class-id-non-identifiers/expected.js @@ -1,3 +1,5 @@ +"use strict"; + var Q = function(_ref) { var Q = function Q() { _ref.apply(this, arguments); @@ -11,7 +13,7 @@ var Q = function(_ref) { configurable: true } }); - Q.__proto__ = _ref; + Q.__proto__ = _ref; return Q; -}(function() {}); +}(function() {}); \ No newline at end of file diff --git a/test/fixtures/syntax/classes/super-class/expected.js b/test/fixtures/syntax/classes/super-class/expected.js index 53ea768531..129e3a2c6b 100644 --- a/test/fixtures/syntax/classes/super-class/expected.js +++ b/test/fixtures/syntax/classes/super-class/expected.js @@ -1,7 +1,10 @@ -var Test = function (Foo) { +"use strict"; + +var Test = function(Foo) { var Test = function Test() { Foo.apply(this, arguments); }; + Test.prototype = Object.create(Foo.prototype, { constructor: { value: Test, @@ -10,6 +13,7 @@ var Test = function (Foo) { configurable: true } }); + Test.__proto__ = Foo; return Test; -}(Foo); +}(Foo); \ No newline at end of file diff --git a/test/fixtures/syntax/classes/super-function-fallback/actual.js b/test/fixtures/syntax/classes/super-function-fallback/actual.js index 18ebeb8f30..a91635eec0 100644 --- a/test/fixtures/syntax/classes/super-function-fallback/actual.js +++ b/test/fixtures/syntax/classes/super-function-fallback/actual.js @@ -1,5 +1,5 @@ class Test { constructor() { - super.hasOwnProperty("test"); + super.hasOwnProperty("test"); } } diff --git a/test/fixtures/syntax/classes/super-function-fallback/expected.js b/test/fixtures/syntax/classes/super-function-fallback/expected.js index 73cf9bb263..fd52698532 100644 --- a/test/fixtures/syntax/classes/super-function-fallback/expected.js +++ b/test/fixtures/syntax/classes/super-function-fallback/expected.js @@ -1,6 +1,9 @@ -var Test = function () { +"use strict"; + +var Test = function() { var Test = function Test() { Function.prototype.hasOwnProperty.call(this, "test"); }; + return Test; -}(); +}(); \ No newline at end of file diff --git a/test/fixtures/syntax/comments/preserve-multi-line/expected.js b/test/fixtures/syntax/comments/preserve-multi-line/expected.js index 07c91027c9..af07f9cc9b 100644 --- a/test/fixtures/syntax/comments/preserve-multi-line/expected.js +++ b/test/fixtures/syntax/comments/preserve-multi-line/expected.js @@ -1,5 +1,3 @@ +"use strict"; wow; -/* - um yeah lol -*/ -test.wow(); +test.wow(); \ No newline at end of file diff --git a/test/fixtures/syntax/comments/preserve-single-line/expected.js b/test/fixtures/syntax/comments/preserve-single-line/expected.js index 08459da466..af07f9cc9b 100644 --- a/test/fixtures/syntax/comments/preserve-single-line/expected.js +++ b/test/fixtures/syntax/comments/preserve-single-line/expected.js @@ -1,3 +1,3 @@ +"use strict"; wow; -// um yeah lol -test.wow(); +test.wow(); \ No newline at end of file diff --git a/test/fixtures/syntax/computed-property-names/argument/expected.js b/test/fixtures/syntax/computed-property-names/argument/expected.js index 9865ef7e60..c0a552041c 100644 --- a/test/fixtures/syntax/computed-property-names/argument/expected.js +++ b/test/fixtures/syntax/computed-property-names/argument/expected.js @@ -1,4 +1,6 @@ +"use strict"; + foo(function(_ref) { _ref[bar] = "foobar"; return _ref; -}({})); +}({})); \ No newline at end of file diff --git a/test/fixtures/syntax/computed-property-names/assignment/expected.js b/test/fixtures/syntax/computed-property-names/assignment/expected.js index c432b74583..32ec3eae9a 100644 --- a/test/fixtures/syntax/computed-property-names/assignment/expected.js +++ b/test/fixtures/syntax/computed-property-names/assignment/expected.js @@ -1,4 +1,6 @@ +"use strict"; + foo = function(_foo) { _foo[bar] = "foobar"; return _foo; -}({}); +}({}); \ No newline at end of file diff --git a/test/fixtures/syntax/computed-property-names/method/actual.js b/test/fixtures/syntax/computed-property-names/method/actual.js index 068edebd55..139554efc3 100644 --- a/test/fixtures/syntax/computed-property-names/method/actual.js +++ b/test/fixtures/syntax/computed-property-names/method/actual.js @@ -1,5 +1,5 @@ var obj = { [foobar]() { - return "foobar"; + return "foobar"; } }; diff --git a/test/fixtures/syntax/computed-property-names/method/expected.js b/test/fixtures/syntax/computed-property-names/method/expected.js index 11bc369aff..198f336e49 100644 --- a/test/fixtures/syntax/computed-property-names/method/expected.js +++ b/test/fixtures/syntax/computed-property-names/method/expected.js @@ -1,6 +1,9 @@ -var obj = function (_obj) { - _obj[foobar] = function () { +"use strict"; + +var obj = function(_obj) { + _obj[foobar] = function() { return "foobar"; }; + return _obj; -}({}); +}({}); \ No newline at end of file diff --git a/test/fixtures/syntax/computed-property-names/mixed/expected.js b/test/fixtures/syntax/computed-property-names/mixed/expected.js index f8fcc2f4d8..41bbf61c83 100644 --- a/test/fixtures/syntax/computed-property-names/mixed/expected.js +++ b/test/fixtures/syntax/computed-property-names/mixed/expected.js @@ -1,8 +1,10 @@ -var obj = function (_obj) { +"use strict"; + +var obj = function(_obj) { _obj["x" + foo] = "heh"; _obj["y" + bar] = "noo"; return _obj; }({ foo: "foo", bar: "bar" -}); +}); \ No newline at end of file diff --git a/test/fixtures/syntax/computed-property-names/multiple/expected.js b/test/fixtures/syntax/computed-property-names/multiple/expected.js index 10cf8cb14a..a922fb279a 100644 --- a/test/fixtures/syntax/computed-property-names/multiple/expected.js +++ b/test/fixtures/syntax/computed-property-names/multiple/expected.js @@ -1,5 +1,7 @@ -var obj = function (_obj) { +"use strict"; + +var obj = function(_obj) { _obj["x" + foo] = "heh"; _obj["y" + bar] = "noo"; return _obj; -}({}); +}({}); \ No newline at end of file diff --git a/test/fixtures/syntax/computed-property-names/single/expected.js b/test/fixtures/syntax/computed-property-names/single/expected.js index 6d4a23a060..d1ddd8d1b0 100644 --- a/test/fixtures/syntax/computed-property-names/single/expected.js +++ b/test/fixtures/syntax/computed-property-names/single/expected.js @@ -1,4 +1,6 @@ -var obj = function (_obj) { +"use strict"; + +var obj = function(_obj) { _obj["x" + foo] = "heh"; return _obj; -}({}); +}({}); \ No newline at end of file diff --git a/test/fixtures/syntax/computed-property-names/this/expected.js b/test/fixtures/syntax/computed-property-names/this/expected.js index 64bfd6da04..958a6e472c 100644 --- a/test/fixtures/syntax/computed-property-names/this/expected.js +++ b/test/fixtures/syntax/computed-property-names/this/expected.js @@ -1,5 +1,7 @@ +"use strict"; var _this = this; -var obj = function (_obj) { + +var obj = function(_obj) { _obj["x" + _this.foo] = "heh"; return _obj; -}({}); +}({}); \ No newline at end of file diff --git a/test/fixtures/syntax/computed-property-names/variable/expected.js b/test/fixtures/syntax/computed-property-names/variable/expected.js index 400286a528..6f6fcc0fd8 100644 --- a/test/fixtures/syntax/computed-property-names/variable/expected.js +++ b/test/fixtures/syntax/computed-property-names/variable/expected.js @@ -1,4 +1,6 @@ +"use strict"; + var foo = function(_foo) { _foo[bar] = "foobar"; return _foo; -}({}); +}({}); \ No newline at end of file diff --git a/test/fixtures/syntax/constants/block-statement/expected.js b/test/fixtures/syntax/constants/block-statement/expected.js index 9914078fb6..48a1c508d7 100644 --- a/test/fixtures/syntax/constants/block-statement/expected.js +++ b/test/fixtures/syntax/constants/block-statement/expected.js @@ -1,4 +1,6 @@ +"use strict"; + for (var _i in arr) { var _MULTIPLIER = 5; console.log(arr[_i] * _MULTIPLIER); -} +} \ No newline at end of file diff --git a/test/fixtures/syntax/constants/destructuring/expected.js b/test/fixtures/syntax/constants/destructuring/expected.js index e0990ba2d1..5447639209 100644 --- a/test/fixtures/syntax/constants/destructuring/expected.js +++ b/test/fixtures/syntax/constants/destructuring/expected.js @@ -1,7 +1,7 @@ +"use strict"; var _ref = [1, 2]; var _a = _ref[0]; var _b = _ref[1]; - var _ref2 = [3, 4]; var _c = _ref2[0]; var _d = _ref2[1]; @@ -10,6 +10,7 @@ var _ref3 = { e: 5, f: 6 }; + var _e = _ref3.e; var _f = _ref3.f; @@ -17,5 +18,6 @@ var _ref4 = { a: 7, b: 8 }; + var _g = _ref4.a; -var _h = _ref4.b; +var _h = _ref4.b; \ No newline at end of file diff --git a/test/fixtures/syntax/constants/program/expected.js b/test/fixtures/syntax/constants/program/expected.js index 94190e5922..893bf38e7a 100644 --- a/test/fixtures/syntax/constants/program/expected.js +++ b/test/fixtures/syntax/constants/program/expected.js @@ -1,5 +1,6 @@ +"use strict"; var _MULTIPLIER = 5; for (var i in arr) { console.log(arr[i] * _MULTIPLIER); -} +} \ No newline at end of file diff --git a/test/fixtures/syntax/default-parameters/multiple/expected.js b/test/fixtures/syntax/default-parameters/multiple/expected.js index 9499e0d98b..fb322b482d 100644 --- a/test/fixtures/syntax/default-parameters/multiple/expected.js +++ b/test/fixtures/syntax/default-parameters/multiple/expected.js @@ -1,12 +1,18 @@ -var t = function (t, f) { +"use strict"; + +var t = function(t, f) { if (f === undefined) f = 5; + if (t === undefined) t = "foo"; + return t + " bar " + f; }; -var a = function (t, f) { + +var a = function(t, f) { if (f === undefined) f = 5; + return t + " bar " + f; -}; +}; \ No newline at end of file diff --git a/test/fixtures/syntax/default-parameters/single/expected.js b/test/fixtures/syntax/default-parameters/single/expected.js index 1e1dcd73e6..173a0d6e82 100644 --- a/test/fixtures/syntax/default-parameters/single/expected.js +++ b/test/fixtures/syntax/default-parameters/single/expected.js @@ -1,5 +1,8 @@ -var t = function (t) { +"use strict"; + +var t = function(t) { if (t === undefined) t = "foo"; + return t + " bar"; -}; +}; \ No newline at end of file diff --git a/test/fixtures/syntax/destructuring/array/expected.js b/test/fixtures/syntax/destructuring/array/expected.js index fd4e31e621..46ab026397 100644 --- a/test/fixtures/syntax/destructuring/array/expected.js +++ b/test/fixtures/syntax/destructuring/array/expected.js @@ -1,5 +1,6 @@ +"use strict"; var _ref = ["hello", [", ", "junk"], ["world"]]; var a = _ref[0]; var b = _ref[1][0]; var c = _ref[2][0]; -var d = _ref[3]; +var d = _ref[3]; \ No newline at end of file diff --git a/test/fixtures/syntax/destructuring/assignment/expected.js b/test/fixtures/syntax/destructuring/assignment/expected.js index c086e01429..e018068ea7 100644 --- a/test/fixtures/syntax/destructuring/assignment/expected.js +++ b/test/fixtures/syntax/destructuring/assignment/expected.js @@ -1,3 +1,4 @@ +"use strict"; var _ref = f(); a = _ref[0]; -b = _ref[1]; +b = _ref[1]; \ No newline at end of file diff --git a/test/fixtures/syntax/destructuring/empty/expected.js b/test/fixtures/syntax/destructuring/empty/expected.js index 39a7784f2d..19ba8f8c45 100644 --- a/test/fixtures/syntax/destructuring/empty/expected.js +++ b/test/fixtures/syntax/destructuring/empty/expected.js @@ -1,5 +1,6 @@ +"use strict"; var _ref = ["foo", "hello", [", ", "junk"], ["world"]]; var a = _ref[1]; var b = _ref[2][0]; var c = _ref[3][0]; -var d = _ref[4]; +var d = _ref[4]; \ No newline at end of file diff --git a/test/fixtures/syntax/destructuring/for-in/expected.js b/test/fixtures/syntax/destructuring/for-in/expected.js index f07723cb59..095e23d1b7 100644 --- a/test/fixtures/syntax/destructuring/for-in/expected.js +++ b/test/fixtures/syntax/destructuring/for-in/expected.js @@ -1,5 +1,7 @@ +"use strict"; + for (var _ref in obj) { var name = _ref[0]; var value = _ref[1]; print("Name: " + name + ", Value: " + value); -} +} \ No newline at end of file diff --git a/test/fixtures/syntax/destructuring/for-of/expected.js b/test/fixtures/syntax/destructuring/for-of/expected.js index 3ba44b3480..37b42ad4c5 100644 --- a/test/fixtures/syntax/destructuring/for-of/expected.js +++ b/test/fixtures/syntax/destructuring/for-of/expected.js @@ -1,6 +1,8 @@ -for (var _iterator = this.test.expectation.registers[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) { +"use strict"; + +for (var _iterator = this.test.expectation.registers[Symbol.iterator](), _step; !(_step = _iterator.next()).done; ) { var _ref = _step.value; var name = _ref[0]; var before = _ref[1]; var after = _ref[2]; -} +} \ No newline at end of file diff --git a/test/fixtures/syntax/destructuring/mixed/expected.js b/test/fixtures/syntax/destructuring/mixed/expected.js index e5f59c7965..f627baae57 100644 --- a/test/fixtures/syntax/destructuring/mixed/expected.js +++ b/test/fixtures/syntax/destructuring/mixed/expected.js @@ -1,4 +1,5 @@ +"use strict"; var x1 = rect.topLeft[0]; var y1 = rect.topLeft[1]; var x2 = rect.bottomRight[0]; -var y2 = rect.bottomRight[1]; +var y2 = rect.bottomRight[1]; \ No newline at end of file diff --git a/test/fixtures/syntax/destructuring/multiple/expected.js b/test/fixtures/syntax/destructuring/multiple/expected.js index 0dcad7cc0f..5265295a8e 100644 --- a/test/fixtures/syntax/destructuring/multiple/expected.js +++ b/test/fixtures/syntax/destructuring/multiple/expected.js @@ -1,3 +1,4 @@ +"use strict"; var x = coords.x; var y = coords.y; -var foo = "bar"; +var foo = "bar"; \ No newline at end of file diff --git a/test/fixtures/syntax/destructuring/object-advanced/expected.js b/test/fixtures/syntax/destructuring/object-advanced/expected.js index ed6a605810..4936464371 100644 --- a/test/fixtures/syntax/destructuring/object-advanced/expected.js +++ b/test/fixtures/syntax/destructuring/object-advanced/expected.js @@ -1,4 +1,5 @@ +"use strict"; var x1 = rect.topLeft.x; var y1 = rect.topLeft.y; var x2 = rect.bottomRight.x; -var y2 = rect.bottomRight.y; +var y2 = rect.bottomRight.y; \ No newline at end of file diff --git a/test/fixtures/syntax/destructuring/object-basic/expected.js b/test/fixtures/syntax/destructuring/object-basic/expected.js index 5ee3fb667e..544897c6e4 100644 --- a/test/fixtures/syntax/destructuring/object-basic/expected.js +++ b/test/fixtures/syntax/destructuring/object-basic/expected.js @@ -1,2 +1,3 @@ +"use strict"; var x = coords.x; -var y = coords.y; +var y = coords.y; \ No newline at end of file diff --git a/test/fixtures/syntax/destructuring/parameters/expected.js b/test/fixtures/syntax/destructuring/parameters/expected.js index 3af19ef55b..fe88a098a3 100644 --- a/test/fixtures/syntax/destructuring/parameters/expected.js +++ b/test/fixtures/syntax/destructuring/parameters/expected.js @@ -1,4 +1,6 @@ -function somethingAdvanced(_ref){ +"use strict"; + +function somethingAdvanced(_ref) { var x1 = _ref.topLeft.x; var y1 = _ref.topLeft.y; var x2 = _ref.bottomRight.x; @@ -8,21 +10,22 @@ function somethingAdvanced(_ref){ function unpackObject(_ref2) { var title = _ref2.title; var author = _ref2.author; - return title + ' ' + author; + return title + " " + author; } -console.log(unpackObject({title: 'title', author: 'author'})); +console.log(unpackObject({ + title: "title", + author: "author" +})); -var unpackArray = function (_ref3, _ref4) { +var unpackArray = function(_ref3, _ref4) { var a = _ref3[0]; var b = _ref3[1]; var c = _ref3[2]; - var x = _ref4[0]; var y = _ref4[1]; var z = _ref4[2]; - return a + b + c; }; -console.log(unpackArray(['hello', ', ', 'world'], [1, 2, 3])); +console.log(unpackArray(["hello", ", ", "world"], [1, 2, 3])); \ No newline at end of file diff --git a/test/fixtures/syntax/for-of/identifier/expected.js b/test/fixtures/syntax/for-of/identifier/expected.js index 24d6fbbd73..473b0db507 100644 --- a/test/fixtures/syntax/for-of/identifier/expected.js +++ b/test/fixtures/syntax/for-of/identifier/expected.js @@ -1,3 +1,5 @@ +"use strict"; + for (var _iterator = arr[Symbol.iterator](), _step; !(_step = _iterator.next()).done; ) { i = _step.value; -} +} \ No newline at end of file diff --git a/test/fixtures/syntax/for-of/let/expected.js b/test/fixtures/syntax/for-of/let/expected.js index d7d9f90684..21113f9fe9 100644 --- a/test/fixtures/syntax/for-of/let/expected.js +++ b/test/fixtures/syntax/for-of/let/expected.js @@ -1,3 +1,5 @@ -for (var _iterator = arr[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) { +"use strict"; + +for (var _iterator = arr[Symbol.iterator](), _step; !(_step = _iterator.next()).done; ) { var _i = _step.value; -} +} \ No newline at end of file diff --git a/test/fixtures/syntax/for-of/multiple/expected.js b/test/fixtures/syntax/for-of/multiple/expected.js index f1d3d35477..ba12446e35 100644 --- a/test/fixtures/syntax/for-of/multiple/expected.js +++ b/test/fixtures/syntax/for-of/multiple/expected.js @@ -1,7 +1,9 @@ +"use strict"; + for (var _iterator = arr[Symbol.iterator](), _step; !(_step = _iterator.next()).done; ) { var i = _step.value; } for (var _iterator2 = numbers[Symbol.iterator](), _step2; !(_step2 = _iterator2.next()).done; ) { var i = _step2.value; -} +} \ No newline at end of file diff --git a/test/fixtures/syntax/for-of/var/expected.js b/test/fixtures/syntax/for-of/var/expected.js index 7bfbba1636..943b187ac7 100644 --- a/test/fixtures/syntax/for-of/var/expected.js +++ b/test/fixtures/syntax/for-of/var/expected.js @@ -1,3 +1,5 @@ +"use strict"; + for (var _iterator = arr[Symbol.iterator](), _step; !(_step = _iterator.next()).done; ) { var i = _step.value; -} +} \ No newline at end of file diff --git a/test/fixtures/syntax/generators/for-of/exec.js b/test/fixtures/syntax/generators/for-of/exec.js index 9b13528d62..d2d215f7af 100644 --- a/test/fixtures/syntax/generators/for-of/exec.js +++ b/test/fixtures/syntax/generators/for-of/exec.js @@ -3,8 +3,8 @@ function *range(max, step) { step = step || 1; for (var i = 0; i < max; i += step) { - count++; - yield i; + count++; + yield i; } return count; diff --git a/test/fixtures/syntax/generators/simple/exec.js b/test/fixtures/syntax/generators/simple/exec.js index 6f86130c52..f1da014501 100644 --- a/test/fixtures/syntax/generators/simple/exec.js +++ b/test/fixtures/syntax/generators/simple/exec.js @@ -3,8 +3,8 @@ function *range(max, step) { step = step || 1; for (var i = 0; i < max; i += step) { - count++; - yield i; + count++; + yield i; } return count; diff --git a/test/fixtures/syntax/jsx/annotation/expected.js b/test/fixtures/syntax/jsx/annotation/expected.js index aa330e202c..cd478b7097 100644 --- a/test/fixtures/syntax/jsx/annotation/expected.js +++ b/test/fixtures/syntax/jsx/annotation/expected.js @@ -1,3 +1,2 @@ -/** @jsx CUSTOM_DOM */ - -CUSTOM_DOM.a(null); +"use strict"; +CUSTOM_DOM.a(null); \ No newline at end of file diff --git a/test/fixtures/syntax/jsx/empty/expected.js b/test/fixtures/syntax/jsx/empty/expected.js index c53b756820..4835a2a251 100644 --- a/test/fixtures/syntax/jsx/empty/expected.js +++ b/test/fixtures/syntax/jsx/empty/expected.js @@ -1 +1,2 @@ -x(null, null); +"use strict"; +x(null, null); \ No newline at end of file diff --git a/test/fixtures/syntax/jsx/everything/expected.js b/test/fixtures/syntax/jsx/everything/expected.js index ceec44278a..7d39e64fbc 100644 --- a/test/fixtures/syntax/jsx/everything/expected.js +++ b/test/fixtures/syntax/jsx/everything/expected.js @@ -1,3 +1,7 @@ +"use strict"; + X({ - "data-prop": x ? Y({ prop: 2 }) : Z(null, "\n") -}); + "data-prop": (x ? Y({ + prop: 2 + }) : Z(null, "\n")) +}); \ No newline at end of file diff --git a/test/fixtures/syntax/jsx/expressions/expected.js b/test/fixtures/syntax/jsx/expressions/expected.js index e3f64bdf5c..d3818d86d3 100644 --- a/test/fixtures/syntax/jsx/expressions/expected.js +++ b/test/fixtures/syntax/jsx/expressions/expected.js @@ -1,3 +1,8 @@ +"use strict"; X(null, a); -X(null, [a, ' ', b]); -X({ prop: a, yes: true }); +X(null, [a, " ", b]); + +X({ + prop: a, + yes: true +}); \ No newline at end of file diff --git a/test/fixtures/syntax/jsx/known-tags/expected.js b/test/fixtures/syntax/jsx/known-tags/expected.js index 6748f42b9a..ec70567216 100644 --- a/test/fixtures/syntax/jsx/known-tags/expected.js +++ b/test/fixtures/syntax/jsx/known-tags/expected.js @@ -1 +1,2 @@ -React.DOM.a(null); +"use strict"; +React.DOM.a(null); \ No newline at end of file diff --git a/test/fixtures/syntax/jsx/member-expression/expected.js b/test/fixtures/syntax/jsx/member-expression/expected.js index 662c5f7202..4dea12440d 100644 --- a/test/fixtures/syntax/jsx/member-expression/expected.js +++ b/test/fixtures/syntax/jsx/member-expression/expected.js @@ -1 +1,2 @@ -Test.X(null); +"use strict"; +Test.X(null); \ No newline at end of file diff --git a/test/fixtures/syntax/jsx/self-closing-tags/expected.js b/test/fixtures/syntax/jsx/self-closing-tags/expected.js index b458a16d46..3ebb174fab 100644 --- a/test/fixtures/syntax/jsx/self-closing-tags/expected.js +++ b/test/fixtures/syntax/jsx/self-closing-tags/expected.js @@ -1,2 +1,6 @@ +"use strict"; X(null); -X({ prop: '1' }); + +X({ + prop: "1" +}); \ No newline at end of file diff --git a/test/fixtures/syntax/jsx/simple-tags/expected.js b/test/fixtures/syntax/jsx/simple-tags/expected.js index 4607adc599..f38433898c 100644 --- a/test/fixtures/syntax/jsx/simple-tags/expected.js +++ b/test/fixtures/syntax/jsx/simple-tags/expected.js @@ -1 +1,2 @@ -X(null); +"use strict"; +X(null); \ No newline at end of file diff --git a/test/fixtures/syntax/jsx/tags-with-children/expected.js b/test/fixtures/syntax/jsx/tags-with-children/expected.js index ac6bcd1937..1183f4a58a 100644 --- a/test/fixtures/syntax/jsx/tags-with-children/expected.js +++ b/test/fixtures/syntax/jsx/tags-with-children/expected.js @@ -1,2 +1,9 @@ -X({ prop: '2' }, Y(null)); -X({ prop: '2' }, [Y(null), Z(null)]); +"use strict"; + +X({ + prop: "2" +}, Y(null)); + +X({ + prop: "2" +}, [Y(null), Z(null)]); \ No newline at end of file diff --git a/test/fixtures/syntax/jsx/tags-with-literals/expected.js b/test/fixtures/syntax/jsx/tags-with-literals/expected.js index c75129daff..956943003e 100644 --- a/test/fixtures/syntax/jsx/tags-with-literals/expected.js +++ b/test/fixtures/syntax/jsx/tags-with-literals/expected.js @@ -1,4 +1,5 @@ -X(null, ' '); -X(null, '\n'); -X(null, '\n string\n'); -X(null, '\n string\n string\n '); +"use strict"; +X(null, " "); +X(null, "\n"); +X(null, "\n string\n"); +X(null, "\n string\n string\n "); \ No newline at end of file diff --git a/test/fixtures/syntax/let-scoping/deep-nested/exec.js b/test/fixtures/syntax/let-scoping/deep-nested/exec.js index 208aaf8c1e..1a4e31acd3 100644 --- a/test/fixtures/syntax/let-scoping/deep-nested/exec.js +++ b/test/fixtures/syntax/let-scoping/deep-nested/exec.js @@ -2,11 +2,11 @@ var a = 'var a'; { var b = 'var b'; { - var c = 'var c'; - let d = 'let d'; - assert.equal(d, 'let d'); + var c = 'var c'; + let d = 'let d'; + assert.equal(d, 'let d'); } assert.throws(function () { - d; + d; }, /d is not defined/); } diff --git a/test/fixtures/syntax/let-scoping/for-in-initializers/exec.js b/test/fixtures/syntax/let-scoping/for-in-initializers/exec.js index d81a939313..eb713cd261 100644 --- a/test/fixtures/syntax/let-scoping/for-in-initializers/exec.js +++ b/test/fixtures/syntax/let-scoping/for-in-initializers/exec.js @@ -3,11 +3,11 @@ var result; let let_result = []; let let_array = ['one', 'two', 'three']; for (var index in let_array) { - let let_index = index; - let let_value = let_array[let_index]; - let_result.push(function() { - return [let_index, let_value]; - }); + let let_index = index; + let let_value = let_array[let_index]; + let_result.push(function() { + return [let_index, let_value]; + }); } result = let_result; } diff --git a/test/fixtures/syntax/let-scoping/for-initializers/exec.js b/test/fixtures/syntax/let-scoping/for-initializers/exec.js index db46761f74..ec382cc595 100644 --- a/test/fixtures/syntax/let-scoping/for-initializers/exec.js +++ b/test/fixtures/syntax/let-scoping/for-initializers/exec.js @@ -3,10 +3,10 @@ var result; let let_x = 'let x'; let let_l = []; for (var var_x = 1, var_y = 2, var_z = 3; var_x < 10; var_x ++) { - let l_x = var_x, l_y = var_y, l_z = var_z; - let_l.push(function() { - return [l_x, l_y, l_z]; - }); + let l_x = var_x, l_y = var_y, l_z = var_z; + let_l.push(function() { + return [l_x, l_y, l_z]; + }); } result = let_l; } diff --git a/test/fixtures/syntax/let-scoping/in-class/exec.js b/test/fixtures/syntax/let-scoping/in-class/exec.js index 4b509ca2d6..d410cf0ccb 100644 --- a/test/fixtures/syntax/let-scoping/in-class/exec.js +++ b/test/fixtures/syntax/let-scoping/in-class/exec.js @@ -1,15 +1,15 @@ class LetInClass { get z() { - let let_z = 10; - return let_z; + let let_z = 10; + return let_z; } set z(v) { - let let_zv = v; + let let_zv = v; } distance() { - let dist = this.y - this.x; - return dist; + let dist = this.y - this.x; + return dist; } } diff --git a/test/fixtures/syntax/let-scoping/in-closure/exec.js b/test/fixtures/syntax/let-scoping/in-closure/exec.js index 0108ab506b..3394671528 100644 --- a/test/fixtures/syntax/let-scoping/in-closure/exec.js +++ b/test/fixtures/syntax/let-scoping/in-closure/exec.js @@ -1,13 +1,13 @@ function letInClosure(n) { var l = []; for (var i = 0; i < n; i ++) { - let let_i = i; - if (i % 3 == 0) { - continue; - } - l.push(function() { - return let_i; - }); + let let_i = i; + if (i % 3 == 0) { + continue; + } + l.push(function() { + return let_i; + }); } return l; } diff --git a/test/fixtures/syntax/let-scoping/in-for-break-inner/exec.js b/test/fixtures/syntax/let-scoping/in-for-break-inner/exec.js index dac158d86a..802fed4059 100644 --- a/test/fixtures/syntax/let-scoping/in-for-break-inner/exec.js +++ b/test/fixtures/syntax/let-scoping/in-for-break-inner/exec.js @@ -1,8 +1,8 @@ for (var x = 0; x < 10; x ++) { for (var y = 0; y < 10; y ++) { - let z = 'let z'; - if (x == 7) { - break; - } + let z = 'let z'; + if (x == 7) { + break; + } } } diff --git a/test/fixtures/syntax/let-scoping/in-for-break-named/exec.js b/test/fixtures/syntax/let-scoping/in-for-break-named/exec.js index 37c14692ba..973ea8e35f 100644 --- a/test/fixtures/syntax/let-scoping/in-for-break-named/exec.js +++ b/test/fixtures/syntax/let-scoping/in-for-break-named/exec.js @@ -1,9 +1,9 @@ outer: for (var x = 0; x < 10; x ++) { for (var y = 0; y < 10; y ++) { - let z = 'let z'; - if (x == 7) { - break outer; - } + let z = 'let z'; + if (x == 7) { + break outer; + } } } diff --git a/test/fixtures/syntax/let-scoping/in-for-break/exec.js b/test/fixtures/syntax/let-scoping/in-for-break/exec.js index 69c2680c24..1fbe54486d 100644 --- a/test/fixtures/syntax/let-scoping/in-for-break/exec.js +++ b/test/fixtures/syntax/let-scoping/in-for-break/exec.js @@ -1,6 +1,6 @@ for (var x = 0; x < 10; x ++) { let y = 'let y'; if (x % 2 == 0) { - break; + break; } } diff --git a/test/fixtures/syntax/let-scoping/in-for-continue-inner/exec.js b/test/fixtures/syntax/let-scoping/in-for-continue-inner/exec.js index 569b022665..539d540e3a 100644 --- a/test/fixtures/syntax/let-scoping/in-for-continue-inner/exec.js +++ b/test/fixtures/syntax/let-scoping/in-for-continue-inner/exec.js @@ -1,8 +1,8 @@ for (var x = 0; x < 10; x ++) { for (var y = 0; y < 10; y ++) { - let z = 'let z'; - if (x == 7) { - continue; - } + let z = 'let z'; + if (x == 7) { + continue; + } } } diff --git a/test/fixtures/syntax/let-scoping/in-for-continue-named/exec.js b/test/fixtures/syntax/let-scoping/in-for-continue-named/exec.js index e1a8d96964..85efb6541d 100644 --- a/test/fixtures/syntax/let-scoping/in-for-continue-named/exec.js +++ b/test/fixtures/syntax/let-scoping/in-for-continue-named/exec.js @@ -1,9 +1,9 @@ outer: for (var x = 0; x < 10; x ++) { for (var y = 0; y < 10; y ++) { - let z = 'let z'; - if (x == 7) { - continue outer; - } + let z = 'let z'; + if (x == 7) { + continue outer; + } } } diff --git a/test/fixtures/syntax/let-scoping/in-for-continue/exec.js b/test/fixtures/syntax/let-scoping/in-for-continue/exec.js index 8da940c38e..4458457d71 100644 --- a/test/fixtures/syntax/let-scoping/in-for-continue/exec.js +++ b/test/fixtures/syntax/let-scoping/in-for-continue/exec.js @@ -1,6 +1,6 @@ for (var x = 0; x < 10; x ++) { let y = 'let y'; if (x % 2 == 0) { - continue; + continue; } } diff --git a/test/fixtures/syntax/let-scoping/in-properties/exec.js b/test/fixtures/syntax/let-scoping/in-properties/exec.js index bc3cfefa66..610f53a989 100644 --- a/test/fixtures/syntax/let-scoping/in-properties/exec.js +++ b/test/fixtures/syntax/let-scoping/in-properties/exec.js @@ -1,15 +1,15 @@ var object = { get x() { - while (true) { - let let_x = 'let x'; - return let_x; - } + while (true) { + let let_x = 'let x'; + return let_x; + } }, set x(v) { - do { - let let_v = v; - this.v = let_v; - } while (false); + do { + let let_v = v; + this.v = let_v; + } while (false); } } diff --git a/test/fixtures/syntax/let-scoping/initializer-for-3/exec.js b/test/fixtures/syntax/let-scoping/initializer-for-3/exec.js index 4d709fa3fe..73f4794698 100644 --- a/test/fixtures/syntax/let-scoping/initializer-for-3/exec.js +++ b/test/fixtures/syntax/let-scoping/initializer-for-3/exec.js @@ -1,5 +1,5 @@ for (let x = 1, y = x + 1; x < 10 && y != 0; x ++, y *= 2) { if (y > 300) { - continue; + continue; } } diff --git a/test/fixtures/syntax/let-scoping/nested-conflict/exec.js b/test/fixtures/syntax/let-scoping/nested-conflict/exec.js index 808a556509..6bb300a67f 100644 --- a/test/fixtures/syntax/let-scoping/nested-conflict/exec.js +++ b/test/fixtures/syntax/let-scoping/nested-conflict/exec.js @@ -1,12 +1,12 @@ (function() { var x = 1; function f() { - assert.equal(x, 1); - { - let x = 2; - assert.equal(x, 2); - } - assert.equal(x, 1); + assert.equal(x, 1); + { + let x = 2; + assert.equal(x, 2); + } + assert.equal(x, 1); } f(); })(); diff --git a/test/fixtures/syntax/let-scoping/nested-function-1/exec.js b/test/fixtures/syntax/let-scoping/nested-function-1/exec.js index 0910f17774..c6080cffbe 100644 --- a/test/fixtures/syntax/let-scoping/nested-function-1/exec.js +++ b/test/fixtures/syntax/let-scoping/nested-function-1/exec.js @@ -1,5 +1,5 @@ function nestedFunction1() { return function() { - let let_x = 'let x'; + let let_x = 'let x'; } } diff --git a/test/fixtures/syntax/let-scoping/nested-function-2/exec.js b/test/fixtures/syntax/let-scoping/nested-function-2/exec.js index aadbf8e873..0888e44034 100644 --- a/test/fixtures/syntax/let-scoping/nested-function-2/exec.js +++ b/test/fixtures/syntax/let-scoping/nested-function-2/exec.js @@ -1,6 +1,6 @@ function nestedFunction2() { let let_func = function() { - let let_x = 'let x'; + let let_x = 'let x'; } return let_func; } diff --git a/test/fixtures/syntax/let-scoping/no-nested-function-declarations/actual.js b/test/fixtures/syntax/let-scoping/no-nested-function-declarations/actual.js index dc5a13878d..880c5290be 100644 --- a/test/fixtures/syntax/let-scoping/no-nested-function-declarations/actual.js +++ b/test/fixtures/syntax/let-scoping/no-nested-function-declarations/actual.js @@ -2,6 +2,6 @@ var numbers = [1, 2, 3]; for (let i in numbers) { function foo() { - return i; + return i; } } diff --git a/test/fixtures/syntax/let-scoping/regress-1381/exec.js b/test/fixtures/syntax/let-scoping/regress-1381/exec.js index b6f3d193a0..26c224809a 100644 --- a/test/fixtures/syntax/let-scoping/regress-1381/exec.js +++ b/test/fixtures/syntax/let-scoping/regress-1381/exec.js @@ -1,8 +1,8 @@ function test() { let ret = true; while (false) - for (let i = 0; i < 1; i++) - ret = () => i; + for (let i = 0; i < 1; i++) + ret = () => i; return ret } assert.ok(test()); diff --git a/test/fixtures/syntax/let-scoping/with-for-in/exec.js b/test/fixtures/syntax/let-scoping/with-for-in/exec.js index e17059b7b2..7f6fbf1740 100644 --- a/test/fixtures/syntax/let-scoping/with-for-in/exec.js +++ b/test/fixtures/syntax/let-scoping/with-for-in/exec.js @@ -1,6 +1,6 @@ for (var x in [1,2,3]) { let let_y = x; for (var for_in_z in [4,5,6]) { - continue; + continue; } } diff --git a/test/fixtures/syntax/let-scoping/with-for/exec.js b/test/fixtures/syntax/let-scoping/with-for/exec.js index c6c178f941..07912563f8 100644 --- a/test/fixtures/syntax/let-scoping/with-for/exec.js +++ b/test/fixtures/syntax/let-scoping/with-for/exec.js @@ -1,6 +1,6 @@ for (var x = 0; x < 10; x++) { let let_y = 'let y'; for (var for_z = 0; for_z < 2; for_z ++) { - break; + break; } } diff --git a/test/fixtures/syntax/let-scoping/with-switch/exec.js b/test/fixtures/syntax/let-scoping/with-switch/exec.js index 1df909156d..5100a8032e 100644 --- a/test/fixtures/syntax/let-scoping/with-switch/exec.js +++ b/test/fixtures/syntax/let-scoping/with-switch/exec.js @@ -2,11 +2,11 @@ for (var i = 0; i < 5; i ++) { let let_x = 'let x'; switch (i) { - case 0: - break; - case 2: - break; - default: - break; + case 0: + break; + case 2: + break; + default: + break; } } diff --git a/test/fixtures/syntax/modules/exports-default/expected.js b/test/fixtures/syntax/modules/exports-default/expected.js index 57e6325b0d..3af8e0aa7d 100644 --- a/test/fixtures/syntax/modules/exports-default/expected.js +++ b/test/fixtures/syntax/modules/exports-default/expected.js @@ -1,20 +1,18 @@ +"use strict"; exports.default = 42; exports.default = {}; - exports.default = []; - exports.default = foo; +exports.default = function() {}; -exports.default = function () {} - -exports.default = function () { +exports.default = function() { var _class = function() {}; return _class; }(); -exports.default = function foo () {} +exports.default = function foo() {}; -exports.default = function () { +exports.default = function() { var foo = function foo() {}; return foo; -}(); +}(); \ No newline at end of file diff --git a/test/fixtures/syntax/modules/exports-from/expected.js b/test/fixtures/syntax/modules/exports-from/expected.js index 987dbc3c62..8c94346f01 100644 --- a/test/fixtures/syntax/modules/exports-from/expected.js +++ b/test/fixtures/syntax/modules/exports-from/expected.js @@ -1,22 +1,17 @@ -(function (obj) { +"use strict"; + +(function(obj) { for (var i in obj) { exports[i] = obj[i]; } -}(require("foo"))); +})(require("foo")); exports.foo = require("foo").foo; - exports.foo = require("foo").foo; exports.bar = require("foo").bar; - exports.bar = require("foo").foo; - exports.default = require("foo").foo; - exports.default = require("foo").foo; exports.bar = require("foo").bar; - exports.default = require("foo").default; - -exports.foo = require("foo").default; - +exports.foo = require("foo").default; \ No newline at end of file diff --git a/test/fixtures/syntax/modules/exports-named/expected.js b/test/fixtures/syntax/modules/exports-named/expected.js index 450777f614..045d242f69 100644 --- a/test/fixtures/syntax/modules/exports-named/expected.js +++ b/test/fixtures/syntax/modules/exports-named/expected.js @@ -1,11 +1,8 @@ +"use strict"; exports.foo = foo; - exports.foo = foo; exports.bar = bar; - exports.bar = foo; - exports.default = foo; - exports.default = foo; -exports.bar = bar; +exports.bar = bar; \ No newline at end of file diff --git a/test/fixtures/syntax/modules/exports-variable/expected.js b/test/fixtures/syntax/modules/exports-variable/expected.js index 8613280809..6c696495cd 100644 --- a/test/fixtures/syntax/modules/exports-variable/expected.js +++ b/test/fixtures/syntax/modules/exports-variable/expected.js @@ -1,27 +1,22 @@ +"use strict"; exports.foo7 = foo7; - var foo = 1; exports.foo = foo; - -var foo2 = function () {}; +var foo2 = function() {}; exports.foo2 = foo2; - var foo3; exports.foo3 = foo3; - var _foo4 = 2; exports.foo4 = _foo4; - var _foo5; exports.foo5 = _foo5; - var _foo6 = 3; exports.foo6 = _foo6; +function foo7() {} -function foo7 () {} - -var foo8 = function () { +var foo8 = function() { var foo8 = function foo8() {}; return foo8; }(); -exports.foo8 = foo8; + +exports.foo8 = foo8; \ No newline at end of file diff --git a/test/fixtures/syntax/modules/hoist-function-exports/actual.js b/test/fixtures/syntax/modules/hoist-function-exports/actual.js index 5e5c8fc494..aa0f9366ae 100644 --- a/test/fixtures/syntax/modules/hoist-function-exports/actual.js +++ b/test/fixtures/syntax/modules/hoist-function-exports/actual.js @@ -6,6 +6,6 @@ export function nextOdd(n) { export var isOdd = (function(isEven) { return function(n) { - return !isEven(n); + return !isEven(n); }; })(isEven); diff --git a/test/fixtures/syntax/modules/hoist-function-exports/expected.js b/test/fixtures/syntax/modules/hoist-function-exports/expected.js index 25b941b8ef..4eeae9f660 100644 --- a/test/fixtures/syntax/modules/hoist-function-exports/expected.js +++ b/test/fixtures/syntax/modules/hoist-function-exports/expected.js @@ -1,13 +1,15 @@ +"use strict"; exports.nextOdd = nextOdd; - var isEven = require("./evens").isEven; + function nextOdd(n) { - return isEven(n) ? n + 1 : n + 2; + return (isEven(n) ? n + 1 : n + 2); } -var isOdd = (function(isEven) { +var isOdd = function(isEven) { return function(n) { return !isEven(n); }; -})(isEven); -exports.isOdd = isOdd; +}(isEven); + +exports.isOdd = isOdd; \ No newline at end of file diff --git a/test/fixtures/syntax/modules/imports-default/expected.js b/test/fixtures/syntax/modules/imports-default/expected.js index bf0f3df3c3..8543db200a 100644 --- a/test/fixtures/syntax/modules/imports-default/expected.js +++ b/test/fixtures/syntax/modules/imports-default/expected.js @@ -1,2 +1,3 @@ +"use strict"; var foo = require("foo").default; -var foo = require("foo").default; +var foo = require("foo").default; \ No newline at end of file diff --git a/test/fixtures/syntax/modules/imports-glob/expected.js b/test/fixtures/syntax/modules/imports-glob/expected.js index 99bf8b9add..eaa887c8f8 100644 --- a/test/fixtures/syntax/modules/imports-glob/expected.js +++ b/test/fixtures/syntax/modules/imports-glob/expected.js @@ -1 +1,2 @@ -var foo = require("foo"); +"use strict"; +var foo = require("foo"); \ No newline at end of file diff --git a/test/fixtures/syntax/modules/imports-mixing/expected.js b/test/fixtures/syntax/modules/imports-mixing/expected.js index ebdcdfd0d3..d010808552 100644 --- a/test/fixtures/syntax/modules/imports-mixing/expected.js +++ b/test/fixtures/syntax/modules/imports-mixing/expected.js @@ -1,5 +1,5 @@ +"use strict"; var foo = require("foo").default; var xyz = require("foo").baz; - var foo = require("foo").default; -var bar = require("foo"); +var bar = require("foo"); \ No newline at end of file diff --git a/test/fixtures/syntax/modules/imports-named/expected.js b/test/fixtures/syntax/modules/imports-named/expected.js index a37d586d0f..722dfd73aa 100644 --- a/test/fixtures/syntax/modules/imports-named/expected.js +++ b/test/fixtures/syntax/modules/imports-named/expected.js @@ -1,9 +1,7 @@ +"use strict"; var bar = require("foo").bar; - var bar = require("foo").bar; var baz = require("foo").baz; - var baz = require("foo").bar; - var baz = require("foo").bar; -var xyz = require("foo").xyz; +var xyz = require("foo").xyz; \ No newline at end of file diff --git a/test/fixtures/syntax/modules/imports/expected.js b/test/fixtures/syntax/modules/imports/expected.js index 7c26058f1f..a1d960e91f 100644 --- a/test/fixtures/syntax/modules/imports/expected.js +++ b/test/fixtures/syntax/modules/imports/expected.js @@ -1,3 +1,4 @@ +"use strict"; require("foo"); require("foo-bar"); -require("./directory/foo-bar"); +require("./directory/foo-bar"); \ No newline at end of file diff --git a/test/fixtures/syntax/modules/overview/expected.js b/test/fixtures/syntax/modules/overview/expected.js index 371e2c45e9..1aeb6bfa36 100644 --- a/test/fixtures/syntax/modules/overview/expected.js +++ b/test/fixtures/syntax/modules/overview/expected.js @@ -1,20 +1,12 @@ +"use strict"; require("foo"); - require("foo-bar"); - require("./directory/foo-bar"); - var foo = require("foo").default; - var foo = require("foo"); - var bar = require("foo").bar; - var bar = require("foo").foo; - exports.test = test; - var test = 5; exports.test = test; - -exports.default = test; +exports.default = test; \ No newline at end of file diff --git a/test/fixtures/syntax/property-methods-assignment/getter-and-setter/actual.js b/test/fixtures/syntax/property-methods-assignment/getter-and-setter/actual.js index 5760e76545..11ed1f3e1d 100644 --- a/test/fixtures/syntax/property-methods-assignment/getter-and-setter/actual.js +++ b/test/fixtures/syntax/property-methods-assignment/getter-and-setter/actual.js @@ -1,8 +1,8 @@ var obj = { get foo() { - return 5 + 5; + return 5 + 5; }, set foo(value) { - this._foo = value; + this._foo = value; } }; diff --git a/test/fixtures/syntax/property-methods-assignment/getter-and-setter/expected.js b/test/fixtures/syntax/property-methods-assignment/getter-and-setter/expected.js index 546b22ba33..c357ad0496 100644 --- a/test/fixtures/syntax/property-methods-assignment/getter-and-setter/expected.js +++ b/test/fixtures/syntax/property-methods-assignment/getter-and-setter/expected.js @@ -1,13 +1,17 @@ -var obj = function (_obj) { +"use strict"; + +var obj = function(_obj) { Object.defineProperties(_obj, { foo: { - get: function () { + get: function() { return 5 + 5; }, - set: function (value) { + + set: function(value) { this._foo = value; } } }); + return _obj; -}({}); +}({}); \ No newline at end of file diff --git a/test/fixtures/syntax/property-methods-assignment/getter/actual.js b/test/fixtures/syntax/property-methods-assignment/getter/actual.js index 500b46807f..fc9cb0d2f7 100644 --- a/test/fixtures/syntax/property-methods-assignment/getter/actual.js +++ b/test/fixtures/syntax/property-methods-assignment/getter/actual.js @@ -1,5 +1,5 @@ var obj = { get foo() { - return 5 + 5; + return 5 + 5; } }; diff --git a/test/fixtures/syntax/property-methods-assignment/getter/expected.js b/test/fixtures/syntax/property-methods-assignment/getter/expected.js index 3b3cea8385..9a00ceb9ec 100644 --- a/test/fixtures/syntax/property-methods-assignment/getter/expected.js +++ b/test/fixtures/syntax/property-methods-assignment/getter/expected.js @@ -1,10 +1,13 @@ -var obj = function (_obj) { +"use strict"; + +var obj = function(_obj) { Object.defineProperties(_obj, { foo: { - get: function () { + get: function() { return 5 + 5; } } }); + return _obj; -}({}); +}({}); \ No newline at end of file diff --git a/test/fixtures/syntax/property-methods-assignment/method/actual.js b/test/fixtures/syntax/property-methods-assignment/method/actual.js index 9114ccf44c..cbc9cb2f75 100644 --- a/test/fixtures/syntax/property-methods-assignment/method/actual.js +++ b/test/fixtures/syntax/property-methods-assignment/method/actual.js @@ -1,5 +1,5 @@ var obj = { method() { - return 5 + 5; + return 5 + 5; } }; diff --git a/test/fixtures/syntax/property-methods-assignment/method/expected.js b/test/fixtures/syntax/property-methods-assignment/method/expected.js index 874b21c6b9..a78e3e92d8 100644 --- a/test/fixtures/syntax/property-methods-assignment/method/expected.js +++ b/test/fixtures/syntax/property-methods-assignment/method/expected.js @@ -1,5 +1,7 @@ +"use strict"; + var obj = { - method: function () { + method: function() { return 5 + 5; } -}; +}; \ No newline at end of file diff --git a/test/fixtures/syntax/property-methods-assignment/setter/actual.js b/test/fixtures/syntax/property-methods-assignment/setter/actual.js index b0b9f98a0e..c34fe35e35 100644 --- a/test/fixtures/syntax/property-methods-assignment/setter/actual.js +++ b/test/fixtures/syntax/property-methods-assignment/setter/actual.js @@ -1,5 +1,5 @@ var obj = { set foo(value) { - this._foo = value; + this._foo = value; } }; diff --git a/test/fixtures/syntax/property-methods-assignment/setter/expected.js b/test/fixtures/syntax/property-methods-assignment/setter/expected.js index 8ff48f2b58..843982efa2 100644 --- a/test/fixtures/syntax/property-methods-assignment/setter/expected.js +++ b/test/fixtures/syntax/property-methods-assignment/setter/expected.js @@ -1,10 +1,13 @@ -var obj = function (_obj) { +"use strict"; + +var obj = function(_obj) { Object.defineProperties(_obj, { foo: { - set: function (value) { + set: function(value) { this._foo = value; } } }); + return _obj; -}({}); +}({}); \ No newline at end of file diff --git a/test/fixtures/syntax/property-name-shorthand/mixed/expected.js b/test/fixtures/syntax/property-name-shorthand/mixed/expected.js index 88427e8bfd..1ef5efb0ad 100644 --- a/test/fixtures/syntax/property-name-shorthand/mixed/expected.js +++ b/test/fixtures/syntax/property-name-shorthand/mixed/expected.js @@ -1,5 +1,7 @@ +"use strict"; + var coords = { x: x, y: y, foo: "bar" -}; +}; \ No newline at end of file diff --git a/test/fixtures/syntax/property-name-shorthand/multiple/expected.js b/test/fixtures/syntax/property-name-shorthand/multiple/expected.js index e07257b750..817c34aecd 100644 --- a/test/fixtures/syntax/property-name-shorthand/multiple/expected.js +++ b/test/fixtures/syntax/property-name-shorthand/multiple/expected.js @@ -1,4 +1,6 @@ +"use strict"; + var coords = { x: x, y: y -}; +}; \ No newline at end of file diff --git a/test/fixtures/syntax/property-name-shorthand/single/expected.js b/test/fixtures/syntax/property-name-shorthand/single/expected.js index 9b14ab0e30..c8d904ff0e 100644 --- a/test/fixtures/syntax/property-name-shorthand/single/expected.js +++ b/test/fixtures/syntax/property-name-shorthand/single/expected.js @@ -1,3 +1,5 @@ +"use strict"; + var coords = { x: x -}; +}; \ No newline at end of file diff --git a/test/fixtures/syntax/react/display-name-assignment-expression/actual.js b/test/fixtures/syntax/react/display-name-assignment-expression/actual.js index c58b749322..f3affde052 100644 --- a/test/fixtures/syntax/react/display-name-assignment-expression/actual.js +++ b/test/fixtures/syntax/react/display-name-assignment-expression/actual.js @@ -1,6 +1,6 @@ var Component; Component = React.createClass({ render: function() { - return null; + return null; } }); diff --git a/test/fixtures/syntax/react/display-name-assignment-expression/expected.js b/test/fixtures/syntax/react/display-name-assignment-expression/expected.js index 1e6abef43d..0096748e3d 100644 --- a/test/fixtures/syntax/react/display-name-assignment-expression/expected.js +++ b/test/fixtures/syntax/react/display-name-assignment-expression/expected.js @@ -1,7 +1,10 @@ +"use strict"; var Component; + Component = React.createClass({ displayName: "Component", + render: function() { return null; } -}); +}); \ No newline at end of file diff --git a/test/fixtures/syntax/react/display-name-if-missing/actual.js b/test/fixtures/syntax/react/display-name-if-missing/actual.js index a9e92052e0..4232881d66 100644 --- a/test/fixtures/syntax/react/display-name-if-missing/actual.js +++ b/test/fixtures/syntax/react/display-name-if-missing/actual.js @@ -1,6 +1,6 @@ var Whateva = React.createClass({ displayName: "Whatever", render: function() { - return null; + return null; } }); diff --git a/test/fixtures/syntax/react/display-name-if-missing/expected.js b/test/fixtures/syntax/react/display-name-if-missing/expected.js index a9e92052e0..e802413800 100644 --- a/test/fixtures/syntax/react/display-name-if-missing/expected.js +++ b/test/fixtures/syntax/react/display-name-if-missing/expected.js @@ -1,6 +1,9 @@ +"use strict"; + var Whateva = React.createClass({ displayName: "Whatever", + render: function() { return null; } -}); +}); \ No newline at end of file diff --git a/test/fixtures/syntax/react/display-name-object-declaration/actual.js b/test/fixtures/syntax/react/display-name-object-declaration/actual.js index ab60bcdb44..51a000a533 100644 --- a/test/fixtures/syntax/react/display-name-object-declaration/actual.js +++ b/test/fixtures/syntax/react/display-name-object-declaration/actual.js @@ -1,7 +1,7 @@ exports = { Component: React.createClass({ - render: function() { - return null; - } + render: function() { + return null; + } }) }; diff --git a/test/fixtures/syntax/react/display-name-object-declaration/expected.js b/test/fixtures/syntax/react/display-name-object-declaration/expected.js index d5510ba674..cde3afa785 100644 --- a/test/fixtures/syntax/react/display-name-object-declaration/expected.js +++ b/test/fixtures/syntax/react/display-name-object-declaration/expected.js @@ -1,8 +1,11 @@ +"use strict"; + exports = { Component: React.createClass({ displayName: "Component", + render: function() { return null; } }) -}; +}; \ No newline at end of file diff --git a/test/fixtures/syntax/react/display-name-property-assignment/actual.js b/test/fixtures/syntax/react/display-name-property-assignment/actual.js index a5b575416b..f856d33f07 100644 --- a/test/fixtures/syntax/react/display-name-property-assignment/actual.js +++ b/test/fixtures/syntax/react/display-name-property-assignment/actual.js @@ -1,5 +1,5 @@ exports.Component = React.createClass({ render: function() { - return null; + return null; } }); diff --git a/test/fixtures/syntax/react/display-name-property-assignment/expected.js b/test/fixtures/syntax/react/display-name-property-assignment/expected.js index 38c91c0540..ca445b30a1 100644 --- a/test/fixtures/syntax/react/display-name-property-assignment/expected.js +++ b/test/fixtures/syntax/react/display-name-property-assignment/expected.js @@ -1,6 +1,9 @@ +"use strict"; + exports.Component = React.createClass({ displayName: "Component", + render: function() { return null; } -}); +}); \ No newline at end of file diff --git a/test/fixtures/syntax/react/display-name-variable-declaration/actual.js b/test/fixtures/syntax/react/display-name-variable-declaration/actual.js index d9354e21fc..e751186def 100644 --- a/test/fixtures/syntax/react/display-name-variable-declaration/actual.js +++ b/test/fixtures/syntax/react/display-name-variable-declaration/actual.js @@ -1,5 +1,5 @@ var Component = React.createClass({ render: function() { - return null; + return null; } }); diff --git a/test/fixtures/syntax/react/display-name-variable-declaration/expected.js b/test/fixtures/syntax/react/display-name-variable-declaration/expected.js index b73a672c3b..60d186b8dd 100644 --- a/test/fixtures/syntax/react/display-name-variable-declaration/expected.js +++ b/test/fixtures/syntax/react/display-name-variable-declaration/expected.js @@ -1,6 +1,9 @@ +"use strict"; + var Component = React.createClass({ displayName: "Component", + render: function() { return null; } -}); +}); \ No newline at end of file diff --git a/test/fixtures/syntax/rest-parameters/multiple/expected.js b/test/fixtures/syntax/rest-parameters/multiple/expected.js index ee9222ed51..b9f8d1687b 100644 --- a/test/fixtures/syntax/rest-parameters/multiple/expected.js +++ b/test/fixtures/syntax/rest-parameters/multiple/expected.js @@ -1,9 +1,10 @@ +"use strict"; var _slice = Array.prototype.slice; -var t = function (f) { +var t = function(f) { var items = _slice.call(arguments, 1); }; function t(f) { var items = _slice.call(arguments, 1); -} +} \ No newline at end of file diff --git a/test/fixtures/syntax/rest-parameters/single/expected.js b/test/fixtures/syntax/rest-parameters/single/expected.js index 18d648f026..d45c7f4c40 100644 --- a/test/fixtures/syntax/rest-parameters/single/expected.js +++ b/test/fixtures/syntax/rest-parameters/single/expected.js @@ -1,9 +1,10 @@ +"use strict"; var _slice = Array.prototype.slice; -var t = function () { +var t = function() { var items = _slice.call(arguments); }; function t() { var items = _slice.call(arguments); -} +} \ No newline at end of file diff --git a/test/fixtures/syntax/source-maps/arrow-function/expected.js b/test/fixtures/syntax/source-maps/arrow-function/expected.js index 3ce826a33f..57c86edadf 100644 --- a/test/fixtures/syntax/source-maps/arrow-function/expected.js +++ b/test/fixtures/syntax/source-maps/arrow-function/expected.js @@ -1,3 +1,5 @@ +"use strict"; + var t = function(x) { return x * x; -}; +}; \ No newline at end of file diff --git a/test/fixtures/syntax/source-maps/arrow-function/source-mappings.json b/test/fixtures/syntax/source-maps/arrow-function/source-mappings.json index 88886e7423..d6c4b7d064 100644 --- a/test/fixtures/syntax/source-maps/arrow-function/source-mappings.json +++ b/test/fixtures/syntax/source-maps/arrow-function/source-mappings.json @@ -1,10 +1,10 @@ [{ "original": { "line": 1, - "column": 15 + "column": 18 }, "generated": { - "line": 2, - "column": 11 + "line": 4, + "column": 14 } }] diff --git a/test/fixtures/syntax/source-maps/class/expected.js b/test/fixtures/syntax/source-maps/class/expected.js index 7c7aeb0a7d..f4598117c3 100644 --- a/test/fixtures/syntax/source-maps/class/expected.js +++ b/test/fixtures/syntax/source-maps/class/expected.js @@ -1,3 +1,5 @@ +"use strict"; + var Test = function() { var Test = function Test() {}; @@ -12,5 +14,5 @@ var Test = function() { return Test; }(); -var test = new Test; -test.bar; +var test = new Test(); +test.bar; \ No newline at end of file diff --git a/test/fixtures/syntax/source-maps/class/source-mappings.json b/test/fixtures/syntax/source-maps/class/source-mappings.json index b3f7bdab14..259fd68b40 100644 --- a/test/fixtures/syntax/source-maps/class/source-mappings.json +++ b/test/fixtures/syntax/source-maps/class/source-mappings.json @@ -4,7 +4,7 @@ "column": 11 }, "generated": { - "line": 7, + "line": 9, "column": 15 } }] diff --git a/test/fixtures/syntax/source-maps/full/expected.js b/test/fixtures/syntax/source-maps/full/expected.js index e2bcfeb4cd..9691f5dcbf 100644 --- a/test/fixtures/syntax/source-maps/full/expected.js +++ b/test/fixtures/syntax/source-maps/full/expected.js @@ -1,3 +1,5 @@ -arr.map(function (x) { +"use strict"; + +arr.map(function(x) { return x * x; -}); +}); \ No newline at end of file diff --git a/test/fixtures/syntax/source-maps/full/source-map.json b/test/fixtures/syntax/source-maps/full/source-map.json index 1f78bd85cf..4e2e2c42ee 100644 --- a/test/fixtures/syntax/source-maps/full/source-map.json +++ b/test/fixtures/syntax/source-maps/full/source-map.json @@ -3,6 +3,6 @@ "file": "source-maps/full/expected.js", "sources": ["source-maps/full/actual.js"], "names": [], - "mappings": "AAAA,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAC;SAAK,EAAE,EAAE;CAAC,CAAC", + "mappings": ";AAAA,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAC;SAAK,EAAE,EAAE;CAAC,CAAC", "sourcesContent": ["arr.map(x => x * x);"] } diff --git a/test/fixtures/syntax/source-maps/inline/expected.js b/test/fixtures/syntax/source-maps/inline/expected.js index e2bcfeb4cd..9691f5dcbf 100644 --- a/test/fixtures/syntax/source-maps/inline/expected.js +++ b/test/fixtures/syntax/source-maps/inline/expected.js @@ -1,3 +1,5 @@ -arr.map(function (x) { +"use strict"; + +arr.map(function(x) { return x * x; -}); +}); \ No newline at end of file diff --git a/test/fixtures/syntax/spread/arguments/expected.js b/test/fixtures/syntax/spread/arguments/expected.js index 5817411dfd..18080d5978 100644 --- a/test/fixtures/syntax/spread/arguments/expected.js +++ b/test/fixtures/syntax/spread/arguments/expected.js @@ -1,13 +1,12 @@ +"use strict"; var _slice = Array.prototype.slice; function foo() { return bar.apply(null, ["test"].concat(_slice.call(arguments))); } + function bar(one, two, three) { - return [ - one, - two, - three - ]; + return [one, two, three]; } -foo("foo", "bar"); + +foo("foo", "bar"); \ No newline at end of file diff --git a/test/fixtures/syntax/spread/array-literals/expected.js b/test/fixtures/syntax/spread/array-literals/expected.js index 4e5e3f7361..4cc07d91a9 100644 --- a/test/fixtures/syntax/spread/array-literals/expected.js +++ b/test/fixtures/syntax/spread/array-literals/expected.js @@ -1,7 +1,3 @@ +"use strict"; var _slice = Array.prototype.slice; - -var lyrics = [ - "head", - "and", - "toes" -].concat(_slice.call(parts)); +var lyrics = ["head", "and", "toes"].concat(_slice.call(parts)); \ No newline at end of file diff --git a/test/fixtures/syntax/spread/contexted-method-call-multiple-args/expected.js b/test/fixtures/syntax/spread/contexted-method-call-multiple-args/expected.js index e66285a582..860638d174 100644 --- a/test/fixtures/syntax/spread/contexted-method-call-multiple-args/expected.js +++ b/test/fixtures/syntax/spread/contexted-method-call-multiple-args/expected.js @@ -1,9 +1,4 @@ +"use strict"; var _slice = Array.prototype.slice; -foob.add.apply(foob, [ - foo, - bar -].concat(_slice.call(numbers))); -foob.test.add.apply(foob.test, [ - foo, - bar -].concat(_slice.call(numbers))); +foob.add.apply(foob, [foo, bar].concat(_slice.call(numbers))); +foob.test.add.apply(foob.test, [foo, bar].concat(_slice.call(numbers))); \ No newline at end of file diff --git a/test/fixtures/syntax/spread/contexted-method-call-single-arg/expected.js b/test/fixtures/syntax/spread/contexted-method-call-single-arg/expected.js index e69aea13b9..d2a488b1fe 100644 --- a/test/fixtures/syntax/spread/contexted-method-call-single-arg/expected.js +++ b/test/fixtures/syntax/spread/contexted-method-call-single-arg/expected.js @@ -1,3 +1,4 @@ +"use strict"; var _slice = Array.prototype.slice; foob.add.apply(foob, _slice.call(numbers)); -foob.test.add.apply(foob.test, _slice.call(numbers)); +foob.test.add.apply(foob.test, _slice.call(numbers)); \ No newline at end of file diff --git a/test/fixtures/syntax/spread/method-call-array-literal/expected.js b/test/fixtures/syntax/spread/method-call-array-literal/expected.js index 987a197900..8824a0d8eb 100644 --- a/test/fixtures/syntax/spread/method-call-array-literal/expected.js +++ b/test/fixtures/syntax/spread/method-call-array-literal/expected.js @@ -1 +1,2 @@ -f.apply(null, [1, 2, 3]); +"use strict"; +f.apply(null, [1, 2, 3]); \ No newline at end of file diff --git a/test/fixtures/syntax/spread/method-call-multiple-args/expected.js b/test/fixtures/syntax/spread/method-call-multiple-args/expected.js index 602d35ed4f..5ae73e4362 100644 --- a/test/fixtures/syntax/spread/method-call-multiple-args/expected.js +++ b/test/fixtures/syntax/spread/method-call-multiple-args/expected.js @@ -1,5 +1,3 @@ +"use strict"; var _slice = Array.prototype.slice; -add.apply(null, [ - foo, - bar -].concat(_slice.call(numbers))); +add.apply(null, [foo, bar].concat(_slice.call(numbers))); \ No newline at end of file diff --git a/test/fixtures/syntax/spread/method-call-single-arg/expected.js b/test/fixtures/syntax/spread/method-call-single-arg/expected.js index 6df8cfc0c0..391b08d8c7 100644 --- a/test/fixtures/syntax/spread/method-call-single-arg/expected.js +++ b/test/fixtures/syntax/spread/method-call-single-arg/expected.js @@ -1,2 +1,3 @@ +"use strict"; var _slice = Array.prototype.slice; -add.apply(null, _slice.call(numbers)); +add.apply(null, _slice.call(numbers)); \ No newline at end of file diff --git a/test/fixtures/syntax/template-literals/escape-quotes/expected.js b/test/fixtures/syntax/template-literals/escape-quotes/expected.js index 67956e60ff..7d90c09a11 100644 --- a/test/fixtures/syntax/template-literals/escape-quotes/expected.js +++ b/test/fixtures/syntax/template-literals/escape-quotes/expected.js @@ -1 +1,2 @@ -var t = "'" + foo + "' \"" + bar + "\""; +"use strict"; +var t = "'" + foo + "' \"" + bar + "\""; \ No newline at end of file diff --git a/test/fixtures/syntax/template-literals/functions/expected.js b/test/fixtures/syntax/template-literals/functions/expected.js index 027f457d3c..acb11d17f2 100644 --- a/test/fixtures/syntax/template-literals/functions/expected.js +++ b/test/fixtures/syntax/template-literals/functions/expected.js @@ -1 +1,2 @@ -var foo = "test " + _.test(foo) + " " + bar; +"use strict"; +var foo = "test " + _.test(foo) + " " + bar; \ No newline at end of file diff --git a/test/fixtures/syntax/template-literals/multiline/expected.js b/test/fixtures/syntax/template-literals/multiline/expected.js index f679f38c70..d90ae15a5a 100644 --- a/test/fixtures/syntax/template-literals/multiline/expected.js +++ b/test/fixtures/syntax/template-literals/multiline/expected.js @@ -1 +1,2 @@ -var o = "wow\nthis is\nactually multiline!"; +"use strict"; +var o = "wow\nthis is\nactually multiline!"; \ No newline at end of file diff --git a/test/fixtures/syntax/template-literals/multiple/expected.js b/test/fixtures/syntax/template-literals/multiple/expected.js index cf7167ad71..1f39dda64e 100644 --- a/test/fixtures/syntax/template-literals/multiple/expected.js +++ b/test/fixtures/syntax/template-literals/multiple/expected.js @@ -1 +1,2 @@ -var foo = "test " + foo + " " + bar; +"use strict"; +var foo = "test " + foo + " " + bar; \ No newline at end of file diff --git a/test/fixtures/syntax/template-literals/none/expected.js b/test/fixtures/syntax/template-literals/none/expected.js index 7768209432..312ad1893b 100644 --- a/test/fixtures/syntax/template-literals/none/expected.js +++ b/test/fixtures/syntax/template-literals/none/expected.js @@ -1 +1,2 @@ -var foo = "test"; +"use strict"; +var foo = "test"; \ No newline at end of file diff --git a/test/fixtures/syntax/template-literals/only/expected.js b/test/fixtures/syntax/template-literals/only/expected.js index e7d47c4755..8a26c6537b 100644 --- a/test/fixtures/syntax/template-literals/only/expected.js +++ b/test/fixtures/syntax/template-literals/only/expected.js @@ -1 +1,2 @@ -var foo = "" + test; +"use strict"; +var foo = "" + test; \ No newline at end of file diff --git a/test/fixtures/syntax/template-literals/single/expected.js b/test/fixtures/syntax/template-literals/single/expected.js index dae1e8ea59..d177f7c6a7 100644 --- a/test/fixtures/syntax/template-literals/single/expected.js +++ b/test/fixtures/syntax/template-literals/single/expected.js @@ -1 +1,2 @@ -var foo = "test " + foo; +"use strict"; +var foo = "test " + foo; \ No newline at end of file diff --git a/test/fixtures/syntax/template-literals/statement/expected.js b/test/fixtures/syntax/template-literals/statement/expected.js index 4d5209dbd6..6714f83af2 100644 --- a/test/fixtures/syntax/template-literals/statement/expected.js +++ b/test/fixtures/syntax/template-literals/statement/expected.js @@ -1 +1,2 @@ -var foo = "test " + (foo + bar); +"use strict"; +var foo = "test " + (foo + bar); \ No newline at end of file diff --git a/test/fixtures/syntax/template-literals/tag/expected.js b/test/fixtures/syntax/template-literals/tag/expected.js index bc8d9342bd..a33273a08c 100644 --- a/test/fixtures/syntax/template-literals/tag/expected.js +++ b/test/fixtures/syntax/template-literals/tag/expected.js @@ -1 +1,2 @@ -var foo = bar(["a", "b ", ""], 42, _.foobar()); +"use strict"; +var foo = bar(["a", "b ", ""], 42, _.foobar()); \ No newline at end of file diff --git a/test/fixtures/syntax/unicode-regex/basic/expected.js b/test/fixtures/syntax/unicode-regex/basic/expected.js index eb14360984..130460934d 100644 --- a/test/fixtures/syntax/unicode-regex/basic/expected.js +++ b/test/fixtures/syntax/unicode-regex/basic/expected.js @@ -1,2 +1,6 @@ -var string = 'foo\uD83D\uDCA9bar'; -var match = string.match(/foo((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uDC00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF]))bar/); +"use strict"; +var string = "foo💩bar"; + +var match = string.match( + /foo((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uDC00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF]))bar/ +); \ No newline at end of file diff --git a/test/fixtures/syntax/unicode-regex/ignore-non-unicode/expected.js b/test/fixtures/syntax/unicode-regex/ignore-non-unicode/expected.js index 5cf989a17d..629ac66ff4 100644 --- a/test/fixtures/syntax/unicode-regex/ignore-non-unicode/expected.js +++ b/test/fixtures/syntax/unicode-regex/ignore-non-unicode/expected.js @@ -1,2 +1,3 @@ -var string = 'foo\uD83D\uDCA9bar'; -var match = string.match(/foo(.)bar/); +"use strict"; +var string = "foo💩bar"; +var match = string.match(/foo(.)bar/); \ No newline at end of file diff --git a/test/fixtures/syntax/use-strict/add/actual.js b/test/fixtures/syntax/use-strict/add/actual.js new file mode 100644 index 0000000000..a280f9a5cc --- /dev/null +++ b/test/fixtures/syntax/use-strict/add/actual.js @@ -0,0 +1 @@ +foo(); diff --git a/test/fixtures/syntax/use-strict/add/expected.js b/test/fixtures/syntax/use-strict/add/expected.js new file mode 100644 index 0000000000..bcf0a73352 --- /dev/null +++ b/test/fixtures/syntax/use-strict/add/expected.js @@ -0,0 +1,2 @@ +"use strict"; +foo(); \ No newline at end of file diff --git a/test/fixtures/syntax/use-strict/exists/actual.js b/test/fixtures/syntax/use-strict/exists/actual.js new file mode 100644 index 0000000000..78e7c81229 --- /dev/null +++ b/test/fixtures/syntax/use-strict/exists/actual.js @@ -0,0 +1,3 @@ +"use strict"; + +foo(); diff --git a/test/fixtures/syntax/use-strict/exists/expected.js b/test/fixtures/syntax/use-strict/exists/expected.js new file mode 100644 index 0000000000..bcf0a73352 --- /dev/null +++ b/test/fixtures/syntax/use-strict/exists/expected.js @@ -0,0 +1,2 @@ +"use strict"; +foo(); \ No newline at end of file