Skip to content

Commit

Permalink
wasi: use missing validator
Browse files Browse the repository at this point in the history
The `wasi` lib module's `initialize()` method is missing a validator.
  • Loading branch information
VoltrexKeyva authored Jun 18, 2021
1 parent 0536be2 commit 8d1c38b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/wasi.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,9 @@ class WASI {

const { _start, _initialize } = this[kInstance].exports;

if (typeof _initialize !== 'function' && _initialize !== undefined) {
throw new ERR_INVALID_ARG_TYPE(
'instance.exports._initialize', 'function', _initialize);
if (_initialize !== undefined) {
validateFunction(
_initialize, 'instance.exports._initialize');
}
if (_start !== undefined) {
throw new ERR_INVALID_ARG_TYPE(
Expand Down

0 comments on commit 8d1c38b

Please sign in to comment.