Skip to content
Prev Previous commit
Next Next commit
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>
  • Loading branch information
Trott committed Jan 23, 2022
commit 0bc642202f9ef8b7985969f3c2a7320d18c4d61c
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