diff --git a/lib/internal/policy/manifest.js b/lib/internal/policy/manifest.js index a3f6d347d47025..1be12eb4635d36 100644 --- a/lib/internal/policy/manifest.js +++ b/lib/internal/policy/manifest.js @@ -430,12 +430,11 @@ class Manifest { if (objectButNotArray(obj) && 'onerror' in obj) { const behavior = obj.onerror; - if (behavior === 'throw') { - } else if (behavior === 'exit') { + if (behavior === 'exit') { reaction = REACTION_EXIT; } else if (behavior === 'log') { reaction = REACTION_LOG; - } else { + } else if (behavior !== 'throw') { throw new ERR_MANIFEST_UNKNOWN_ONERROR(behavior); } } @@ -579,8 +578,7 @@ class Manifest { const entry = this.#scopeIntegrities.get(scope); if (entry === true) { return true; - } else if (entry === kCascade) { - } else { + } else if (entry !== kCascade) { break; } }