wasi: use missing validator

The `wasi` lib module's `initialize()` method is missing a validator.

PR-URL: https://github.com/nodejs/node/pull/39070
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
This commit is contained in:
Voltrex 2021-06-18 06:39:40 +04:30 committed by Antoine du Hamel
parent ffda9a8953
commit 46a7e61900
4 changed files with 14 additions and 15 deletions

View file

@ -229,6 +229,11 @@ const validateFunction = hideStackFrames((value, name) => {
throw new ERR_INVALID_ARG_TYPE(name, 'Function', value);
});
const validateUndefined = hideStackFrames((value, name) => {
if (value !== undefined)
throw new ERR_INVALID_ARG_TYPE(name, 'undefined', value);
});
module.exports = {
isInt32,
isUint32,
@ -247,6 +252,7 @@ module.exports = {
validateSignalName,
validateString,
validateUint32,
validateUndefined,
validateCallback,
validateAbortSignal,
};