Skip to content

Commit d83d55e

Browse files
TrottBethGriggs
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 <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
1 parent 16dec42 commit d83d55e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/internal/policy/sri.js

Lines changed: 1 addition & 1 deletion
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)