fs: remove unnecessary throw on fs.mkdtemp

The type is already checked in JS. Change to a CHECK

PR-URL: https://github.com/nodejs/node/pull/17334
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
This commit is contained in:
James M Snell 2017-11-26 21:03:49 -08:00
parent 163869879e
commit 805dca199a

View File

@ -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);