Skip to content

Commit 44af975

Browse files
committed
[INTERNAL] Apply suggestions from code review
1 parent 6bbc8e9 commit 44af975

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

lib/lbt/resources/ResourceCollector.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ class ResourceCollector {
190190

191191
if ( /(?:\.js|\.view\.xml|\.control\.xml|\.fragment\.xml)$/.test(name) ) {
192192
if ( (!info.isDebug || debugBundleFilter.matches(name)) ) {
193-
// Only analyze non-debug files which are not special debug bundles (like sap-ui-core-dbg.js)
193+
// Only analyze non-debug files and special debug bundles (like sap-ui-core-dbg.js)
194194
promises.push(
195195
this.enrichWithDependencyInfo(info)
196196
);
@@ -242,8 +242,12 @@ class ResourceCollector {
242242
const nonDebugName = ResourceInfoList.getNonDebugName(dbgInfo.name);
243243
const nonDbgInfo = this._resources.get(nonDebugName);
244244
const newDbgInfo = new ResourceInfo(dbgInfo.name);
245+
246+
// First copy info of analysis from non-dbg file (included, required, condRequired, ...)
245247
newDbgInfo.copyFrom(null, nonDbgInfo);
248+
// Then copy over info from dbg file to properly set name, isDebug, etc.
246249
newDbgInfo.copyFrom(null, dbgInfo);
250+
247251
this._resources.set(dbgInfo.name, newDbgInfo);
248252
}
249253
}
@@ -270,7 +274,7 @@ class ResourceCollector {
270274
return filtersByComponent;
271275
}
272276

273-
groupResourcesByComponents(options) {
277+
groupResourcesByComponents() {
274278
const orphanFilters = this.createOrphanFilters();
275279
for (const resource of this._resources.values()) {
276280
let contained = false;

test/lib/lbt/resources/ResourceCollector.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ test.serial("determineResourceDetails: Debug files and non-debug files", async (
147147
const enrichWithDependencyInfoStub = sinon.stub(resourceCollector, "enrichWithDependencyInfo")
148148
.callsFake((resourceInfo) => {
149149
// Simulate enriching resource info with dependency info to test whether it gets shared
150-
// with the dbg resource alter on
150+
// with the dbg resource later on
151151
resourceInfo.dynRequired = true;
152152
});
153153
await Promise.all([

0 commit comments

Comments
 (0)