Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Make nqp.to_bool work on undefined.
  • Loading branch information
pmurias committed Aug 16, 2014
1 parent e65d7e1 commit 80adad8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/vm/js/nqp-runtime/runtime.js
Expand Up @@ -51,8 +51,9 @@ exports.to_bool = function(arg) {
return arg == "" || arg == "0" ? 0 : 1;
} else if (arg instanceof Array) {
return arg.length == 0 ? 0 : 1;
} else if (arg === undefined) {
return 0;
} else {
console.log(arg);
throw "Can't decide if arg is true";
}
};
Expand Down

0 comments on commit 80adad8

Please sign in to comment.