mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
policy: check for null instead of falsy in loop
This prepares the code for the no-cond-assign ESLint rule. PR-URL: https://github.com/nodejs/node/pull/41614 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Anna Henningsen <anna@addaleax.net>
This commit is contained in:
1 parent
363c760c85
commit
33f3391a8f
1 file changed
+1
-1
@@ -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);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user