Skip to content

Commit 671cb3d

Browse files
committed
fix: ensure default values are null when provided undefined
1 parent a2ba8cb commit 671cb3d

2 files changed

Lines changed: 371 additions & 3 deletions

File tree

lib/node_modules/@stdlib/slice/ctor/lib/main.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,9 @@ function Slice() {
146146
if ( !isValid( step ) ) {
147147
throw new TypeError( format( 'invalid argument. Third argument must be an integer, null, or undefined. Value: `%s`.', step ) );
148148
}
149-
this._start = start;
150-
this._stop = stop;
151-
this._step = step;
149+
this._start = ( start === void 0 ) ? null : start;
150+
this._stop = ( stop === void 0 ) ? null : stop;
151+
this._step = ( step === void 0 ) ? null : step;
152152
return this;
153153
}
154154

0 commit comments

Comments
 (0)