Skip to content

Commit bc8ac66

Browse files
committed
Merge remote-tracking branch 'origin/release-1.8' into FixCommonJSModules
2 parents fa6db1b + 13e845a commit bc8ac66

56 files changed

Lines changed: 341 additions & 292 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

lib/tsc.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19667,6 +19667,7 @@ var ts;
1966719667
checkGrammarForGenerator(node);
1966819668
}
1966919669
if (contextualMapper === identityMapper && isContextSensitive(node)) {
19670+
checkNodeDeferred(node);
1967019671
return anyFunctionType;
1967119672
}
1967219673
var links = getNodeLinks(node);
@@ -32465,7 +32466,7 @@ var ts;
3246532466
ts.ioReadTime = 0;
3246632467
ts.ioWriteTime = 0;
3246732468
var emptyArray = [];
32468-
ts.version = "1.8.2";
32469+
ts.version = "1.8.5";
3246932470
function findConfigFile(searchPath, fileExists) {
3247032471
var fileName = "tsconfig.json";
3247132472
while (true) {

lib/tsserver.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20235,6 +20235,7 @@ var ts;
2023520235
checkGrammarForGenerator(node);
2023620236
}
2023720237
if (contextualMapper === identityMapper && isContextSensitive(node)) {
20238+
checkNodeDeferred(node);
2023820239
return anyFunctionType;
2023920240
}
2024020241
var links = getNodeLinks(node);
@@ -33033,7 +33034,7 @@ var ts;
3303333034
ts.ioReadTime = 0;
3303433035
ts.ioWriteTime = 0;
3303533036
var emptyArray = [];
33036-
ts.version = "1.8.2";
33037+
ts.version = "1.8.5";
3303733038
function findConfigFile(searchPath, fileExists) {
3303833039
var fileName = "tsconfig.json";
3303933040
while (true) {

lib/typescript.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24302,6 +24302,7 @@ var ts;
2430224302
}
2430324303
// The identityMapper object is used to indicate that function expressions are wildcards
2430424304
if (contextualMapper === identityMapper && isContextSensitive(node)) {
24305+
checkNodeDeferred(node);
2430524306
return anyFunctionType;
2430624307
}
2430724308
var links = getNodeLinks(node);
@@ -39260,7 +39261,7 @@ var ts;
3926039261
/* @internal */ ts.ioWriteTime = 0;
3926139262
/** The version of the TypeScript compiler release */
3926239263
var emptyArray = [];
39263-
ts.version = "1.8.2";
39264+
ts.version = "1.8.5";
3926439265
function findConfigFile(searchPath, fileExists) {
3926539266
var fileName = "tsconfig.json";
3926639267
while (true) {

lib/typescriptServices.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24302,6 +24302,7 @@ var ts;
2430224302
}
2430324303
// The identityMapper object is used to indicate that function expressions are wildcards
2430424304
if (contextualMapper === identityMapper && isContextSensitive(node)) {
24305+
checkNodeDeferred(node);
2430524306
return anyFunctionType;
2430624307
}
2430724308
var links = getNodeLinks(node);
@@ -39260,7 +39261,7 @@ var ts;
3926039261
/* @internal */ ts.ioWriteTime = 0;
3926139262
/** The version of the TypeScript compiler release */
3926239263
var emptyArray = [];
39263-
ts.version = "1.8.2";
39264+
ts.version = "1.8.5";
3926439265
function findConfigFile(searchPath, fileExists) {
3926539266
var fileName = "tsconfig.json";
3926639267
while (true) {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "typescript",
33
"author": "Microsoft Corp.",
44
"homepage": "http://typescriptlang.org/",
5-
"version": "1.8.2",
5+
"version": "1.8.5",
66
"license": "Apache-2.0",
77
"description": "TypeScript is a language for application scale JavaScript development",
88
"keywords": [

src/compiler/binder.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,7 @@ namespace ts {
750750
case SyntaxKind.GetAccessor:
751751
case SyntaxKind.SetAccessor:
752752
case SyntaxKind.FunctionType:
753+
case SyntaxKind.JSDocFunctionType:
753754
case SyntaxKind.ConstructorType:
754755
case SyntaxKind.FunctionExpression:
755756
case SyntaxKind.ArrowFunction:
@@ -1466,7 +1467,8 @@ namespace ts {
14661467
}
14671468

14681469
// Declare the method/property
1469-
declareSymbol(funcSymbol.members, funcSymbol, leftSideOfAssignment, SymbolFlags.Property, SymbolFlags.PropertyExcludes);
1470+
// It's acceptable for multiple prototype property assignments of the same identifier to occur
1471+
declareSymbol(funcSymbol.members, funcSymbol, leftSideOfAssignment, SymbolFlags.Property, SymbolFlags.PropertyExcludes & ~SymbolFlags.Property);
14701472
}
14711473

14721474
function bindCallExpression(node: CallExpression) {

src/compiler/checker.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5253,7 +5253,7 @@ namespace ts {
52535253
for (let i = 0; i < checkCount; i++) {
52545254
const s = i < sourceMax ? getTypeOfSymbol(sourceParams[i]) : getRestTypeOfSignature(source);
52555255
const t = i < targetMax ? getTypeOfSymbol(targetParams[i]) : getRestTypeOfSignature(target);
5256-
const related = compareTypes(t, s, /*reportErrors*/ false) || compareTypes(s, t, reportErrors);
5256+
const related = compareTypes(s, t, /*reportErrors*/ false) || compareTypes(t, s, reportErrors);
52575257
if (!related) {
52585258
if (reportErrors) {
52595259
errorReporter(Diagnostics.Types_of_parameters_0_and_1_are_incompatible,
@@ -6455,8 +6455,10 @@ namespace ts {
64556455
function inferTypes(context: InferenceContext, source: Type, target: Type) {
64566456
let sourceStack: Type[];
64576457
let targetStack: Type[];
6458+
const maxDepth = 5;
64586459
let depth = 0;
64596460
let inferiority = 0;
6461+
const visited: Map<boolean> = {};
64606462
inferFromTypes(source, target);
64616463

64626464
function isInProcess(source: Type, target: Type) {
@@ -6582,10 +6584,21 @@ namespace ts {
65826584
if (isInProcess(source, target)) {
65836585
return;
65846586
}
6587+
// we delibirately limit the depth we examine to infer types: this speeds up the overall inference process
6588+
// and user rarely expects inferences to be made from the deeply nested constituents.
6589+
if (depth > maxDepth) {
6590+
return;
6591+
}
65856592
if (isDeeplyNestedGeneric(source, sourceStack, depth) && isDeeplyNestedGeneric(target, targetStack, depth)) {
65866593
return;
65876594
}
65886595

6596+
const key = source.id + "," + target.id;
6597+
if (hasProperty(visited, key)) {
6598+
return;
6599+
}
6600+
visited[key] = true;
6601+
65896602
if (depth === 0) {
65906603
sourceStack = [];
65916604
targetStack = [];

src/compiler/program.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ namespace ts {
1212

1313
const emptyArray: any[] = [];
1414

15-
export const version = "1.8.2";
15+
export const version = "1.8.5";
1616

1717
export function findConfigFile(searchPath: string, fileExists: (fileName: string) => boolean): string {
1818
let fileName = "tsconfig.json";

src/compiler/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ namespace ts {
430430
JavaScriptFile = 1 << 5,
431431

432432
// Context flags set directly by the parser.
433-
ParserGeneratedFlags = DisallowIn | Yield | Decorator | ThisNodeHasError | Await,
433+
ParserGeneratedFlags = DisallowIn | Yield | Decorator | ThisNodeHasError | Await | JavaScriptFile,
434434

435435
// Exclude these flags when parsing a Type
436436
TypeExcludesFlags = Yield | Await,

src/harness/harness.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,10 @@ namespace Utils {
285285
// data we don't care about in the dump. We only care what the parser set directly
286286
// on the ast.
287287
let value = n.parserContextFlags & ts.ParserContextFlags.ParserGeneratedFlags;
288+
289+
// Remove the JavaScriptFile flag, as this is just noise for JSDocParser and Test262 tests
290+
// (which are the only tests that use this function).
291+
value = value & ~ts.ParserContextFlags.JavaScriptFile;
288292
if (value) {
289293
o[propertyName] = getParserContextFlagName(value);
290294
}

0 commit comments

Comments
 (0)