From 32816122f9f0ba691f764f7fd5367aef6d5350c0 Mon Sep 17 00:00:00 2001 From: Ryan Cavanaugh Date: Tue, 28 Jul 2015 17:59:17 -0700 Subject: [PATCH] Error if 'files' property is not an array --- src/compiler/commandLineParser.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index ba7d8ca9ce3..be6d083e3a5 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -422,10 +422,13 @@ namespace ts { if (json["files"] instanceof Array) { fileNames = map(json["files"], s => combinePaths(basePath, s)); } + else { + errors.push(createCompilerDiagnostic(Diagnostics.Compiler_option_0_requires_a_value_of_type_1, 'files', 'Array')); + } } else { let exclude = json["exclude"] instanceof Array ? map(json["exclude"], normalizeSlashes) : undefined; - let sysFiles = host.readDirectory(basePath, ".ts", exclude).concat(host.readDirectory(basePath, ".tsx", exclude)); + let sysFiles = host.readDirectory(basePath, ".ts", exclude).concat(host.readDirectory(basePath, ".tsx", exclude)); for (let i = 0; i < sysFiles.length; i++) { let name = sysFiles[i]; if (fileExtensionIs(name, ".d.ts")) {