From 8e8a2397caffb09eb40905f95fe4ba92fd26d0e7 Mon Sep 17 00:00:00 2001 From: fullheightcoding Date: Thu, 25 Oct 2018 17:55:28 +1100 Subject: [PATCH] Fixed some typos. --- scripts/authors.ts | 14 +++++++------- scripts/bisect-test.ts | 2 +- scripts/createBenchmark.ts | 6 +++--- scripts/generateLocalizedDiagnosticMessages.ts | 4 ++-- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/scripts/authors.ts b/scripts/authors.ts index b616ceb8601..b52898244b6 100644 --- a/scripts/authors.ts +++ b/scripts/authors.ts @@ -4,7 +4,7 @@ import child_process = require("child_process"); type Author = { displayNames: string[]; - preferedName?: string; + preferredName?: string; emails: string[]; }; @@ -20,7 +20,7 @@ const authorsPath = path.resolve("../AUTHORS.md"); function getKnownAuthors(): Author[] { const segmentRegExp = /\s?([^<]+)\s+<([^>]+)>/g; - const preferedNameRegeExp = /\s?#\s?([^#]+)$/; + const preferredNameRegeExp = /\s?#\s?([^#]+)$/; const knownAuthors: Author[] = []; if (!fs.existsSync(mailMapPath)) { @@ -37,13 +37,13 @@ function getKnownAuthors(): Author[] { author.displayNames.push(match[1]); author.emails.push(match[2]); } - if (match = preferedNameRegeExp.exec(line)) { - author.preferedName = match[1]; + if (match = preferredNameRegeExp.exec(line)) { + author.preferredName = match[1]; } if (!author.emails) continue; knownAuthors.push(author); - if (line.indexOf("#") > 0 && !author.preferedName) { - throw new Error("Could not match prefered name for: " + line); + if (line.indexOf("#") > 0 && !author.preferredName) { + throw new Error("Could not match preferred name for: " + line); } // console.log("===> line: " + line); // console.log(JSON.stringify(author, undefined, 2)); @@ -52,7 +52,7 @@ function getKnownAuthors(): Author[] { } function getAuthorName(author: Author) { - return author.preferedName || author.displayNames[0]; + return author.preferredName || author.displayNames[0]; } function getKnownAuthorMaps() { diff --git a/scripts/bisect-test.ts b/scripts/bisect-test.ts index 948b272470f..cc0248f6d64 100644 --- a/scripts/bisect-test.ts +++ b/scripts/bisect-test.ts @@ -5,7 +5,7 @@ import cp = require('child_process'); import fs = require('fs'); -// Slice off 'node bisect-test.js' from the commandline args +// Slice off 'node bisect-test.js' from the command line args var args = process.argv.slice(2); function tsc(tscArgs: string, onExit: (exitCode: number) => void) { diff --git a/scripts/createBenchmark.ts b/scripts/createBenchmark.ts index 6148d80bf2c..254c0d99af0 100644 --- a/scripts/createBenchmark.ts +++ b/scripts/createBenchmark.ts @@ -30,7 +30,7 @@ var rawCompilerSources = ""; sourceFiles.forEach(f=> { rawCompilerSources += "\r\n" + fs.readFileSync(path.join(tsSourceDir, f)).toString(); }); -var compilerSoruces = `var compilerSources = ${JSON.stringify(rawCompilerSources) };`; +var compilerSources = `var compilerSources = ${JSON.stringify(rawCompilerSources) };`; // .js code for the compiler, what we are actually testing var rawCompilerJavaScript = fs.readFileSync(path.join(tsBuildDir, "tsc.js")).toString(); @@ -38,7 +38,7 @@ rawCompilerJavaScript = rawCompilerJavaScript.replace("ts.executeCommandLine(ts. // lib.d.ts sources var rawLibSources = fs.readFileSync(path.join(tsBuildDir, "lib.d.ts")).toString(); -var libSoruces = `var libSources = ${JSON.stringify(rawLibSources) };`; +var libSources = `var libSources = ${JSON.stringify(rawLibSources) };`; // write test output if (!fs.existsSync(testOutputDir)) { @@ -48,7 +48,7 @@ if (!fs.existsSync(testOutputDir)) { // 1. compiler ts sources, used to test fs.writeFileSync( path.join(testOutputDir, "compilerSources.js"), - `${ compilerSoruces } \r\n ${ libSoruces }`); + `${ compilerSources } \r\n ${ libSources }`); // 2. the compiler js sources + a call the compiler fs.writeFileSync( diff --git a/scripts/generateLocalizedDiagnosticMessages.ts b/scripts/generateLocalizedDiagnosticMessages.ts index 09d117d533b..2374a9b4dab 100644 --- a/scripts/generateLocalizedDiagnosticMessages.ts +++ b/scripts/generateLocalizedDiagnosticMessages.ts @@ -36,7 +36,7 @@ function main(): void { console.error("Unexpected XML file structure. Expected to find result.LCX.$.TgtCul."); process.exit(1); } - const outputDirectoryName = getPreferedLocaleName(result.LCX.$.TgtCul); + const outputDirectoryName = getPreferredLocaleName(result.LCX.$.TgtCul); if (!outputDirectoryName) { console.error(`Invalid output locale name for '${result.LCX.$.TgtCul}'.`); process.exit(1); @@ -64,7 +64,7 @@ function main(): void { * Most of the languages we support are neutral locales, so we want to use the language name. * There are three exceptions, zh-CN, zh-TW and pt-BR. */ - function getPreferedLocaleName(localeName: string) { + function getPreferredLocaleName(localeName: string) { switch (localeName) { case "zh-CN": case "zh-TW":