Skip to content

Commit

Permalink
jsdebug now treats undefined as "not specified" in optional parameters.
Browse files Browse the repository at this point in the history
That's the default in most languages/libraries and that's also how (most=
of our methods work.
  • Loading branch information
Joscha Rohmann committed Aug 20, 2016
1 parent 6667249 commit 3798595
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/blocks/jsdebug.js
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,11 @@ function checkType(param, value) {
type = types[i].toLowerCase();
type = type.replace('...', '');

if (param.optional && blocks.isUndefined(unwrapedValue)) {
satisfied = true;
break;
}

if (type == '*') {
satisfied = true;
break;
Expand Down

0 comments on commit 3798595

Please sign in to comment.