diff --git a/packages/core/integration-tests/test/integration/scope-hoisting/es6/rename-helpers/a.js b/packages/core/integration-tests/test/integration/scope-hoisting/es6/rename-helpers/a.js new file mode 100644 index 00000000000..da98e4e5420 --- /dev/null +++ b/packages/core/integration-tests/test/integration/scope-hoisting/es6/rename-helpers/a.js @@ -0,0 +1,4 @@ +import {B} from './b.js'; +import {C} from './c.js'; + +output = [new B()[Symbol.toStringTag], new C()[Symbol.toStringTag]]; diff --git a/packages/core/integration-tests/test/integration/scope-hoisting/es6/rename-helpers/b.js b/packages/core/integration-tests/test/integration/scope-hoisting/es6/rename-helpers/b.js new file mode 100644 index 00000000000..b55a15508b7 --- /dev/null +++ b/packages/core/integration-tests/test/integration/scope-hoisting/es6/rename-helpers/b.js @@ -0,0 +1,5 @@ +export class B { + get [Symbol.toStringTag]() { + return '1'; + } +} diff --git a/packages/core/integration-tests/test/integration/scope-hoisting/es6/rename-helpers/c.js b/packages/core/integration-tests/test/integration/scope-hoisting/es6/rename-helpers/c.js new file mode 100644 index 00000000000..3f9efc572e8 --- /dev/null +++ b/packages/core/integration-tests/test/integration/scope-hoisting/es6/rename-helpers/c.js @@ -0,0 +1,5 @@ +export class C { + get [Symbol.toStringTag]() { + return '2'; + } +} diff --git a/packages/core/integration-tests/test/integration/scope-hoisting/es6/rename-helpers/package.json b/packages/core/integration-tests/test/integration/scope-hoisting/es6/rename-helpers/package.json new file mode 100644 index 00000000000..601436668c0 --- /dev/null +++ b/packages/core/integration-tests/test/integration/scope-hoisting/es6/rename-helpers/package.json @@ -0,0 +1,3 @@ +{ + "browserslist": "Chrome 50" +} diff --git a/packages/core/integration-tests/test/integration/scope-hoisting/es6/rename-helpers/yarn.lock b/packages/core/integration-tests/test/integration/scope-hoisting/es6/rename-helpers/yarn.lock new file mode 100644 index 00000000000..e69de29bb2d diff --git a/packages/core/integration-tests/test/scope-hoisting.js b/packages/core/integration-tests/test/scope-hoisting.js index 63ddafd760a..2615f4f7836 100644 --- a/packages/core/integration-tests/test/scope-hoisting.js +++ b/packages/core/integration-tests/test/scope-hoisting.js @@ -169,6 +169,23 @@ describe('scope hoisting', function () { assert.equal(output, 2); }); + it('supports renaming helpers inserted during transpiling', async function () { + let b = await bundle( + path.join( + __dirname, + '/integration/scope-hoisting/es6/rename-helpers/a.js', + ), + ); + let contents = await outputFS.readFile( + b.getBundles()[0].filePath, + 'utf8', + ); + assert(/let \S* = Symbol.toStringTag;/.test(contents)); + + let output = await run(b); + assert.deepEqual(output, ['1', '2']); + }); + it('supports renaming imports', async function () { let b = await bundle( path.join(