Skip to content

Commit a0dd804

Browse files
committed
Merge branch 'master' of https://github.com/Microsoft/TypeScript into feature/36249
2 parents e8a2eae + 4a34294 commit a0dd804

26 files changed

+440
-69
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: New Release Branch
2+
3+
on:
4+
repository_dispatch:
5+
types: new-release-branch
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Use node version 12.x
13+
uses: actions/setup-node@v1
14+
with:
15+
node-version: 12.x
16+
- uses: actions/checkout@v2
17+
with:
18+
fetch-depth: 5
19+
- run: |
20+
git checkout -b ${{ github.event.client_payload.branch_name }}
21+
sed -i -e 's/"version": ".*"/"version": "${{ github.event.client_payload.package_version }}"/g' package.json
22+
sed -i -e 's/const versionMajorMinor = ".*"/const versionMajorMinor = "${{ github.event.client_payload.core_major_minor }}"/g' src/compiler/corePublic.ts
23+
sed -i -e 's/const versionMajorMinor = ".*"/const versionMajorMinor = "${{ github.event.client_payload.core_major_minor }}"/g' tests/baselines/reference/api/typescript.d.ts
24+
sed -i -e 's/const versionMajorMinor = ".*"/const versionMajorMinor = "${{ github.event.client_payload.core_major_minor }}"/g' tests/baselines/reference/api/tsserverlibrary.d.ts
25+
sed -i -e 's/const version = `${versionMajorMinor}.0-.*`/const version = `${versionMajorMinor}.0-${{ github.event.client_payload.core_tag || 'dev' }}`/g' src/compiler/corePublic.ts
26+
npm install
27+
gulp LKG
28+
npm test
29+
git diff
30+
git add package.json
31+
git add src/compiler/corePublic.ts
32+
git add tests/baselines/reference/api/typescript.d.ts
33+
git add tests/baselines/reference/api/tsserverlibrary.d.ts
34+
git add ./lib
35+
git config user.email "[email protected]"
36+
git config user.name "TypeScript Bot"
37+
git commit -m 'Bump version to ${{ github.event.client_payload.package_version }} and LKG'
38+
git push --set-upstream origin ${{ github.event.client_payload.branch_name }}

Gulpfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ const generateCodeCoverage = () => exec("istanbul", ["cover", "node_modules/moch
430430
task("generate-code-coverage", series(preBuild, buildTests, generateCodeCoverage));
431431
task("generate-code-coverage").description = "Generates code coverage data via istanbul";
432432

433-
const preTest = parallel(buildTests, buildServices, buildLssl);
433+
const preTest = parallel(buildTsc, buildTests, buildServices, buildLssl);
434434
preTest.displayName = "preTest";
435435

436436
const postTest = (done) => cmdLineOptions.lint ? lint(done) : done();

scripts/open-user-pr.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ function padNum(num: number) {
1212
const userName = process.env.GH_USERNAME;
1313
const reviewers = process.env.REQUESTING_USER ? [process.env.REQUESTING_USER] : ["weswigham", "sandersn", "RyanCavanaugh"];
1414
const now = new Date();
15-
const branchName = `user-update-${process.env.TARGET_FORK}-${now.getFullYear()}${padNum(now.getMonth())}${padNum(now.getDay())}${process.env.TARGET_BRANCH ? "-" + process.env.TARGET_BRANCH : ""}`;
15+
const branchName = `user-update-${process.env.TARGET_FORK}-${now.getFullYear()}${padNum(now.getMonth() + 1)}${padNum(now.getDate())}${process.env.TARGET_BRANCH ? "-" + process.env.TARGET_BRANCH : ""}`;
1616
const remoteUrl = `https://${process.argv[2]}@github.com/${userName}/TypeScript.git`;
1717
runSequence([
1818
["git", ["checkout", "."]], // reset any changes

src/compiler/checker.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22546,9 +22546,11 @@ namespace ts {
2254622546

2254722547
// If object literal is contextually typed by the implied type of a binding pattern, augment the result
2254822548
// type with those properties for which the binding pattern specifies a default value.
22549-
if (contextualTypeHasPattern) {
22549+
// If the object literal is spread into another object literal, skip this step and let the top-level object
22550+
// literal handle it instead.
22551+
if (contextualTypeHasPattern && node.parent.kind !== SyntaxKind.SpreadAssignment) {
2255022552
for (const prop of getPropertiesOfType(contextualType!)) {
22551-
if (!propertiesTable.get(prop.escapedName) && !(spread && getPropertyOfType(spread, prop.escapedName))) {
22553+
if (!propertiesTable.get(prop.escapedName) && !getPropertyOfType(spread, prop.escapedName)) {
2255222554
if (!(prop.flags & SymbolFlags.Optional)) {
2255322555
error(prop.valueDeclaration || (<TransientSymbol>prop).bindingElement,
2255422556
Diagnostics.Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value);

src/compiler/core.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2051,4 +2051,19 @@ namespace ts {
20512051
}
20522052
}
20532053
}
2054+
2055+
export function padLeft(s: string, length: number) {
2056+
while (s.length < length) {
2057+
s = " " + s;
2058+
}
2059+
return s;
2060+
}
2061+
2062+
export function padRight(s: string, length: number) {
2063+
while (s.length < length) {
2064+
s = s + " ";
2065+
}
2066+
2067+
return s;
2068+
}
20542069
}

src/compiler/program.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -383,13 +383,6 @@ namespace ts {
383383
return formatStyle + text + resetEscapeSequence;
384384
}
385385

386-
function padLeft(s: string, length: number) {
387-
while (s.length < length) {
388-
s = " " + s;
389-
}
390-
return s;
391-
}
392-
393386
function formatCodeSpan(file: SourceFile, start: number, length: number, indent: string, squiggleColor: ForegroundColorEscapeSequences, host: FormatDiagnosticsHost) {
394387
const { line: firstLine, character: firstLineChar } = getLineAndCharacterOfPosition(file, start);
395388
const { line: lastLine, character: lastLineChar } = getLineAndCharacterOfPosition(file, start + length);

src/compiler/resolutionCache.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,7 @@ namespace ts {
687687
(filesWithInvalidatedResolutions || (filesWithInvalidatedResolutions = createMap<true>())).set(containingFilePath, true);
688688

689689
// When its a file with inferred types resolution, invalidate type reference directive resolution
690-
if (containingFilePath.endsWith(inferredTypesContainingFile)) {
690+
if (endsWith(containingFilePath, inferredTypesContainingFile)) {
691691
resolutionHost.onChangedAutomaticTypeDirectiveNames();
692692
}
693693
}

src/compiler/scanner.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2444,7 +2444,7 @@ namespace ts {
24442444
return String.fromCharCode(codeUnit1, codeUnit2);
24452445
}
24462446

2447-
const utf16EncodeAsStringWorker: (codePoint: number) => string = (String as any).fromCodePoint ? codePoint => String.fromCodePoint(codePoint) : utf16EncodeAsStringFallback;
2447+
const utf16EncodeAsStringWorker: (codePoint: number) => string = (String as any).fromCodePoint ? codePoint => (String as any).fromCodePoint(codePoint) : utf16EncodeAsStringFallback;
24482448

24492449
/* @internal */
24502450
export function utf16EncodeAsString(codePoint: number) {

src/compiler/sys.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,14 +1004,14 @@ namespace ts {
10041004
writeFloatBE(value: number, offset: number): number;
10051005
writeDoubleLE(value: number, offset: number): number;
10061006
writeDoubleBE(value: number, offset: number): number;
1007-
readBigUInt64BE(offset?: number): bigint;
1008-
readBigUInt64LE(offset?: number): bigint;
1009-
readBigInt64BE(offset?: number): bigint;
1010-
readBigInt64LE(offset?: number): bigint;
1011-
writeBigInt64BE(value: bigint, offset?: number): number;
1012-
writeBigInt64LE(value: bigint, offset?: number): number;
1013-
writeBigUInt64BE(value: bigint, offset?: number): number;
1014-
writeBigUInt64LE(value: bigint, offset?: number): number;
1007+
readBigUInt64BE?(offset?: number): bigint;
1008+
readBigUInt64LE?(offset?: number): bigint;
1009+
readBigInt64BE?(offset?: number): bigint;
1010+
readBigInt64LE?(offset?: number): bigint;
1011+
writeBigInt64BE?(value: bigint, offset?: number): number;
1012+
writeBigInt64LE?(value: bigint, offset?: number): number;
1013+
writeBigUInt64BE?(value: bigint, offset?: number): number;
1014+
writeBigUInt64LE?(value: bigint, offset?: number): number;
10151015
fill(value: string | Uint8Array | number, offset?: number, end?: number, encoding?: BufferEncoding): this;
10161016
indexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number;
10171017
lastIndexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number;

src/executeCommandLine/executeCommandLine.ts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,6 @@ namespace ts {
3333
return options.pretty;
3434
}
3535

36-
function padLeft(s: string, length: number) {
37-
while (s.length < length) {
38-
s = " " + s;
39-
}
40-
return s;
41-
}
42-
43-
function padRight(s: string, length: number) {
44-
while (s.length < length) {
45-
s = s + " ";
46-
}
47-
48-
return s;
49-
}
50-
5136
function getOptionsForHelp(commandLine: ParsedCommandLine) {
5237
// Sort our options by their names, (e.g. "--noImplicitAny" comes before "--watch")
5338
return !!commandLine.options.all ?

0 commit comments

Comments
 (0)