Skip to content

Commit

Permalink
vm: remove MISSING_ARGS error code
Browse files Browse the repository at this point in the history
The documentation states:

> This is only used for strict compliance with the API specification
> (which in some cases may accept func(undefined) but not func()). In
> most native Node.js APIs, func(undefined) and func() are treated
> identically, and the ERR_INVALID_ARG_TYPE error code may be used
> instead.

Refs: nodejs#19268 (comment)
  • Loading branch information
TimothyGu committed Mar 29, 2018
1 parent aec0190 commit 7118e91
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
4 changes: 0 additions & 4 deletions lib/vm.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,6 @@ function getContextOptions(options) {
}

function isContext(sandbox) {
if (arguments.length < 1) {
throw new ERR_MISSING_ARGS('sandbox');
}

if (typeof sandbox !== 'object' && typeof sandbox !== 'function' ||
sandbox === null) {
throw new ERR_INVALID_ARG_TYPE('sandbox', 'object', sandbox);
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-vm-is-context.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ for (const valToTest of [
common.expectsError(() => {
vm.isContext();
}, {
code: 'ERR_MISSING_ARGS',
code: 'ERR_INVALID_ARG_TYPE',
type: TypeError
});

Expand Down

0 comments on commit 7118e91

Please sign in to comment.