Skip to content

Commit a27fbff

Browse files
committed
Merge branch 'master' of https://github.com/Microsoft/TypeScript into for-ofES5
Conflicts: tests/baselines/reference/parserES5ForOfStatement18.js tests/baselines/reference/parserES5ForOfStatement21.js
2 parents 835c84f + 848bc87 commit a27fbff

File tree

3,346 files changed

+54367
-50422
lines changed

Some content is hidden

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

3,346 files changed

+54367
-50422
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Design changes will not be accepted at this time. If you have a design change pr
99
## Legal
1010
You will need to complete a Contributor License Agreement (CLA). Briefly, this agreement testifies that you are granting us permission to use the submitted change according to the terms of the project's license, and that the work being submitted is under appropriate copyright.
1111

12-
Please submit a Contributor License Agreement (CLA) before submitting a pull request. Download the agreement ([Microsoft Contribution License Agreement.docx](https://www.codeplex.com/Download?ProjectName=typescript&DownloadId=822190) or [Microsoft Contribution License Agreement.pdf](https://www.codeplex.com/Download?ProjectName=typescript&DownloadId=921298)), sign, scan, and email it back to <[email protected]>. Be sure to include your github user name along with the agreement. Once we have received the signed CLA, we'll review the request. Please note that we're currently only accepting pull requests of bug fixes rather than new features.
12+
Please submit a Contributor License Agreement (CLA) before submitting a pull request. You may visit https://cla.microsoft.com to sign digitally. Alternatively, download the agreement ([Microsoft Contribution License Agreement.docx](https://www.codeplex.com/Download?ProjectName=typescript&DownloadId=822190) or [Microsoft Contribution License Agreement.pdf](https://www.codeplex.com/Download?ProjectName=typescript&DownloadId=921298)), sign, scan, and email it back to <[email protected]>. Be sure to include your github user name along with the agreement. Once we have received the signed CLA, we'll review the request. Please note that we're currently only accepting pull requests of bug fixes rather than new features.
1313

1414
## Housekeeping
1515
Your pull request should:

bin/tsc.js

Lines changed: 1736 additions & 910 deletions
Large diffs are not rendered by default.

bin/tsserver.js

Lines changed: 2297 additions & 1152 deletions
Large diffs are not rendered by default.

bin/typescript.d.ts

Lines changed: 62 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -124,28 +124,28 @@ declare module "typescript" {
124124
WhileKeyword = 99,
125125
WithKeyword = 100,
126126
AsKeyword = 101,
127-
FromKeyword = 102,
128-
ImplementsKeyword = 103,
129-
InterfaceKeyword = 104,
130-
LetKeyword = 105,
131-
PackageKeyword = 106,
132-
PrivateKeyword = 107,
133-
ProtectedKeyword = 108,
134-
PublicKeyword = 109,
135-
StaticKeyword = 110,
136-
YieldKeyword = 111,
137-
AnyKeyword = 112,
138-
BooleanKeyword = 113,
139-
ConstructorKeyword = 114,
140-
DeclareKeyword = 115,
141-
GetKeyword = 116,
142-
ModuleKeyword = 117,
143-
RequireKeyword = 118,
144-
NumberKeyword = 119,
145-
SetKeyword = 120,
146-
StringKeyword = 121,
147-
SymbolKeyword = 122,
148-
TypeKeyword = 123,
127+
ImplementsKeyword = 102,
128+
InterfaceKeyword = 103,
129+
LetKeyword = 104,
130+
PackageKeyword = 105,
131+
PrivateKeyword = 106,
132+
ProtectedKeyword = 107,
133+
PublicKeyword = 108,
134+
StaticKeyword = 109,
135+
YieldKeyword = 110,
136+
AnyKeyword = 111,
137+
BooleanKeyword = 112,
138+
ConstructorKeyword = 113,
139+
DeclareKeyword = 114,
140+
GetKeyword = 115,
141+
ModuleKeyword = 116,
142+
RequireKeyword = 117,
143+
NumberKeyword = 118,
144+
SetKeyword = 119,
145+
StringKeyword = 120,
146+
SymbolKeyword = 121,
147+
TypeKeyword = 122,
148+
FromKeyword = 123,
149149
OfKeyword = 124,
150150
QualifiedName = 125,
151151
ComputedPropertyName = 126,
@@ -251,8 +251,8 @@ declare module "typescript" {
251251
LastReservedWord = 100,
252252
FirstKeyword = 65,
253253
LastKeyword = 124,
254-
FirstFutureReservedWord = 103,
255-
LastFutureReservedWord = 111,
254+
FirstFutureReservedWord = 102,
255+
LastFutureReservedWord = 110,
256256
FirstTypeNode = 139,
257257
LastTypeNode = 147,
258258
FirstPunctuation = 14,
@@ -276,15 +276,16 @@ declare module "typescript" {
276276
Private = 32,
277277
Protected = 64,
278278
Static = 128,
279-
MultiLine = 256,
280-
Synthetic = 512,
281-
DeclarationFile = 1024,
282-
Let = 2048,
283-
Const = 4096,
284-
OctalLiteral = 8192,
285-
Modifier = 243,
279+
Default = 256,
280+
MultiLine = 512,
281+
Synthetic = 1024,
282+
DeclarationFile = 2048,
283+
Let = 4096,
284+
Const = 8192,
285+
OctalLiteral = 16384,
286+
Modifier = 499,
286287
AccessibilityModifier = 112,
287-
BlockScoped = 6144,
288+
BlockScoped = 12288,
288289
}
289290
const enum ParserContextFlags {
290291
StrictMode = 1,
@@ -412,7 +413,7 @@ declare module "typescript" {
412413
body?: Block | Expression;
413414
}
414415
interface FunctionDeclaration extends FunctionLikeDeclaration, Statement {
415-
name: Identifier;
416+
name?: Identifier;
416417
body?: Block;
417418
}
418419
interface MethodDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement {
@@ -505,7 +506,9 @@ declare module "typescript" {
505506
}
506507
interface ConditionalExpression extends Expression {
507508
condition: Expression;
509+
questionToken: Node;
508510
whenTrue: Expression;
511+
colonToken: Node;
509512
whenFalse: Expression;
510513
}
511514
interface FunctionExpression extends PrimaryExpression, FunctionLikeDeclaration {
@@ -515,6 +518,7 @@ declare module "typescript" {
515518
interface LiteralExpression extends PrimaryExpression {
516519
text: string;
517520
isUnterminated?: boolean;
521+
hasExtendedUnicodeEscape?: boolean;
518522
}
519523
interface StringLiteralExpression extends LiteralExpression {
520524
_stringLiteralExpressionBrand: any;
@@ -541,6 +545,7 @@ declare module "typescript" {
541545
}
542546
interface PropertyAccessExpression extends MemberExpression {
543547
expression: LeftHandSideExpression;
548+
dotToken: Node;
544549
name: Identifier;
545550
}
546551
interface ElementAccessExpression extends MemberExpression {
@@ -636,16 +641,15 @@ declare module "typescript" {
636641
catchClause?: CatchClause;
637642
finallyBlock?: Block;
638643
}
639-
interface CatchClause extends Declaration {
640-
name: Identifier;
641-
type?: TypeNode;
644+
interface CatchClause extends Node {
645+
variableDeclaration: VariableDeclaration;
642646
block: Block;
643647
}
644648
interface ModuleElement extends Node {
645649
_moduleElementBrand: any;
646650
}
647651
interface ClassDeclaration extends Declaration, ModuleElement {
648-
name: Identifier;
652+
name?: Identifier;
649653
typeParameters?: NodeArray<TypeParameterDeclaration>;
650654
heritageClauses?: NodeArray<HeritageClause>;
651655
members: NodeArray<ClassElement>;
@@ -675,10 +679,7 @@ declare module "typescript" {
675679
name: Identifier;
676680
members: NodeArray<EnumMember>;
677681
}
678-
interface ExportContainer {
679-
exportStars?: ExportDeclaration[];
680-
}
681-
interface ModuleDeclaration extends Declaration, ModuleElement, ExportContainer {
682+
interface ModuleDeclaration extends Declaration, ModuleElement {
682683
name: Identifier | LiteralExpression;
683684
body: ModuleBlock | ModuleDeclaration;
684685
}
@@ -703,7 +704,7 @@ declare module "typescript" {
703704
interface NamespaceImport extends Declaration {
704705
name: Identifier;
705706
}
706-
interface ExportDeclaration extends Statement, ModuleElement {
707+
interface ExportDeclaration extends Declaration, ModuleElement {
707708
exportClause?: NamedExports;
708709
moduleSpecifier?: Expression;
709710
}
@@ -718,16 +719,17 @@ declare module "typescript" {
718719
}
719720
type ImportSpecifier = ImportOrExportSpecifier;
720721
type ExportSpecifier = ImportOrExportSpecifier;
721-
interface ExportAssignment extends Statement, ModuleElement {
722-
exportName: Identifier;
722+
interface ExportAssignment extends Declaration, ModuleElement {
723+
isExportEquals?: boolean;
724+
expression: Expression;
723725
}
724726
interface FileReference extends TextRange {
725727
fileName: string;
726728
}
727729
interface CommentRange extends TextRange {
728730
hasTrailingNewLine?: boolean;
729731
}
730-
interface SourceFile extends Declaration, ExportContainer {
732+
interface SourceFile extends Declaration {
731733
statements: NodeArray<ModuleElement>;
732734
endOfFileToken: Node;
733735
fileName: string;
@@ -832,6 +834,7 @@ declare module "typescript" {
832834
getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number;
833835
isValidPropertyAccess(node: PropertyAccessExpression | QualifiedName, propertyName: string): boolean;
834836
getAliasedSymbol(symbol: Symbol): Symbol;
837+
getExportsOfExternalModule(node: ImportDeclaration): Symbol[];
835838
}
836839
interface SymbolDisplayBuilder {
837840
buildTypeDisplay(type: Type, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void;
@@ -889,10 +892,10 @@ declare module "typescript" {
889892
errorModuleName?: string;
890893
}
891894
interface EmitResolver {
892-
getGeneratedNameForNode(node: ModuleDeclaration | EnumDeclaration | ImportDeclaration | ExportDeclaration): string;
895+
getGeneratedNameForNode(node: Node): string;
893896
getExpressionNameSubstitution(node: Identifier): string;
894-
getExportAssignmentName(node: SourceFile): string;
895-
isReferencedImportDeclaration(node: Node): boolean;
897+
hasExportDefaultValue(node: SourceFile): boolean;
898+
isReferencedAliasDeclaration(node: Node): boolean;
896899
isTopLevelValueImportEqualsWithEntityName(node: ImportEqualsDeclaration): boolean;
897900
getNodeCheckFlags(node: Node): NodeCheckFlags;
898901
isDeclarationVisible(node: Declaration): boolean;
@@ -903,6 +906,7 @@ declare module "typescript" {
903906
isEntityNameVisible(entityName: EntityName, enclosingDeclaration: Node): SymbolVisibilityResult;
904907
getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number;
905908
isUnknownIdentifier(location: Node, name: string): boolean;
909+
getBlockScopedVariableId(node: Identifier): number;
906910
}
907911
const enum SymbolFlags {
908912
FunctionScopedVariable = 1,
@@ -928,13 +932,14 @@ declare module "typescript" {
928932
ExportValue = 1048576,
929933
ExportType = 2097152,
930934
ExportNamespace = 4194304,
931-
Import = 8388608,
935+
Alias = 8388608,
932936
Instantiated = 16777216,
933937
Merged = 33554432,
934938
Transient = 67108864,
935939
Prototype = 134217728,
936940
UnionProperty = 268435456,
937941
Optional = 536870912,
942+
ExportStar = 1073741824,
938943
Enum = 384,
939944
Variable = 3,
940945
Value = 107455,
@@ -959,7 +964,7 @@ declare module "typescript" {
959964
SetAccessorExcludes = 74687,
960965
TypeParameterExcludes = 530912,
961966
TypeAliasExcludes = 793056,
962-
ImportExcludes = 8388608,
967+
AliasExcludes = 8388608,
963968
ModuleMember = 8914931,
964969
ExportHasLocal = 944,
965970
HasLocals = 255504,
@@ -988,10 +993,9 @@ declare module "typescript" {
988993
declaredType?: Type;
989994
mapper?: TypeMapper;
990995
referenced?: boolean;
991-
exportAssignmentChecked?: boolean;
992-
exportAssignmentSymbol?: Symbol;
993996
unionType?: UnionType;
994997
resolvedExports?: SymbolTable;
998+
exportsChecked?: boolean;
995999
}
9961000
interface TransientSymbol extends Symbol, SymbolLinks {
9971001
}
@@ -1007,6 +1011,7 @@ declare module "typescript" {
10071011
SuperStatic = 32,
10081012
ContextChecked = 64,
10091013
EnumValuesComputed = 128,
1014+
BlockScopedBindingInLoop = 256,
10101015
}
10111016
interface NodeLinks {
10121017
resolvedType?: Type;
@@ -1383,6 +1388,7 @@ declare module "typescript" {
13831388
getTokenPos(): number;
13841389
getTokenText(): string;
13851390
getTokenValue(): string;
1391+
hasExtendedUnicodeEscape(): boolean;
13861392
hasPrecedingLineBreak(): boolean;
13871393
isIdentifier(): boolean;
13881394
isReservedWord(): boolean;
@@ -1479,9 +1485,6 @@ declare module "typescript" {
14791485
getDocumentationComment(): SymbolDisplayPart[];
14801486
}
14811487
interface SourceFile {
1482-
version: string;
1483-
scriptSnapshot: IScriptSnapshot;
1484-
nameTable: Map<string>;
14851488
getNamedDeclarations(): Declaration[];
14861489
getLineAndCharacterOfPosition(pos: number): LineAndCharacter;
14871490
getLineStarts(): number[];
@@ -1835,25 +1838,17 @@ declare module "typescript" {
18351838
acquireDocument(fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string): SourceFile;
18361839
/**
18371840
* Request an updated version of an already existing SourceFile with a given fileName
1838-
* and compilationSettings. The update will intern call updateLanguageServiceSourceFile
1841+
* and compilationSettings. The update will in-turn call updateLanguageServiceSourceFile
18391842
* to get an updated SourceFile.
18401843
*
1841-
* Note: It is not allowed to call update on a SourceFile that was not acquired from this
1842-
* registry originally.
1843-
*
1844-
* @param sourceFile The original sourceFile object to update
18451844
* @param fileName The name of the file requested
18461845
* @param compilationSettings Some compilation settings like target affects the
18471846
* shape of a the resulting SourceFile. This allows the DocumentRegistry to store
18481847
* multiple copies of the same file for different compilation settings.
1849-
* @parm scriptSnapshot Text of the file. Only used if the file was not found
1850-
* in the registry and a new one was created.
1851-
* @parm version Current version of the file. Only used if the file was not found
1852-
* in the registry and a new one was created.
1853-
* @parm textChangeRange Change ranges since the last snapshot. Only used if the file
1854-
* was not found in the registry and a new one was created.
1848+
* @param scriptSnapshot Text of the file.
1849+
* @param version Current version of the file.
18551850
*/
1856-
updateDocument(sourceFile: SourceFile, fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string, textChangeRange: TextChangeRange): SourceFile;
1851+
updateDocument(fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string): SourceFile;
18571852
/**
18581853
* Informs the DocumentRegistry that a file is not needed any longer.
18591854
*

0 commit comments

Comments
 (0)