diff --git a/closure/goog/module/modulemanager.js b/closure/goog/module/modulemanager.js index b53187d30b..1e0fa4481e 100644 --- a/closure/goog/module/modulemanager.js +++ b/closure/goog/module/modulemanager.js @@ -378,19 +378,10 @@ goog.module.ModuleManager.prototype.getModuleInfo = function(id) { }; -/** - * @param {string} fromModule - * @param {string} toModule - * @override - */ +/** @override */ goog.module.ModuleManager.prototype.addExtraEdge = function( fromModule, toModule) { 'use strict'; - if (this.getModuleInfo(fromModule).isLoaded()) { - throw new Error( - `The extra edge ${fromModule} -> ${toModule} cannot be added since ${ - fromModule} has already been loaded.`); - } if (!this.extraEdges_[fromModule]) { this.extraEdges_[fromModule] = {}; } diff --git a/closure/goog/module/modulemanager_test.js b/closure/goog/module/modulemanager_test.js index 3bb9f52338..6f112d23e9 100644 --- a/closure/goog/module/modulemanager_test.js +++ b/closure/goog/module/modulemanager_test.js @@ -1024,26 +1024,6 @@ testSuite({ assertThrows(() => mm.load('modA')); }, - testAddExtraEdge_fromModuleAlreadyLoaded() { - const mm = getModuleManager({'modA': [], 'modC': []}); - - const loaderCalls = []; - mm.setLoader(createModuleLoaderWithExtraEdgesSupport(loaderCalls)); - - // Set modA as loaded. - mm.beforeLoadModuleCode('modA'); - mm.setLoaded('modA'); - - // Assert error is thrown since modA has already loaded. - const e = assertThrows(() => mm.addExtraEdge('modA', 'modB')); - assertEquals( - 'The extra edge modA -> modB cannot be added since modA has already been loaded.', - e.message); - - // Assert no error is thrown since modC has not been loaded yet. - assertNotThrows(() => mm.addExtraEdge('modC', 'modB')); - }, - testRemoveExtraEdge() { const mm = getModuleManager({'modA': [], 'modB': [], 'modC': [], 'modD': []});