diff --git a/plugins/migration/bin/rename.js b/plugins/migration/bin/rename.js index cb6d3a5d1b..6745590f38 100644 --- a/plugins/migration/bin/rename.js +++ b/plugins/migration/bin/rename.js @@ -192,7 +192,9 @@ class VersionRenamer { // moduleA.exportA -> moduleC.exportB // And we performed the module rename first, we wouldn't be able to detect // the export rename. - this.renamings_.push({old: oldModulePath, new: newModulePath}); + if (newModulePath !== oldModulePath) { + this.renamings_.push({old: oldModulePath, new: newModulePath}); + } } } diff --git a/plugins/migration/test/rename.mocha.js b/plugins/migration/test/rename.mocha.js index e226f77d59..c02d06198f 100644 --- a/plugins/migration/test/rename.mocha.js +++ b/plugins/migration/test/rename.mocha.js @@ -17,6 +17,10 @@ suite('Rename', function () { test('a javascript program with multiple renames works correctly', function () { const database = { '1.0.0': [ + { + oldName: 'Blockly', + exports: {} + }, { oldName: 'Blockly.moduleA', newName: 'Blockly.newModuleA',