From 4ae8df635a4865403b33d9916a328b2bb3bdb781 Mon Sep 17 00:00:00 2001 From: Andy Hanson Date: Tue, 11 Apr 2017 14:18:11 -0700 Subject: [PATCH] Remove unnecessary use of getOwnKeys Also, fix a typo. --- src/compiler/commandLineParser.ts | 4 ++-- src/compiler/core.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index d5903b599b9..e067d0bf8a1 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -1007,7 +1007,7 @@ namespace ts { let seenKnownKeys = 0; const nameColumn: string[] = []; const descriptionColumn: string[] = []; - const knownKesyCount = getOwnKeys(configurations.compilerOptions).length; + const knownKeysCount = getOwnKeys(configurations.compilerOptions).length; for (const category in categorizedOptions) { if (nameColumn.length !== 0) { nameColumn.push(""); @@ -1018,7 +1018,7 @@ namespace ts { for (const option of categorizedOptions[category]) { let optionName; if (hasProperty(configurations.compilerOptions, option.name)) { - optionName = `"${option.name}": ${JSON.stringify(configurations.compilerOptions[option.name])}${(seenKnownKeys += 1) === knownKesyCount ? "" : ","}`; + optionName = `"${option.name}": ${JSON.stringify(configurations.compilerOptions[option.name])}${(seenKnownKeys += 1) === knownKeysCount ? "" : ","}`; } else { optionName = `// "${option.name}": ${JSON.stringify(getDefaultValueForOption(option))},`; diff --git a/src/compiler/core.ts b/src/compiler/core.ts index ac354e24eda..3e5b4ee5ce3 100644 --- a/src/compiler/core.ts +++ b/src/compiler/core.ts @@ -943,7 +943,7 @@ namespace ts { export function assign>(t: T1, ...args: any[]): any; export function assign>(t: T1, ...args: any[]) { for (const arg of args) { - for (const p of getOwnKeys(arg)) { + for (const p in arg) if (hasProperty(arg, p)) { t[p] = arg[p]; } }