pluginfw: Return from findUnmet() early if not given an object

For some reason strings are sometimes passed to `findUnmet()`, which
is obviously unexpected given the way the code is written. Rather than
figure out why strings are passed and how to safely avoid passing
strings, just return early. The net effect is the same, but returning
early avoids setting a property on a string, which is prohibited in
strict mode.
This commit is contained in:
Richard Hansen 2021-02-04 02:04:59 -05:00 committed by John McLear
parent a06662fd00
commit 895764e047

View file

@ -250,6 +250,7 @@ function resolveInheritance(obj) {
// No I/O
const fuSeen = [];
function findUnmet(obj) {
if (typeof obj !== 'object') return;
if (fuSeen.indexOf(obj) !== -1) return;
fuSeen.push(obj);
const deps = obj.dependencies = obj.dependencies || {};