Skip to content

Commit faceae4

Browse files
Trottdanielleadams
authored andcommitted
crypto: revise variables for const use instead of let
This prepares the code for enabling the no-cond-assign rule. PR-URL: #41614 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Anna Henningsen <anna@addaleax.net>
1 parent d5efecd commit faceae4

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

‎lib/internal/crypto/scrypt.js‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ function check(password, salt, keylen, options) {
9898

9999
let{ N, r, p, maxmem }=defaults;
100100
if(options&&options!==defaults){
101-
lethas_N,has_r,has_p;
102-
if(has_N=(options.N!==undefined)){
101+
consthas_N=options.N!==undefined;
102+
if(has_N){
103103
N=options.N;
104104
validateUint32(N,'N');
105105
}
@@ -108,7 +108,8 @@ function check(password, salt, keylen, options) {
108108
N=options.cost;
109109
validateUint32(N,'cost');
110110
}
111-
if(has_r=(options.r!==undefined)){
111+
consthas_r=(options.r!==undefined);
112+
if(has_r){
112113
r=options.r;
113114
validateUint32(r,'r');
114115
}
@@ -117,7 +118,8 @@ function check(password, salt, keylen, options) {
117118
r=options.blockSize;
118119
validateUint32(r,'blockSize');
119120
}
120-
if(has_p=(options.p!==undefined)){
121+
consthas_p=options.p!==undefined;
122+
if(has_p){
121123
p=options.p;
122124
validateUint32(p,'p');
123125
}

0 commit comments

Comments
 (0)