Skip to content

Commit

Permalink
policy: check for null instead of falsy in loop
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Trott authored and BethGriggs committed Jan 24, 2022
1 parent 16dec42 commit d83d55e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/internal/policy/sri.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const parse = (str) => {
let prevIndex = 0;
let match;
const entries = [];
while (match = RegExpPrototypeExec(kSRIPattern, str)) {
while ((match = RegExpPrototypeExec(kSRIPattern, str)) !== null) {
if (match.index !== prevIndex) {
throw new ERR_SRI_PARSE(str, str[prevIndex], prevIndex);
}
Expand Down

0 comments on commit d83d55e

Please sign in to comment.