Skip to content

Commit 805dca1

Browse files
committed
fs: remove unnecessary throw on fs.mkdtemp
The type is already checked in JS. Change to a CHECK PR-URL: #17334 Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Timothy Gu <[email protected]> Reviewed-By: Jon Moss <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
1 parent 1638698 commit 805dca1

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

‎src/node_file.cc‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1367,8 +1367,7 @@ static void Mkdtemp(const FunctionCallbackInfo<Value>& args){
13671367
CHECK_GE(args.Length(), 2);
13681368

13691369
BufferValue tmpl(env->isolate(), args[0]);
1370-
if (*tmpl == nullptr)
1371-
returnTYPE_ERROR("template must be a string or Buffer");
1370+
CHECK_NE(*tmpl, nullptr);
13721371

13731372
constenum encoding encoding = ParseEncoding(env->isolate(), args[1], UTF8);
13741373

0 commit comments

Comments
(0)