From 946cbbbdfe1f19171da4e19fca23bbc39b14a61e Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Wed, 30 Sep 2015 13:52:37 -0400 Subject: [PATCH] move shorthand props test from function to form, for benefit of node 0.12 --- .../shorthand-properties/_config.js | 0 .../shorthand-properties/_expected/amd.js | 19 +++++++++++++++ .../shorthand-properties/_expected/cjs.js | 17 ++++++++++++++ .../shorthand-properties/_expected/es6.js | 15 ++++++++++++ .../shorthand-properties/_expected/iife.js | 19 +++++++++++++++ .../shorthand-properties/_expected/umd.js | 23 +++++++++++++++++++ .../shorthand-properties/baz.js | 0 .../shorthand-properties/foo.js | 0 .../shorthand-properties/main.js | 0 test/function/module-sort-order/_config.js | 2 -- test/function/module-sort-order/a.js | 4 ++-- test/function/module-sort-order/b.js | 2 +- test/function/module-sort-order/c.js | 2 +- 13 files changed, 97 insertions(+), 6 deletions(-) rename test/{function => form}/shorthand-properties/_config.js (100%) create mode 100644 test/form/shorthand-properties/_expected/amd.js create mode 100644 test/form/shorthand-properties/_expected/cjs.js create mode 100644 test/form/shorthand-properties/_expected/es6.js create mode 100644 test/form/shorthand-properties/_expected/iife.js create mode 100644 test/form/shorthand-properties/_expected/umd.js rename test/{function => form}/shorthand-properties/baz.js (100%) rename test/{function => form}/shorthand-properties/foo.js (100%) rename test/{function => form}/shorthand-properties/main.js (100%) diff --git a/test/function/shorthand-properties/_config.js b/test/form/shorthand-properties/_config.js similarity index 100% rename from test/function/shorthand-properties/_config.js rename to test/form/shorthand-properties/_config.js diff --git a/test/form/shorthand-properties/_expected/amd.js b/test/form/shorthand-properties/_expected/amd.js new file mode 100644 index 0000000..da84ec6 --- /dev/null +++ b/test/form/shorthand-properties/_expected/amd.js @@ -0,0 +1,19 @@ +define(function () { 'use strict'; + + function bar$1 () { + return 'main-bar'; + } + + function bar () { + return 'foo-bar'; + } + + var foo = { + bar, + baz: bar$1 + }; + + assert.equal( bar$1(), 'main-bar' ); + assert.equal( foo.bar(), 'foo-bar' ); + +}); diff --git a/test/form/shorthand-properties/_expected/cjs.js b/test/form/shorthand-properties/_expected/cjs.js new file mode 100644 index 0000000..a620970 --- /dev/null +++ b/test/form/shorthand-properties/_expected/cjs.js @@ -0,0 +1,17 @@ +'use strict'; + +function bar$1 () { + return 'main-bar'; +} + +function bar () { + return 'foo-bar'; +} + +var foo = { + bar, + baz: bar$1 +}; + +assert.equal( bar$1(), 'main-bar' ); +assert.equal( foo.bar(), 'foo-bar' ); diff --git a/test/form/shorthand-properties/_expected/es6.js b/test/form/shorthand-properties/_expected/es6.js new file mode 100644 index 0000000..8d1e6b3 --- /dev/null +++ b/test/form/shorthand-properties/_expected/es6.js @@ -0,0 +1,15 @@ +function bar$1 () { + return 'main-bar'; +} + +function bar () { + return 'foo-bar'; +} + +var foo = { + bar, + baz: bar$1 +}; + +assert.equal( bar$1(), 'main-bar' ); +assert.equal( foo.bar(), 'foo-bar' ); diff --git a/test/form/shorthand-properties/_expected/iife.js b/test/form/shorthand-properties/_expected/iife.js new file mode 100644 index 0000000..2fc24d7 --- /dev/null +++ b/test/form/shorthand-properties/_expected/iife.js @@ -0,0 +1,19 @@ +(function () { 'use strict'; + + function bar$1 () { + return 'main-bar'; + } + + function bar () { + return 'foo-bar'; + } + + var foo = { + bar, + baz: bar$1 + }; + + assert.equal( bar$1(), 'main-bar' ); + assert.equal( foo.bar(), 'foo-bar' ); + +})(); diff --git a/test/form/shorthand-properties/_expected/umd.js b/test/form/shorthand-properties/_expected/umd.js new file mode 100644 index 0000000..e4b7bde --- /dev/null +++ b/test/form/shorthand-properties/_expected/umd.js @@ -0,0 +1,23 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory() : + typeof define === 'function' && define.amd ? define(factory) : + factory(); +}(this, function () { 'use strict'; + + function bar$1 () { + return 'main-bar'; + } + + function bar () { + return 'foo-bar'; + } + + var foo = { + bar, + baz: bar$1 + }; + + assert.equal( bar$1(), 'main-bar' ); + assert.equal( foo.bar(), 'foo-bar' ); + +})); diff --git a/test/function/shorthand-properties/baz.js b/test/form/shorthand-properties/baz.js similarity index 100% rename from test/function/shorthand-properties/baz.js rename to test/form/shorthand-properties/baz.js diff --git a/test/function/shorthand-properties/foo.js b/test/form/shorthand-properties/foo.js similarity index 100% rename from test/function/shorthand-properties/foo.js rename to test/form/shorthand-properties/foo.js diff --git a/test/function/shorthand-properties/main.js b/test/form/shorthand-properties/main.js similarity index 100% rename from test/function/shorthand-properties/main.js rename to test/form/shorthand-properties/main.js diff --git a/test/function/module-sort-order/_config.js b/test/function/module-sort-order/_config.js index a84538d..9b7f002 100644 --- a/test/function/module-sort-order/_config.js +++ b/test/function/module-sort-order/_config.js @@ -1,5 +1,3 @@ module.exports = { - // solo: true, - // show: true, description: 'module sorter is not confused by top-level call expressions' }; diff --git a/test/function/module-sort-order/a.js b/test/function/module-sort-order/a.js index cf43071..c84b679 100644 --- a/test/function/module-sort-order/a.js +++ b/test/function/module-sort-order/a.js @@ -3,14 +3,14 @@ import z from './z'; z(); -const p = { +var p = { q: function () { b.nope(); } }; (function () { - const p = { + var p = { q: function () { b.nope(); } diff --git a/test/function/module-sort-order/b.js b/test/function/module-sort-order/b.js index 3a7e6b7..1d6eae8 100644 --- a/test/function/module-sort-order/b.js +++ b/test/function/module-sort-order/b.js @@ -1 +1 @@ -export const b = function () {}; +export var b = function () {}; diff --git a/test/function/module-sort-order/c.js b/test/function/module-sort-order/c.js index 4bbf7c1..5280bb0 100644 --- a/test/function/module-sort-order/c.js +++ b/test/function/module-sort-order/c.js @@ -1,3 +1,3 @@ import { b } from './b'; -export const c = function () {}; +export var c = function () {};