From 9054f9cbf1c7c3b82866a15d9bb26ca6aa6c646b Mon Sep 17 00:00:00 2001 From: Chunpeng Huo Date: Fri, 12 Jun 2020 09:28:01 +1000 Subject: [PATCH] fix(cli-bundler): avoid unwanted match on prototype --- lib/build/find-deps.js | 5 +++-- spec/lib/build/find-deps.spec.js | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/build/find-deps.js b/lib/build/find-deps.js index e1c197df9..97dbab5ae 100644 --- a/lib/build/find-deps.js +++ b/lib/build/find-deps.js @@ -130,8 +130,9 @@ const auConfigureDepFinder = function(contents) { // track aurelia dependency based on user configuration. match.forEach(m => { let methodName = m.match.method.name; - let _deps = auConfigModuleNames[methodName]; - if (_deps) _deps.forEach(d => add(d)); + if (auConfigModuleNames.hasOwnProperty(methodName)) { + auConfigModuleNames[methodName].forEach(d => add(d)); + } }); } diff --git a/spec/lib/build/find-deps.spec.js b/spec/lib/build/find-deps.spec.js index 62b7c2bf8..31f55ca37 100644 --- a/spec/lib/build/find-deps.spec.js +++ b/spec/lib/build/find-deps.spec.js @@ -130,6 +130,7 @@ describe('find-deps', () => { return c.foo = 1; }); } + something.toString(); aurelia.start().then(function () { return aurelia.setRoot(); });