Skip to content

Commit 5b9bd82

Browse files
author
Andy Hanson
committed
Merge branch 'master' into resolve_entity_name
2 parents 7908257 + fa991b5 commit 5b9bd82

File tree

246 files changed

+6044
-28291
lines changed

Some content is hidden

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

246 files changed

+6044
-28291
lines changed

.travis.yml

Lines changed: 21 additions & 7 deletions
Original file line numberOriginal file lineDiff line numberDiff line change
@@ -7,19 +7,33 @@ node_js:
7

7

8
sudo: false
8
sudo: false
9

9

10-
os:
10+
env:
11-
- linux
11+
- workerCount=3
12-
- osx
13

12

14
matrix:
13
matrix:
15
fast_finish: true
14
fast_finish: true
16-
exclude:
15+
include:
17
- os: osx
16
- os: osx
18-
node_js: '4'
17+
node_js: stable
18+
osx_image: xcode7.3
19+
env: workerCount=2
20+
allow_failures:
19
- os: osx
21
- os: osx
20-
node_js: '0.10'
21

22

22
branches:
23
branches:
23
only:
24
only:
24
- master
25
- master
25-
- transforms
26+
- transforms
27+
28+
install:
29+
- npm uninstall typescript
30+
- npm uninstall tslint
31+
- npm install
32+
- npm update
33+
34+
cache:
35+
directories:
36+
- node_modules
37+
38+
git:
39+
depth: 1

Gulpfile.ts

Lines changed: 3 additions & 2 deletions
Original file line numberOriginal file lineDiff line numberDiff line change
@@ -449,7 +449,7 @@ gulp.task(tsserverLibraryFile, false, [servicesFile], (done) => {
449
});
449
});
450

450

451
gulp.task("lssl", "Builds language service server library", [tsserverLibraryFile]);
451
gulp.task("lssl", "Builds language service server library", [tsserverLibraryFile]);
452-
gulp.task("local", "Builds the full compiler and services", [builtLocalCompiler, servicesFile, serverFile, builtGeneratedDiagnosticMessagesJSON]);
452+
gulp.task("local", "Builds the full compiler and services", [builtLocalCompiler, servicesFile, serverFile, builtGeneratedDiagnosticMessagesJSON, tsserverLibraryFile]);
453
gulp.task("tsc", "Builds only the compiler", [builtLocalCompiler]);
453
gulp.task("tsc", "Builds only the compiler", [builtLocalCompiler]);
454

454

455

455

@@ -503,7 +503,7 @@ gulp.task("VerifyLKG", false, [], () => {
503
return gulp.src(expectedFiles).pipe(gulp.dest(LKGDirectory));
503
return gulp.src(expectedFiles).pipe(gulp.dest(LKGDirectory));
504
});
504
});
505

505

506-
gulp.task("LKGInternal", false, ["lib", "local", "lssl"]);
506+
gulp.task("LKGInternal", false, ["lib", "local"]);
507

507

