From b06f9140729e61fad95daf5b765d77809b304f96 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Mon, 26 Jun 2017 14:28:14 -0700 Subject: [PATCH] [Refactor] instead of throwing on `undefined.forEach`, throw explicitly. --- bin/tape | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bin/tape b/bin/tape index 8fdbbdd9..d0b3bec5 100755 --- a/bin/tape +++ b/bin/tape @@ -30,6 +30,10 @@ opts._.forEach(function (arg) { // Note: `glob.sync` may throw an error and crash the node process. var files = glob.sync(arg); + if (!Array.isArray(files)) { + throw new TypeError('unknown error: glob.sync did not return an array or throw. Please report this.'); + } + files.forEach(function (file) { require(resolvePath(cwd, file)); });