Skip to content

Commit 49c8e83

Browse files
author
Yui T
committed
Merge branch 'master' into fixParsingShorthand
2 parents c0c6f61 + 80abd1e commit 49c8e83

35 files changed

+20882
-32630
lines changed

bin/lib.core.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,10 @@ declare var Number: {
499499
POSITIVE_INFINITY: number;
500500
}
501501

502+
interface TemplateStringsArray extends Array<string> {
503+
raw: string[];
504+
}
505+
502506
interface Math {
503507
/** The mathematical constant e. This is Euler's number, the base of natural logarithms. */
504508
E: number;

bin/lib.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,10 @@ declare var Number: {
499499
POSITIVE_INFINITY: number;
500500
}
501501

502+
interface TemplateStringsArray extends Array<string> {
503+
raw: string[];
504+
}
505+
502506
interface Math {
503507
/** The mathematical constant e. This is Euler's number, the base of natural logarithms. */
504508
E: number;

bin/tsc.js

Lines changed: 3343 additions & 3044 deletions
Large diffs are not rendered by default.

bin/typescriptServices.js

Lines changed: 17141 additions & 29281 deletions
Large diffs are not rendered by default.

src/compiler/checker.ts

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -75,43 +75,43 @@ module ts {
7575

7676
var checker: TypeChecker = {
7777
getProgram: () => program,
78-
getDiagnostics: getDiagnostics,
79-
getGlobalDiagnostics: getGlobalDiagnostics,
8078
getNodeCount: () => sum(program.getSourceFiles(), "nodeCount"),
8179
getIdentifierCount: () => sum(program.getSourceFiles(), "identifierCount"),
8280
getSymbolCount: () => sum(program.getSourceFiles(), "symbolCount"),
8381
getTypeCount: () => typeCount,
84-
checkProgram: checkProgram,
85-
emitFiles: invokeEmitter,
86-
getParentOfSymbol: getParentOfSymbol,
87-
getNarrowedTypeOfSymbol: getNarrowedTypeOfSymbol,
88-
getDeclaredTypeOfSymbol: getDeclaredTypeOfSymbol,
89-
getPropertiesOfType: getPropertiesOfType,
90-
getPropertyOfType: getPropertyOfType,
91-
getSignaturesOfType: getSignaturesOfType,
92-
getIndexTypeOfType: getIndexTypeOfType,
93-
getReturnTypeOfSignature: getReturnTypeOfSignature,
94-
getSymbolsInScope: getSymbolsInScope,
95-
getSymbolInfo: getSymbolInfo,
96-
getShorthandAssignmentValueSymbol: getShorthandAssignmentValueSymbol,
97-
getTypeOfNode: getTypeOfNode,
98-
typeToString: typeToString,
99-
getSymbolDisplayBuilder: getSymbolDisplayBuilder,
100-
symbolToString: symbolToString,
101-
getAugmentedPropertiesOfType: getAugmentedPropertiesOfType,
102-
getRootSymbols: getRootSymbols,
103-
getContextualType: getContextualType,
104-
getFullyQualifiedName: getFullyQualifiedName,
105-
getResolvedSignature: getResolvedSignature,
106-
getEnumMemberValue: getEnumMemberValue,
107-
isValidPropertyAccess: isValidPropertyAccess,
108-
getSignatureFromDeclaration: getSignatureFromDeclaration,
109-
isImplementationOfOverload: isImplementationOfOverload,
110-
getAliasedSymbol: resolveImport,
11182
isUndefinedSymbol: symbol => symbol === undefinedSymbol,
11283
isArgumentsSymbol: symbol => symbol === argumentsSymbol,
113-
hasEarlyErrors: hasEarlyErrors,
114-
isEmitBlocked: isEmitBlocked
84+
getDiagnostics,
85+
getGlobalDiagnostics,
86+
checkProgram,
87+
invokeEmitter,
88+
getParentOfSymbol,
89+
getNarrowedTypeOfSymbol,
90+
getDeclaredTypeOfSymbol,
91+
getPropertiesOfType,
92+
getPropertyOfType,
93+
getSignaturesOfType,
94+
getIndexTypeOfType,
95+
getReturnTypeOfSignature,
96+
getSymbolsInScope,
97+
getSymbolInfo,
98+
getShorthandAssignmentValueSymbol,
99+
getTypeOfNode,
100+
typeToString,
101+
getSymbolDisplayBuilder,
102+
symbolToString,
103+
getAugmentedPropertiesOfType,
104+
getRootSymbols,
105+
getContextualType,
106+
getFullyQualifiedName,
107+
getResolvedSignature,
108+
getEnumMemberValue,
109+
isValidPropertyAccess,
110+
getSignatureFromDeclaration,
111+
isImplementationOfOverload,
112+
getAliasedSymbol: resolveImport,
113+
hasEarlyErrors,
114+
isEmitBlocked,
115115
};
116116

117117
var undefinedSymbol = createSymbol(SymbolFlags.Property | SymbolFlags.Transient, "undefined");
@@ -953,7 +953,7 @@ module ts {
953953
if (forEach(symbol.declarations, declaration => !getIsDeclarationVisible(declaration))) {
954954
return undefined;
955955
}
956-
return { aliasesToMakeVisible: aliasesToMakeVisible };
956+
return { aliasesToMakeVisible };
957957

958958
function getIsDeclarationVisible(declaration: Declaration) {
959959
if (!isDeclarationVisible(declaration)) {
@@ -9118,22 +9118,22 @@ module ts {
91189118
function invokeEmitter(targetSourceFile?: SourceFile) {
91199119
var resolver: EmitResolver = {
91209120
getProgram: () => program,
9121-
getLocalNameOfContainer: getLocalNameOfContainer,
9122-
getExpressionNamePrefix: getExpressionNamePrefix,
9123-
getExportAssignmentName: getExportAssignmentName,
9124-
isReferencedImportDeclaration: isReferencedImportDeclaration,
9125-
getNodeCheckFlags: getNodeCheckFlags,
9126-
getEnumMemberValue: getEnumMemberValue,
9127-
isTopLevelValueImportWithEntityName: isTopLevelValueImportWithEntityName,
9128-
hasSemanticErrors: hasSemanticErrors,
9129-
isEmitBlocked: isEmitBlocked,
9130-
isDeclarationVisible: isDeclarationVisible,
9131-
isImplementationOfOverload: isImplementationOfOverload,
9132-
writeTypeAtLocation: writeTypeAtLocation,
9133-
writeReturnTypeOfSignatureDeclaration: writeReturnTypeOfSignatureDeclaration,
9134-
isSymbolAccessible: isSymbolAccessible,
9135-
isImportDeclarationEntityNameReferenceDeclarationVisibile: isImportDeclarationEntityNameReferenceDeclarationVisibile,
9136-
getConstantValue: getConstantValue,
9121+
getLocalNameOfContainer,
9122+
getExpressionNamePrefix,
9123+
getExportAssignmentName,
9124+
isReferencedImportDeclaration,
9125+
getNodeCheckFlags,
9126+
getEnumMemberValue,
9127+
isTopLevelValueImportWithEntityName,
9128+
hasSemanticErrors,
9129+
isEmitBlocked,
9130+
isDeclarationVisible,
9131+
isImplementationOfOverload,
9132+
writeTypeAtLocation,
9133+
writeReturnTypeOfSignatureDeclaration,
9134+
isSymbolAccessible,
9135+
isImportDeclarationEntityNameReferenceDeclarationVisibile,
9136+
getConstantValue,
91379137
};
91389138
checkProgram();
91399139
return emitFiles(resolver, targetSourceFile);

src/compiler/commandLineParser.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,9 @@ module ts {
153153

154154
parseStrings(commandLine);
155155
return {
156-
options: options,
157-
filenames: filenames,
158-
errors: errors
156+
options,
157+
filenames,
158+
errors
159159
};
160160

161161
function parseStrings(args: string[]) {

src/compiler/core.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -258,9 +258,9 @@ module ts {
258258
}
259259

260260
return {
261-
file: file,
262-
start: start,
263-
length: length,
261+
file,
262+
start,
263+
length,
264264

265265
messageText: text,
266266
category: message.category,
@@ -335,12 +335,12 @@ module ts {
335335
}
336336

337337
return {
338-
file: file,
339-
start: start,
340-
length: length,
341-
code: code,
342-
category: category,
343-
messageText: messageText
338+
file,
339+
start,
340+
length,
341+
code,
342+
category,
343+
messageText
344344
};
345345
}
346346

src/compiler/diagnosticInformationMap.generated.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ module ts {
273273
Type_argument_candidate_1_is_not_a_valid_type_argument_because_it_is_not_a_supertype_of_candidate_0: { code: 2455, category: DiagnosticCategory.Error, key: "Type argument candidate '{1}' is not a valid type argument because it is not a supertype of candidate '{0}'." },
274274
Type_alias_0_circularly_references_itself: { code: 2456, category: DiagnosticCategory.Error, key: "Type alias '{0}' circularly references itself." },
275275
Type_alias_name_cannot_be_0: { code: 2457, category: DiagnosticCategory.Error, key: "Type alias name cannot be '{0}'" },
276+
An_AMD_module_cannot_have_multiple_name_assignments: { code: 2458, category: DiagnosticCategory.Error, key: "An AMD module cannot have multiple name assignments." },
276277
Import_declaration_0_is_using_private_name_1: { code: 4000, category: DiagnosticCategory.Error, key: "Import declaration '{0}' is using private name '{1}'." },
277278
Type_parameter_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4001, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of exported class has or is using name '{1}' from private module '{2}'." },
278279
Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: { code: 4002, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of exported class has or is using private name '{1}'." },

src/compiler/diagnosticMessages.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1089,6 +1089,10 @@
10891089
"category": "Error",
10901090
"code": 2457
10911091
},
1092+
"An AMD module cannot have multiple name assignments.": {
1093+
"category": "Error",
1094+
"code": 2458
1095+
},
10921096

10931097
"Import declaration '{0}' is using private name '{1}'.": {
10941098
"category": "Error",

src/compiler/emitter.ts

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,9 @@ module ts {
104104
}
105105
});
106106
return {
107-
firstAccessor: firstAccessor,
108-
getAccessor: getAccessor,
109-
setAccessor: setAccessor
107+
firstAccessor,
108+
getAccessor,
109+
setAccessor
110110
};
111111
}
112112

@@ -2134,7 +2134,11 @@ module ts {
21342134
function emitAMDModule(node: SourceFile, startIndex: number) {
21352135
var imports = getExternalImportDeclarations(node);
21362136
writeLine();
2137-
write("define([\"require\", \"exports\"");
2137+
write("define(");
2138+
if(node.amdModuleName) {
2139+
write("\"" + node.amdModuleName + "\", ");
2140+
}
2141+
write("[\"require\", \"exports\"");
21382142
forEach(imports, imp => {
21392143
write(", ");
21402144
emitLiteral(imp.externalModuleName);
@@ -2783,7 +2787,7 @@ module ts {
27832787
Diagnostics.Exported_type_alias_0_has_or_is_using_name_1_from_private_module_2 :
27842788
Diagnostics.Exported_type_alias_0_has_or_is_using_private_name_1;
27852789
return {
2786-
diagnosticMessage: diagnosticMessage,
2790+
diagnosticMessage,
27872791
errorNode: node,
27882792
typeName: node.name
27892793
};
@@ -2880,7 +2884,7 @@ module ts {
28802884
}
28812885

28822886
return {
2883-
diagnosticMessage: diagnosticMessage,
2887+
diagnosticMessage,
28842888
errorNode: node,
28852889
typeName: node.name
28862890
};
@@ -2945,7 +2949,7 @@ module ts {
29452949
}
29462950

29472951
return {
2948-
diagnosticMessage: diagnosticMessage,
2952+
diagnosticMessage,
29492953
errorNode: node,
29502954
typeName: (<Declaration>node.parent).name
29512955
};
@@ -3127,7 +3131,7 @@ module ts {
31273131
Diagnostics.Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_private_name_1;
31283132
}
31293133
return {
3130-
diagnosticMessage: diagnosticMessage,
3134+
diagnosticMessage,
31313135
errorNode: <Node>node.parameters[0],
31323136
// TODO(jfreeman): Investigate why we are passing node.name instead of node.parameters[0].name
31333137
typeName: node.name
@@ -3149,7 +3153,7 @@ module ts {
31493153
Diagnostics.Return_type_of_public_property_getter_from_exported_class_has_or_is_using_private_name_0;
31503154
}
31513155
return {
3152-
diagnosticMessage: diagnosticMessage,
3156+
diagnosticMessage,
31533157
errorNode: <Node>node.name,
31543158
typeName: undefined
31553159
};
@@ -3279,7 +3283,7 @@ module ts {
32793283
}
32803284

32813285
return {
3282-
diagnosticMessage: diagnosticMessage,
3286+
diagnosticMessage,
32833287
errorNode: <Node>node.name || node,
32843288
};
32853289
}
@@ -3364,7 +3368,7 @@ module ts {
33643368
}
33653369

33663370
return {
3367-
diagnosticMessage: diagnosticMessage,
3371+
diagnosticMessage,
33683372
errorNode: node,
33693373
typeName: node.name
33703374
};
@@ -3549,22 +3553,22 @@ module ts {
35493553
var hasEmitterError = forEach(diagnostics, diagnostic => diagnostic.category === DiagnosticCategory.Error);
35503554

35513555
// Check and update returnCode for syntactic and semantic
3552-
var returnCode: EmitReturnStatus;
3556+
var emitResultStatus: EmitReturnStatus;
35533557
if (isEmitBlocked) {
3554-
returnCode = EmitReturnStatus.AllOutputGenerationSkipped;
3558+
emitResultStatus = EmitReturnStatus.AllOutputGenerationSkipped;
35553559
} else if (hasEmitterError) {
3556-
returnCode = EmitReturnStatus.EmitErrorsEncountered;
3560+
emitResultStatus = EmitReturnStatus.EmitErrorsEncountered;
35573561
} else if (hasSemanticErrors && compilerOptions.declaration) {
3558-
returnCode = EmitReturnStatus.DeclarationGenerationSkipped;
3562+
emitResultStatus = EmitReturnStatus.DeclarationGenerationSkipped;
35593563
} else if (hasSemanticErrors && !compilerOptions.declaration) {
3560-
returnCode = EmitReturnStatus.JSGeneratedWithSemanticErrors;
3564+
emitResultStatus = EmitReturnStatus.JSGeneratedWithSemanticErrors;
35613565
} else {
3562-
returnCode = EmitReturnStatus.Succeeded;
3566+
emitResultStatus = EmitReturnStatus.Succeeded;
35633567
}
35643568

35653569
return {
3566-
emitResultStatus: returnCode,
3567-
errors: diagnostics,
3570+
emitResultStatus,
3571+
diagnostics,
35683572
sourceMaps: sourceMapDataList
35693573
};
35703574
}

0 commit comments

Comments
 (0)