Merge branch 'master' into optimizeTypeRelations

This commit is contained in:
Anders Hejlsberg
2017-06-20 16:03:07 -10:00
13 changed files with 111 additions and 4 deletions
+1 -1
View File
@@ -1053,7 +1053,7 @@ namespace ts {
errors.push(createDiagnosticForNodeInSourceFile(sourceFile, element.name, extraKeyDiagnosticMessage, keyText));
}
const value = convertPropertyValueToJson(element.initializer, option);
if (typeof keyText !== undefined && typeof value !== undefined) {
if (typeof keyText !== "undefined" && typeof value !== "undefined") {
result[keyText] = value;
// Notify key value set, if user asked for it
if (jsonConversionNotifier &&
+2 -2
View File
@@ -955,7 +955,7 @@ namespace ts {
* @param map A map-like.
* @param key A property key.
*/
export function hasProperty<T>(map: MapLike<T>, key: string): boolean {
export function hasProperty(map: MapLike<any>, key: string): boolean {
return hasOwnProperty.call(map, key);
}
@@ -2344,7 +2344,7 @@ namespace ts {
export function fail(message?: string, stackCrawlMark?: Function): void {
debugger;
const e = new Error(message ? `Debug Failure. ` : "Debug Failure.");
const e = new Error(message ? `Debug Failure. ${message}` : "Debug Failure.");
if ((<any>Error).captureStackTrace) {
(<any>Error).captureStackTrace(e, stackCrawlMark || fail);
}
+1 -1
View File
@@ -3733,7 +3733,7 @@ namespace ts {
// 3)we have a MemberExpression which either completes the LeftHandSideExpression,
// or starts the beginning of the first four CallExpression productions.
let expression: MemberExpression;
if (token() === SyntaxKind.ImportKeyword) {
if (token() === SyntaxKind.ImportKeyword && lookAhead(nextTokenIsOpenParenOrLessThan)) {
// We don't want to eagerly consume all import keyword as import call expression so we look a head to find "("
// For example:
// var foo3 = require("subfolder
+4
View File
@@ -803,6 +803,10 @@ namespace ts {
// moduleAugmentations has changed
oldProgram.structureIsReused = StructureIsReused.SafeModules;
}
if ((oldSourceFile.flags & NodeFlags.PossiblyContainsDynamicImport) !== (newSourceFile.flags & NodeFlags.PossiblyContainsDynamicImport)) {
// dynamicImport has changed
oldProgram.structureIsReused = StructureIsReused.SafeModules;
}
if (!arrayIsEqualTo(oldSourceFile.typeReferenceDirectives, newSourceFile.typeReferenceDirectives, fileReferenceIsEqualTo)) {
// 'types' references has changed