Skip to content

Commit 5e69b19

Browse files
Trottdanielleadams
authored andcommitted
policy: check for null instead of falsy in loop
This prepares the code for the no-cond-assign ESLint rule. PR-URL: #41614 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Anna Henningsen <anna@addaleax.net>
1 parent f10fe12 commit 5e69b19

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/internal/policy/sri.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const parse = (str) => {
3838
let prevIndex = 0;
3939
let match;
4040
const entries = [];
41-
while (match = RegExpPrototypeExec(kSRIPattern, str)) {
41+
while ((match = RegExpPrototypeExec(kSRIPattern, str)) !== null) {
4242
if (match.index !== prevIndex) {
4343
throw new ERR_SRI_PARSE(str, str[prevIndex], prevIndex);
4444
}

0 commit comments

Comments
 (0)