Skip to content

Commit 1f37a39

Browse files
Trottdanielleadams
authored andcommitted
policy: revise manifest.js to avoid empty blocks
PR-URL: #41831 Backport-PR-URL: #42160 Refs: https://eslint.org/docs/rules/no-empty Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]>
1 parent 2ba99b5 commit 1f37a39

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

lib/internal/policy/manifest.js

+3-5
Original file line numberDiff line numberDiff line change
@@ -430,12 +430,11 @@ class Manifest {
430430

431431
if (objectButNotArray(obj) && 'onerror' in obj) {
432432
const behavior = obj.onerror;
433-
if (behavior === 'throw') {
434-
} else if (behavior === 'exit') {
433+
if (behavior === 'exit') {
435434
reaction = REACTION_EXIT;
436435
} else if (behavior === 'log') {
437436
reaction = REACTION_LOG;
438-
} else {
437+
} else if (behavior !== 'throw') {
439438
throw new ERR_MANIFEST_UNKNOWN_ONERROR(behavior);
440439
}
441440
}
@@ -579,8 +578,7 @@ class Manifest {
579578
const entry = this.#scopeIntegrities.get(scope);
580579
if (entry === true) {
581580
return true;
582-
} else if (entry === kCascade) {
583-
} else {
581+
} else if (entry !== kCascade) {
584582
break;
585583
}
586584
}

0 commit comments

Comments
 (0)