Skip to content

Commit

Permalink
Merge pull request #15141 from Microsoft/getOwnKeys
Browse files Browse the repository at this point in the history
Remove unnecessary use of getOwnKeys
  • Loading branch information
Andy authored Apr 14, 2017
2 parents dbb1252 + 4ae8df6 commit af64ef8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/compiler/commandLineParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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("");
Expand All @@ -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))},`;
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -945,7 +945,7 @@ namespace ts {
export function assign<T1 extends MapLike<{}>>(t: T1, ...args: any[]): any;
export function assign<T1 extends MapLike<{}>>(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];
}
}
Expand Down

0 comments on commit af64ef8

Please sign in to comment.