Skip to content

Commit

Permalink
fs: remove unnecessary throw on fs.mkdtemp
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
jasnell committed Dec 13, 2017
1 parent 1638698 commit 805dca1
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/node_file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1367,8 +1367,7 @@ static void Mkdtemp(const FunctionCallbackInfo<Value>& args) {
CHECK_GE(args.Length(), 2);

BufferValue tmpl(env->isolate(), args[0]);
if (*tmpl == nullptr)
return TYPE_ERROR("template must be a string or Buffer");
CHECK_NE(*tmpl, nullptr);

const enum encoding encoding = ParseEncoding(env->isolate(), args[1], UTF8);

Expand Down

0 comments on commit 805dca1

Please sign in to comment.