Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRich Trott <rtrott@gmail.com>2022-02-03 09:05:41 +0300
committerNode.js GitHub Bot <github-bot@iojs.org>2022-02-05 15:58:31 +0300
commita02099b9f22c4e7e1ce9e356a4ad58f960a23d20 (patch)
tree4f02fa79c485a82769bd03dd1c3d5762bc8ae91f /lib
parent78a2cd862426fbc137f9286b7bcedf415f960ef0 (diff)
policy: revise manifest.js to avoid empty blocks
PR-URL: https://github.com/nodejs/node/pull/41831 Refs: https://eslint.org/docs/rules/no-empty Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/internal/policy/manifest.js8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/internal/policy/manifest.js b/lib/internal/policy/manifest.js
index a3f6d347d47..1be12eb4635 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;
}
}