mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-14 19:16:17 -06:00
Fixed some typos.
This commit is contained in:
parent
42740d66c2
commit
8e8a2397ca
@ -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() {
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -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(
|
||||
|
||||
@ -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":
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user