508
gulp.task("LKG", "Makes a new LKG out of the built js files", ["clean", "dontUseDebugMode"], () => {
508
gulp.task("LKG", "Makes a new LKG out of the built js files", ["clean", "dontUseDebugMode"], () => {
509
return runSequence("LKGInternal", "VerifyLKG");
509
return runSequence("LKGInternal", "VerifyLKG");
@@ -956,6 +956,7 @@ const lintTargets = [
956
"src/server/**/*.ts",
956
"src/server/**/*.ts",
957
"scripts/tslint/**/*.ts",
957
"scripts/tslint/**/*.ts",
958
"src/services/**/*.ts",
958
"src/services/**/*.ts",
959+
"tests/*.ts", "tests/webhost/*.ts" // Note: does *not* descend recursively
959
];
960
];
960

961

961

962

Jakefile.js

Lines changed: 5 additions & 4 deletions
Original file line numberOriginal file lineDiff line numberDiff line change
@@ -551,7 +551,7 @@ var tsserverLibraryDefinitionFile = path.join(builtLocalDirectory, "tsserverlibr
551
compileFile(
551
compileFile(
552
tsserverLibraryFile,
552
tsserverLibraryFile,
553
languageServiceLibrarySources,
553
languageServiceLibrarySources,
554-
[builtLocalDirectory, copyright].concat(languageServiceLibrarySources),
554+
[builtLocalDirectory, copyright, builtLocalCompiler].concat(languageServiceLibrarySources).concat(libraryTargets),
555
/*prefixes*/ [copyright],
555
/*prefixes*/ [copyright],
556
/*useBuiltCompiler*/ true,
556
/*useBuiltCompiler*/ true,
557
{ noOutFile: false, generateDeclarations: true });
557
{ noOutFile: false, generateDeclarations: true });
@@ -562,7 +562,7 @@ task("lssl", [tsserverLibraryFile, tsserverLibraryDefinitionFile]);
562

562

563
// Local target to build the compiler and services
563
// Local target to build the compiler and services
564
desc("Builds the full compiler and services");
564
desc("Builds the full compiler and services");
565-
task("local", ["generate-diagnostics", "lib", tscFile, servicesFile, nodeDefinitionsFile, serverFile, builtGeneratedDiagnosticMessagesJSON]);
565+
task("local", ["generate-diagnostics", "lib", tscFile, servicesFile, nodeDefinitionsFile, serverFile, builtGeneratedDiagnosticMessagesJSON, "lssl"]);
566

566

567
// Local target to build only tsc.js
567
// Local target to build only tsc.js
568
desc("Builds only the compiler");
568
desc("Builds only the compiler");
@@ -617,7 +617,7 @@ task("generate-spec", [specMd]);
617

617

618
// Makes a new LKG. This target does not build anything, but errors if not all the outputs are present in the built/local directory
618
// Makes a new LKG. This target does not build anything, but errors if not all the outputs are present in the built/local directory
619
desc("Makes a new LKG out of the built js files");
619
desc("Makes a new LKG out of the built js files");
620-
task("LKG", ["clean", "release", "local", "lssl"].concat(libraryTargets), function() {
620+
task("LKG", ["clean", "release", "local"].concat(libraryTargets), function() {
621
var expectedFiles = [tscFile, servicesFile, serverFile, nodePackageFile, nodeDefinitionsFile, standaloneDefinitionsFile, tsserverLibraryFile, tsserverLibraryDefinitionFile].concat(libraryTargets);
621
var expectedFiles = [tscFile, servicesFile, serverFile, nodePackageFile, nodeDefinitionsFile, standaloneDefinitionsFile, tsserverLibraryFile, tsserverLibraryDefinitionFile].concat(libraryTargets);
622
var missingFiles = expectedFiles.filter(function (f) {
622
var missingFiles = expectedFiles.filter(function (f) {
623
return !fs.existsSync(f);
623
return !fs.existsSync(f);
@@ -1041,7 +1041,8 @@ var lintTargets = compilerSources
1041
.concat(serverCoreSources)
1041
.concat(serverCoreSources)
1042
.concat(tslintRulesFiles)
1042
.concat(tslintRulesFiles)
1043
.concat(servicesSources)
1043
.concat(servicesSources)
1044-
.concat(["Gulpfile.ts"]);
1044+
.concat(["Gulpfile.ts"])
1045+
.concat([nodeServerInFile, perftscPath, "tests/perfsys.ts", webhostPath]);
1045

1046

1046

1047

1047
desc("Runs tslint on the compiler sources. Optional arguments are: f[iles]=regex");
1048
desc("Runs tslint on the compiler sources. Optional arguments are: f[iles]=regex");

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberOriginal file lineDiff line numberDiff line change
@@ -78,7 +78,7 @@
78
},
78
},
79
"scripts": {
79
"scripts": {
80
"pretest": "jake tests",
80
"pretest": "jake tests",
81-
"test": "jake runtests",
81+
"test": "jake runtests-parallel",
82
"build": "npm run build:compiler && npm run build:tests",
82
"build": "npm run build:compiler && npm run build:tests",
83
"build:compiler": "jake local",
83
"build:compiler": "jake local",
84
"build:tests": "jake tests",
84
"build:tests": "jake tests",

src/compiler/checker.ts

Lines changed: 214 additions & 75 deletions
Large diffs are not rendered by default.

src/compiler/core.ts

Lines changed: 6 additions & 2 deletions
Original file line numberOriginal file lineDiff line numberDiff line change
@@ -334,8 +334,12 @@ namespace ts {
334
return keys;
334
return keys;
335
}
335
}
336

336

337-
export function getProperty<T>(map: Map<T>, key: string): T {
337+
export function getProperty<T>(map: Map<T>, key: string): T | undefined {
338-
return hasOwnProperty.call(map, key) ? map[key] : undefined;
338+
return hasProperty(map, key) ? map[key] : undefined;
339+
}
340+
341+
export function getOrUpdateProperty<T>(map: Map<T>, key: string, makeValue: () => T): T {
342+
return hasProperty(map, key) ? map[key] : map[key] = makeValue();
339
}
343
}
340

344

341
export function isEmpty<T>(map: Map<T>) {
345
export function isEmpty<T>(map: Map<T>) {

src/compiler/diagnosticMessages.json

Lines changed: 4 additions & 0 deletions
Original file line numberOriginal file lineDiff line numberDiff line change
@@ -1947,6 +1947,10 @@
1947
"category": "Error",
1947
"category": "Error",
1948
"code": 2689
1948
"code": 2689
1949
},
1949
},
1950+
"A class must be declared after its base class.": {
1951+
"category": "Error",
1952+
"code": 2690
1953+
},
1950
"Import declaration '{0}' is using private name '{1}'.": {
1954
"Import declaration '{0}' is using private name '{1}'.": {
1951
"category": "Error",
1955
"category": "Error",
1952
"code": 4000
1956
"code": 4000

src/compiler/emitter.ts

Lines changed: 3 additions & 2 deletions
Original file line numberOriginal file lineDiff line numberDiff line change
@@ -2578,7 +2578,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
2578
operand = (<TypeAssertion | NonNullExpression>operand).expression;
2578
operand = (<TypeAssertion | NonNullExpression>operand).expression;
2579
}
2579
}
2580

2580

2581-
// We have an expression of the form: (<Type>SubExpr)
2581+
// We have an expression of the form: (<Type>SubExpr) or (SubExpr as Type)
2582
// Emitting this as (SubExpr) is really not desirable. We would like to emit the subexpr as is.
2582
// Emitting this as (SubExpr) is really not desirable. We would like to emit the subexpr as is.
2583
// Omitting the parentheses, however, could cause change in the semantics of the generated
2583
// Omitting the parentheses, however, could cause change in the semantics of the generated
2584
// code if the casted expression has a lower precedence than the rest of the expression, e.g.:
2584
// code if the casted expression has a lower precedence than the rest of the expression, e.g.:
@@ -2592,6 +2592,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
2592
operand.kind !== SyntaxKind.DeleteExpression &&
2592
operand.kind !== SyntaxKind.DeleteExpression &&
2593
operand.kind !== SyntaxKind.PostfixUnaryExpression &&
2593
operand.kind !== SyntaxKind.PostfixUnaryExpression &&
2594
operand.kind !== SyntaxKind.NewExpression &&
2594
operand.kind !== SyntaxKind.NewExpression &&
2595+
!(operand.kind === SyntaxKind.BinaryExpression && node.expression.kind === SyntaxKind.AsExpression) &&
2595
!(operand.kind === SyntaxKind.CallExpression && node.parent.kind === SyntaxKind.NewExpression) &&
2596
!(operand.kind === SyntaxKind.CallExpression && node.parent.kind === SyntaxKind.NewExpression) &&
2596
!(operand.kind === SyntaxKind.FunctionExpression && node.parent.kind === SyntaxKind.CallExpression) &&
2597
!(operand.kind === SyntaxKind.FunctionExpression && node.parent.kind === SyntaxKind.CallExpression) &&
2597
!(operand.kind === SyntaxKind.NumericLiteral && node.parent.kind === SyntaxKind.PropertyAccessExpression)) {
2598
!(operand.kind === SyntaxKind.NumericLiteral && node.parent.kind === SyntaxKind.PropertyAccessExpression)) {
@@ -6841,7 +6842,7 @@ const _super = (function (geti, seti) {
6841
// export { x, y }
6842
// export { x, y }
6842
for (const specifier of (<ExportDeclaration>node).exportClause.elements) {
6843
for (const specifier of (<ExportDeclaration>node).exportClause.elements) {
6843
const name = (specifier.propertyName || specifier.name).text;
6844
const name = (specifier.propertyName || specifier.name).text;
6844-
(exportSpecifiers[name] || (exportSpecifiers[name] = [])).push(specifier);
6845+
getOrUpdateProperty(exportSpecifiers, name, () => []).push(specifier);
6845
}
6846
}
6846
}
6847
}
6847
break;
6848
break;

src/compiler/program.ts

Lines changed: 9 additions & 10 deletions
Original file line numberOriginal file lineDiff line numberDiff line change
@@ -1055,19 +1055,15 @@ namespace ts {
1055
return resolutions;
1055
return resolutions;
1056
}
1056
}
1057

1057

1058-
function getInferredTypesRoot(options: CompilerOptions, rootFiles: string[], host: CompilerHost) {
1059-
return computeCommonSourceDirectoryOfFilenames(rootFiles, host.getCurrentDirectory(), f => host.getCanonicalFileName(f));
1060-
}
1061-
1062
/**
1058
/**
1063-
* Given a set of options and a set of root files, returns the set of type directive names
1059+
* Given a set of options, returns the set of type directive names
1064
* that should be included for this program automatically.
1060
* that should be included for this program automatically.
1065
* This list could either come from the config file,
1061
* This list could either come from the config file,
1066
* or from enumerating the types root + initial secondary types lookup location.
1062
* or from enumerating the types root + initial secondary types lookup location.
1067
* More type directives might appear in the program later as a result of loading actual source files;
1063
* More type directives might appear in the program later as a result of loading actual source files;
1068
* this list is only the set of defaults that are implicitly included.
1064
* this list is only the set of defaults that are implicitly included.
1069
*/
1065
*/
1070-
export function getAutomaticTypeDirectiveNames(options: CompilerOptions, rootFiles: string[], host: CompilerHost): string[] {
1066+
export function getAutomaticTypeDirectiveNames(options: CompilerOptions, host: ModuleResolutionHost): string[] {
1071
// Use explicit type list from tsconfig.json
1067
// Use explicit type list from tsconfig.json
1072
if (options.types) {
1068
if (options.types) {
1073
return options.types;
1069
return options.types;
@@ -1080,7 +1076,10 @@ namespace ts {
1080
if (typeRoots) {
1076
if (typeRoots) {
1081
for (const root of typeRoots) {
1077
for (const root of typeRoots) {
1082
if (host.directoryExists(root)) {
1078
if (host.directoryExists(root)) {
1083-
result = result.concat(host.getDirectories(root));
1079+
for (const typeDirectivePath of host.getDirectories(root)) {
1080+
// Return just the type directive names
1081+
result = result.concat(getBaseFileName(normalizePath(typeDirectivePath)));
1082+
}
1084
}
1083
}
1085
}
1084
}
1086
}
1085
}
@@ -1155,11 +1154,11 @@ namespace ts {
1155
forEach(rootNames, name => processRootFile(name, /*isDefaultLib*/ false));
1154
forEach(rootNames, name => processRootFile(name, /*isDefaultLib*/ false));
1156

1155

1157
// load type declarations specified via 'types' argument or implicitly from types/ and node_modules/@types folders
1156
// load type declarations specified via 'types' argument or implicitly from types/ and node_modules/@types folders
1158-
const typeReferences: string[] = getAutomaticTypeDirectiveNames(options, rootNames, host);
1157+
const typeReferences: string[] = getAutomaticTypeDirectiveNames(options, host);
1159

1158

1160
if (typeReferences) {
1159
if (typeReferences) {
1161-
const inferredRoot = getInferredTypesRoot(options, rootNames, host);
1160+
// This containingFilename needs to match with the one used in managed-side
1162-
const containingFilename = combinePaths(inferredRoot, "__inferred type names__.ts");
1161+
const containingFilename = combinePaths(host.getCurrentDirectory(), "__inferred type names__.ts");
1163
const resolutions = resolveTypeReferenceDirectiveNamesWorker(typeReferences, containingFilename);
1162
const resolutions = resolveTypeReferenceDirectiveNamesWorker(typeReferences, containingFilename);
1164
for (let i = 0; i < typeReferences.length; i++) {
1163
for (let i = 0; i < typeReferences.length; i++) {
1165
processTypeReferenceDirective(typeReferences[i], resolutions[i]);
1164
processTypeReferenceDirective(typeReferences[i], resolutions[i]);

src/compiler/types.ts

Lines changed: 13 additions & 0 deletions
Original file line numberOriginal file lineDiff line numberDiff line change
@@ -1612,6 +1612,16 @@ namespace ts {
1612
antecedent: FlowNode;
1612
antecedent: FlowNode;
1613
}
1613
}
1614

1614

1615+
export type FlowType = Type | IncompleteType;
1616+
1617+
// Incomplete types occur during control flow analysis of loops. An IncompleteType
1618+
// is distinguished from a regular type by a flags value of zero. Incomplete type
1619+
// objects are internal to the getFlowTypeOfRefecence function and never escape it.
1620+
export interface IncompleteType {
1621+
flags: TypeFlags; // No flags set
1622+
type: Type; // The type marked incomplete
1623+
}
1624+
1615
export interface AmdDependency {
1625
export interface AmdDependency {
1616
path: string;
1626
path: string;
1617
name: string;
1627
name: string;
@@ -2156,6 +2166,8 @@ namespace ts {
2156
mapper?: TypeMapper; // Type mapper for instantiation alias
2166
mapper?: TypeMapper; // Type mapper for instantiation alias
2157
referenced?: boolean; // True if alias symbol has been referenced as a value
2167
referenced?: boolean; // True if alias symbol has been referenced as a value
2158
containingType?: UnionOrIntersectionType; // Containing union or intersection type for synthetic property
2168
containingType?: UnionOrIntersectionType; // Containing union or intersection type for synthetic property
2169+
hasCommonType?: boolean; // True if constituents of synthetic property all have same type
2170+
isDiscriminantProperty?: boolean; // True if discriminant synthetic property
2159
resolvedExports?: SymbolTable; // Resolved exports of module
2171
resolvedExports?: SymbolTable; // Resolved exports of module
2160
exportsChecked?: boolean; // True if exports of external module have been checked
2172
exportsChecked?: boolean; // True if exports of external module have been checked
2161
isDeclarationWithCollidingName?: boolean; // True if symbol is block scoped redeclaration
2173
isDeclarationWithCollidingName?: boolean; // True if symbol is block scoped redeclaration
@@ -2906,6 +2918,7 @@ namespace ts {
2906
directoryExists?(directoryName: string): boolean;
2918
directoryExists?(directoryName: string): boolean;
2907
realpath?(path: string): string;
2919
realpath?(path: string): string;
2908
getCurrentDirectory?(): string;
2920
getCurrentDirectory?(): string;
2921+
getDirectories?(path: string): string[];
2909
}
2922
}
2910

2923

2911
export interface ResolvedModule {
2924
export interface ResolvedModule {

src/compiler/utilities.ts

Lines changed: 1 addition & 0 deletions
Original file line numberOriginal file lineDiff line numberDiff line change
@@ -1569,6 +1569,7 @@ namespace ts {
1569
case SyntaxKind.MethodSignature:
1569
case SyntaxKind.MethodSignature:
1570
case SyntaxKind.ModuleDeclaration:
1570
case SyntaxKind.ModuleDeclaration:
1571
case SyntaxKind.NamespaceImport:
1571
case SyntaxKind.NamespaceImport:
1572+
case SyntaxKind.NamespaceExportDeclaration:
1572
case SyntaxKind.Parameter:
1573
case SyntaxKind.Parameter:
1573
case SyntaxKind.PropertyAssignment:
1574
case SyntaxKind.PropertyAssignment:
1574
case SyntaxKind.PropertyDeclaration:
1575
case SyntaxKind.PropertyDeclaration:

src/harness/harness.ts

Lines changed: 1 addition & 1 deletion
Original file line numberOriginal file lineDiff line numberDiff line change
@@ -750,7 +750,7 @@ namespace Harness {
750

750

751
export function readDirectory(path: string, extension?: string[], exclude?: string[], include?: string[]) {
751
export function readDirectory(path: string, extension?: string[], exclude?: string[], include?: string[]) {
752
const fs = new Utils.VirtualFileSystem(path, useCaseSensitiveFileNames());
752
const fs = new Utils.VirtualFileSystem(path, useCaseSensitiveFileNames());
753-
for (const file in listFiles(path)) {
753+
for (const file of listFiles(path)) {
754
fs.addFile(file);
754
fs.addFile(file);
755
}
755
}
756
return ts.matchFiles(path, extension, exclude, include, useCaseSensitiveFileNames(), getCurrentDirectory(), path => {
756
return ts.matchFiles(path, extension, exclude, include, useCaseSensitiveFileNames(), getCurrentDirectory(), path => {

src/harness/unittests/session.ts

Lines changed: 1 addition & 1 deletion
Original file line numberOriginal file lineDiff line numberDiff line change
@@ -106,7 +106,7 @@ namespace ts.server {
106
describe("onMessage", () => {
106
describe("onMessage", () => {
107
it("should not throw when commands are executed with invalid arguments", () => {
107
it("should not throw when commands are executed with invalid arguments", () => {
108
let i = 0;
108
let i = 0;
109-
for (name in CommandNames) {
109+
for (const name in CommandNames) {
110
if (!Object.prototype.hasOwnProperty.call(CommandNames, name)) {
110
if (!Object.prototype.hasOwnProperty.call(CommandNames, name)) {
111
continue;
111
continue;
112
}
112
}

src/lib/es2015.core.d.ts

Lines changed: 25 additions & 1 deletion
Original file line numberOriginal file lineDiff line numberDiff line change
@@ -226,7 +226,7 @@ interface NumberConstructor {
226
/**
226
/**
227
* The value of the largest integer n such that n and n + 1 are both exactly representable as
227
* The value of the largest integer n such that n and n + 1 are both exactly representable as
228
* a Number value.
228
* a Number value.
229-
* The value of Number.MIN_SAFE_INTEGER is 9007199254740991 2^53 − 1.
229+
* The value of Number.MAX_SAFE_INTEGER is 9007199254740991 2^53 − 1.
230
*/
230
*/
231
readonly MAX_SAFE_INTEGER: number;
231
readonly MAX_SAFE_INTEGER: number;
232

232

@@ -343,6 +343,30 @@ interface ObjectConstructor {
343
defineProperty(o: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): any;
343
defineProperty(o: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): any;
344
}
344
}
345

345

346+
interface ReadonlyArray<T> {
347+
/**
348+
* Returns the value of the first element in the array where predicate is true, and undefined
349+
* otherwise.
350+
* @param predicate find calls predicate once for each element of the array, in ascending
351+
* order, until it finds one where predicate returns true. If such an element is found, find
352+
* immediately returns that element value. Otherwise, find returns undefined.
353+
* @param thisArg If provided, it will be used as the this value for each invocation of
354+
* predicate. If it is not provided, undefined is used instead.
355+
*/
356+
find(predicate: (value: T, index: number, obj: ReadonlyArray<T>) => boolean, thisArg?: any): T | undefined;
357+
358+
/**
359+
* Returns the index of the first element in the array where predicate is true, and undefined
360+
* otherwise.
361+
* @param predicate find calls predicate once for each element of the array, in ascending
362+
* order, until it finds one where predicate returns true. If such an element is found,
363+
* findIndex immediately returns that element index. Otherwise, findIndex returns -1.
364+
* @param thisArg If provided, it will be used as the this value for each invocation of
365+
* predicate. If it is not provided, undefined is used instead.
366+
*/
367+
findIndex(predicate: (value: T) => boolean, thisArg?: any): number;
368+
}
369+
346
interface RegExp {
370
interface RegExp {
347
/**
371
/**
348
* Returns a string indicating the flags of the regular expression in question. This field is read-only.
372
* Returns a string indicating the flags of the regular expression in question. This field is read-only.

src/lib/es2015.iterable.d.ts

Lines changed: 20 additions & 0 deletions
Original file line numberOriginal file lineDiff line numberDiff line change
@@ -63,6 +63,26 @@ interface ArrayConstructor {
63
from<T>(iterable: Iterable<T>): Array<T>;
63
from<T>(iterable: Iterable<T>): Array<T>;
64
}
64
}
65

65

66+
interface ReadonlyArray<T> {
67+
/** Iterator */
68+
[Symbol.iterator](): IterableIterator<T>;
69+
70+
/**
71+
* Returns an array of key, value pairs for every entry in the array
72+
*/
73+
entries(): IterableIterator<[number, T]>;
74+
75+
/**
76+
* Returns an list of keys in the array
77+
*/
78+
keys(): IterableIterator<number>;
79+
80+
/**
81+
* Returns an list of values in the array
82+
*/
83+
values(): IterableIterator<T>;
84+
}
85+
66
interface IArguments {
86
interface IArguments {
67
/** Iterator */
87
/** Iterator */
68
[Symbol.iterator](): IterableIterator<any>;
88
[Symbol.iterator](): IterableIterator<any>;

src/lib/es5.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberOriginal file lineDiff line numberDiff line change
@@ -1108,6 +1108,11 @@ interface Array<T> {
1108
* Removes the last element from an array and returns it.
1108
* Removes the last element from an array and returns it.
1109
*/
1109
*/
1110
pop(): T | undefined;
1110
pop(): T | undefined;
1111+
/**
1112+
* Combines two or more arrays.
1113+
* @param items Additional items to add to the end of array1.
1114+
*/
1115+
concat(...items: T[][]): T[];
1111
/**
1116
/**
1112
* Combines two or more arrays.
1117
* Combines two or more arrays.
1113
* @param items Additional items to add to the end of array1.
1118
* @param items Additional items to add to the end of array1.

src/server/editorServices.ts

Lines changed: 3 additions & 0 deletions
Original file line numberOriginal file lineDiff line numberDiff line change
@@ -115,6 +115,9 @@ namespace ts.server {
115
readFile: fileName => this.host.readFile(fileName),
115
readFile: fileName => this.host.readFile(fileName),
116
directoryExists: directoryName => this.host.directoryExists(directoryName)
116
directoryExists: directoryName => this.host.directoryExists(directoryName)
117
};
117
};
118+
if (this.host.realpath) {
119+
this.moduleResolutionHost.realpath = path => this.host.realpath(path);
120+
}
118
}
121
}
119

122

120
private resolveNamesWithLocalCache<T extends Timestamped & { failedLookupLocations: string[] }, R>(
123
private resolveNamesWithLocalCache<T extends Timestamped & { failedLookupLocations: string[] }, R>(

src/server/tsconfig.library.json

Lines changed: 2 additions & 0 deletions
Original file line numberOriginal file lineDiff line numberDiff line change
@@ -10,6 +10,8 @@
10
"types": []
10
"types": []
11
},
11
},
12
"files": [
12
"files": [
13+
"../services/shims.ts",
14+
"../services/utilities.ts",
13
"editorServices.ts",
15
"editorServices.ts",
14
"protocol.d.ts",
16
"protocol.d.ts",
15
"session.ts"
17
"session.ts"

0 commit comments

Comments
 (0)