Skip to content

Commit f75c1dd

Browse files
committed
Merge branch 'master' into exportDefaultReference
Conflicts: src/compiler/utilities.ts
2 parents 0c5d736 + 0afa459 commit f75c1dd

File tree

208 files changed

+9935
-1330
lines changed

Some content is hidden

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

208 files changed

+9935
-1330
lines changed

Jakefile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ var definitionsRoots = [
111111
"compiler/parser.d.ts",
112112
"compiler/checker.d.ts",
113113
"compiler/program.d.ts",
114+
"compiler/commandLineParser.d.ts",
114115
"services/services.d.ts",
115116
];
116117

@@ -222,15 +223,17 @@ function compileFile(outFile, sources, prereqs, prefixes, useBuiltCompiler, noOu
222223
var dir = useBuiltCompiler ? builtLocalDirectory : LKGDirectory;
223224
var options = "--module commonjs -noImplicitAny";
224225

225-
if (!keepComments) {
226-
options += " -removeComments";
226+
// Keep comments when specifically requested
227+
// or when in debug mode.
228+
if (!(keepComments || useDebugMode)) {
229+
options += " --removeComments";
227230
}
228231

229232
if (generateDeclarations) {
230233
options += " --declaration";
231234
}
232235

233-
if (useDebugMode || preserveConstEnums) {
236+
if (preserveConstEnums || useDebugMode) {
234237
options += " --preserveConstEnums";
235238
}
236239

src/compiler/binder.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ module ts {
168168
addDeclarationToSymbol(symbol, node, includes);
169169
symbol.parent = parent;
170170

171-
if (node.kind === SyntaxKind.ClassDeclaration && symbol.exports) {
171+
if ((node.kind === SyntaxKind.ClassDeclaration || node.kind === SyntaxKind.ClassExpression) && symbol.exports) {
172172
// TypeScript 1.0 spec (April 2014): 8.4
173173
// Every class automatically contains a static property member named 'prototype',
174174
// the type of which is an instantiation of the class type with type Any supplied as a type argument for each type parameter.
@@ -286,6 +286,7 @@ module ts {
286286
case SyntaxKind.ArrowFunction:
287287
declareSymbol(container.locals, undefined, node, symbolKind, symbolExcludes);
288288
break;
289+
case SyntaxKind.ClassExpression:
289290
case SyntaxKind.ClassDeclaration:
290291
if (node.flags & NodeFlags.Static) {
291292
declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes);
@@ -485,6 +486,9 @@ module ts {
485486
case SyntaxKind.ArrowFunction:
486487
bindAnonymousDeclaration(<FunctionExpression>node, SymbolFlags.Function, "__function", /*isBlockScopeContainer*/ true);
487488
break;
489+
case SyntaxKind.ClassExpression:
490+
bindAnonymousDeclaration(<ClassExpression>node, SymbolFlags.Class, "__class", /*isBlockScopeContainer*/ false);
491+
break;
488492
case SyntaxKind.CatchClause:
489493
bindCatchVariableDeclaration(<CatchClause>node);
490494
break;
@@ -584,9 +588,9 @@ module ts {
584588
// containing class.
585589
if (node.flags & NodeFlags.AccessibilityModifier &&
586590
node.parent.kind === SyntaxKind.Constructor &&
587-
node.parent.parent.kind === SyntaxKind.ClassDeclaration) {
591+
(node.parent.parent.kind === SyntaxKind.ClassDeclaration || node.parent.parent.kind === SyntaxKind.ClassExpression)) {
588592

589-
let classDeclaration = <ClassDeclaration>node.parent.parent;
593+
let classDeclaration = <ClassLikeDeclaration>node.parent.parent;
590594
declareSymbol(classDeclaration.symbol.members, classDeclaration.symbol, node, SymbolFlags.Property, SymbolFlags.PropertyExcludes);
591595
}
592596
}

src/compiler/checker.ts

Lines changed: 224 additions & 129 deletions
Large diffs are not rendered by default.

src/compiler/commandLineParser.ts

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,12 @@
44
/// <reference path="scanner.ts"/>
55

66
module ts {
7+
/* @internal */
78
export var optionDeclarations: CommandLineOption[] = [
89
{
910
name: "charset",
1011
type: "string",
1112
},
12-
{
13-
name: "codepage",
14-
type: "number",
15-
},
1613
{
1714
name: "declaration",
1815
shortName: "d",
@@ -78,10 +75,6 @@ module ts {
7875
name: "noLib",
7976
type: "boolean",
8077
},
81-
{
82-
name: "noLibCheck",
83-
type: "boolean",
84-
},
8578
{
8679
name: "noResolve",
8780
type: "boolean",
@@ -117,6 +110,10 @@ module ts {
117110
type: "boolean",
118111
description: Diagnostics.Do_not_emit_comments_to_output,
119112
},
113+
{
114+
name: "separateCompilation",
115+
type: "boolean",
116+
},
120117
{
121118
name: "sourceMap",
122119
type: "boolean",
@@ -161,7 +158,8 @@ module ts {
161158
description: Diagnostics.Watch_input_files,
162159
}
163160
];
164-
161+
162+
/* @internal */
165163
export function parseCommandLine(commandLine: string[]): ParsedCommandLine {
166164
var options: CompilerOptions = {};
167165
var fileNames: string[] = [];
@@ -271,6 +269,10 @@ module ts {
271269
}
272270
}
273271

272+
/**
273+
* Read tsconfig.json file
274+
* @param fileName The path to the config file
275+
*/
274276
export function readConfigFile(fileName: string): any {
275277
try {
276278
var text = sys.readFile(fileName);
@@ -280,6 +282,12 @@ module ts {
280282
}
281283
}
282284

285+
/**
286+
* Parse the contents of a config file (tsconfig.json).
287+
* @param json The contents of the config file to parse
288+
* @param basePath A root directory to resolve relative path entries in the config
289+
* file to. e.g. outDir
290+
*/
283291
export function parseConfigFile(json: any, basePath?: string): ParsedCommandLine {
284292
var errors: Diagnostic[] = [];
285293

0 commit comments

Comments
 (0)