Skip to content
This repository has been archived by the owner on Aug 1, 2024. It is now read-only.

Commit

Permalink
Automated rollback of commit a43ba1d.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 411866510
Change-Id: I96d25f02a179b06d51fb843861683c39c623e33a
  • Loading branch information
Closure Team authored and copybara-github committed Nov 23, 2021
1 parent 30cd76a commit 9051a9d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 30 deletions.
11 changes: 1 addition & 10 deletions closure/goog/module/modulemanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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] = {};
}
Expand Down
20 changes: 0 additions & 20 deletions closure/goog/module/modulemanager_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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': []});
Expand Down

0 comments on commit 9051a9d

Please sign in to comment.