diff --git a/test/function/export-destruction/_config.js b/test/function/export-destruction/_config.js new file mode 100644 index 0000000..263c8d1 --- /dev/null +++ b/test/function/export-destruction/_config.js @@ -0,0 +1,12 @@ +var assert = require( 'assert' ); + +module.exports = { + description: 'handle destruction patterns in export declarations', + babel: true, + + exports: function ( exports ) { + assert.deepEqual( Object.keys( exports ), [ 'baz', 'quux' ] ); + assert.equal( exports.baz, 5 ); + assert.equal( exports.quux, 17 ); + } +}; diff --git a/test/function/export-destruction/main.js b/test/function/export-destruction/main.js new file mode 100644 index 0000000..d178da4 --- /dev/null +++ b/test/function/export-destruction/main.js @@ -0,0 +1,5 @@ +var foo = { bar: { baz: 5 } }; +var arr = [ { quux: 'wrong' }, { quux: 17 } ]; + +export var { bar: { baz } } = foo; +export var [ /* skip */, { quux } ] = arr;