diff --git a/test/function/deshadowed-shorthand-property/_config.js b/test/function/deshadowed-shorthand-property/_config.js new file mode 100644 index 0000000..31e1c94 --- /dev/null +++ b/test/function/deshadowed-shorthand-property/_config.js @@ -0,0 +1,4 @@ +module.exports = { + solo: true, + description: 'shorthand properties referencing deshadowed variables are expanded' +}; diff --git a/test/function/deshadowed-shorthand-property/foo.js b/test/function/deshadowed-shorthand-property/foo.js new file mode 100644 index 0000000..c03d7e4 --- /dev/null +++ b/test/function/deshadowed-shorthand-property/foo.js @@ -0,0 +1,3 @@ +export default function answer () { + return 42; +} diff --git a/test/function/deshadowed-shorthand-property/main.js b/test/function/deshadowed-shorthand-property/main.js new file mode 100644 index 0000000..3cc4941 --- /dev/null +++ b/test/function/deshadowed-shorthand-property/main.js @@ -0,0 +1,8 @@ +import foo from './foo.js'; + +function x () { + const answer = foo(); + return { answer }; +} + +assert.equal( x().answer, 42 );