Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 6 additions & 11 deletions scripts/validate-modules.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,12 @@ for (const m of modules) {
process.exit(1);
}

if (t === 'object') {
const keys = Object.keys(exported);
for (const k of keys) {
if (typeof exported[k] === 'function') {
if (typeof exported[k] !== 'function') {
console.error('FAIL: ' + m + '.' + k + ' is declared but not a callable function');
process.exit(1);
}
}
}
}
// Previously this block contained a nested `typeof === 'function'` test
// inside `typeof === 'function'`, which was trivially false and made the
// intended "declared but not callable" warning unreachable. Without a
// declaration manifest we cannot tell which exported keys are expected
// to be functions, so the block is left as a no-op but the dead branch
// is removed to avoid giving false assurance.
checked++;
}

Expand Down