Skip to content

Commit 2f8df90

Browse files
committed
Merge branch 'master' into travis-cache
2 parents 2037ec6 + acb003a commit 2f8df90

File tree

148 files changed

+3086
-997
lines changed

Some content is hidden

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

148 files changed

+3086
-997
lines changed

Gulpfile.ts

+32-3
Original file line numberDiff line numberDiff line change
@@ -694,21 +694,50 @@ gulp.task(nodeServerOutFile, false, [servicesFile], () => {
694694
.pipe(gulp.dest(path.dirname(nodeServerOutFile)));
695695
});
696696

697+
import convertMap = require("convert-source-map");
698+
import sorcery = require("sorcery");
699+
declare module "convert-source-map" {
700+
export function fromSource(source: string, largeSource?: boolean): SourceMapConverter;
701+
}
702+
697703
gulp.task("browserify", "Runs browserify on run.js to produce a file suitable for running tests in the browser", [servicesFile], (done) => {
698704
const testProject = tsc.createProject("src/harness/tsconfig.json", getCompilerSettings({ outFile: "built/local/bundle.js" }, /*useBuiltCompiler*/ true));
699705
return testProject.src()
700706
.pipe(newer("built/local/bundle.js"))
701707
.pipe(sourcemaps.init())
702708
.pipe(tsc(testProject))
703709
.pipe(through2.obj((file, enc, next) => {
704-
browserify(intoStream(file.contents))
710+
const originalMap = file.sourceMap;
711+
const prebundledContent = file.contents.toString();
712+
// Make paths absolute to help sorcery deal with all the terrible paths being thrown around
713+
originalMap.sources = originalMap.sources.map(s => path.resolve("src", s));
714+
// intoStream (below) makes browserify think the input file is named this, so this is what it puts in the sourcemap
715+
originalMap.file = "built/local/_stream_0.js";
716+
717+
browserify(intoStream(file.contents), { debug: true })
705718
.bundle((err, res) => {
706719
// assumes file.contents is a Buffer
707-
file.contents = res;
720+
const maps = JSON.parse(convertMap.fromSource(res.toString(), /*largeSource*/true).toJSON());
721+
delete maps.sourceRoot;
722+
maps.sources = maps.sources.map(s => path.resolve(s === "_stream_0.js" ? "built/local/_stream_0.js" : s));
723+
// Strip browserify's inline comments away (could probably just let sorcery do this, but then we couldn't fix the paths)
724+
file.contents = new Buffer(convertMap.removeComments(res.toString()));
725+
const chain = sorcery.loadSync("built/local/bundle.js", {
726+
content: {
727+
"built/local/_stream_0.js": prebundledContent,
728+
"built/local/bundle.js": file.contents.toString()
729+
},
730+
sourcemaps: {
731+
"built/local/_stream_0.js": originalMap,
732+
"built/local/bundle.js": maps,
733+
}
734+
});
735+
const finalMap = chain.apply();
736+
file.sourceMap = finalMap;
708737
next(undefined, file);
709738
});
710739
}))
711-
.pipe(sourcemaps.write(".", { includeContent: false, sourceRoot: "../../" }))
740+
.pipe(sourcemaps.write(".", { includeContent: false }))
712741
.pipe(gulp.dest("."));
713742
});
714743

Jakefile.js

+2-9
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ if (process.env.path !== undefined) {
3434

3535
var compilerSources = [
3636
"core.ts",
37+
"performance.ts",
3738
"sys.ts",
3839
"types.ts",
3940
"scanner.ts",
@@ -54,6 +55,7 @@ var compilerSources = [
5455

5556
var servicesSources = [
5657
"core.ts",
58+
"performance.ts",
5759
"sys.ts",
5860
"types.ts",
5961
"scanner.ts",
@@ -466,15 +468,6 @@ task("publish-nightly", ["configure-nightly", "LKG", "clean", "setDebugMode", "r
466468
exec(cmd);
467469
});
468470

469-
var scriptsTsdJson = path.join(scriptsDirectory, "tsd.json");
470-
file(scriptsTsdJson);
471-
472-
task("tsd-scripts", [scriptsTsdJson], function () {
473-
var cmd = "tsd --config " + scriptsTsdJson + " install";
474-
console.log(cmd);
475-
exec(cmd);
476-
}, { async: true });
477-
478471
var importDefinitelyTypedTestsDirectory = path.join(scriptsDirectory, "importDefinitelyTypedTests");
479472
var importDefinitelyTypedTestsJs = path.join(importDefinitelyTypedTestsDirectory, "importDefinitelyTypedTests.js");
480473
var importDefinitelyTypedTestsTs = path.join(importDefinitelyTypedTestsDirectory, "importDefinitelyTypedTests.ts");

lib/tsc.js

+120-76
Large diffs are not rendered by default.

lib/tsserver.js

+193-77
Large diffs are not rendered by default.

lib/tsserverlibrary.d.ts

+17-8
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,10 @@ declare namespace ts {
405405
interface ModifiersArray extends NodeArray<Modifier> {
406406
flags: NodeFlags;
407407
}
408-
interface Modifier extends Node {
408+
interface Token extends Node {
409+
__tokenTag: any;
410+
}
411+
interface Modifier extends Token {
409412
}
410413
interface Identifier extends PrimaryExpression {
411414
text: string;
@@ -2050,7 +2053,6 @@ declare namespace ts {
20502053
getCancellationToken?(): CancellationToken;
20512054
getDefaultLibFileName(options: CompilerOptions): string;
20522055
getDefaultLibLocation?(): string;
2053-
getDefaultTypeDirectiveNames?(rootPath: string): string[];
20542056
writeFile: WriteFileCallback;
20552057
getCurrentDirectory(): string;
20562058
getDirectories(path: string): string[];
@@ -2156,6 +2158,8 @@ declare namespace ts {
21562158
function ensureTrailingDirectorySeparator(path: string): string;
21572159
function comparePaths(a: string, b: string, currentDirectory: string, ignoreCase?: boolean): Comparison;
21582160
function containsPath(parent: string, child: string, currentDirectory: string, ignoreCase?: boolean): boolean;
2161+
function startsWith(str: string, prefix: string): boolean;
2162+
function endsWith(str: string, suffix: string): boolean;
21592163
function fileExtensionIs(path: string, extension: string): boolean;
21602164
function fileExtensionIsAny(path: string, extensions: string[]): boolean;
21612165
function getRegularExpressionForWildcard(specs: string[], basePath: string, usage: "files" | "directories" | "exclude"): string;
@@ -2193,6 +2197,8 @@ declare namespace ts {
21932197
function changeExtension<T extends string | Path>(path: T, newExtension: string): T;
21942198
interface ObjectAllocator {
21952199
getNodeConstructor(): new (kind: SyntaxKind, pos?: number, end?: number) => Node;
2200+
getTokenConstructor(): new (kind: SyntaxKind, pos?: number, end?: number) => Token;
2201+
getIdentifierConstructor(): new (kind: SyntaxKind, pos?: number, end?: number) => Token;
21962202
getSourceFileConstructor(): new (kind: SyntaxKind, pos?: number, end?: number) => SourceFile;
21972203
getSymbolConstructor(): new (flags: SymbolFlags, name: string) => Symbol;
21982204
getTypeConstructor(): new (checker: TypeChecker, flags: TypeFlags) => Type;
@@ -6456,13 +6462,13 @@ declare namespace ts {
64566462
key: string;
64576463
message: string;
64586464
};
6459-
Report_Errors_on_Unused_Locals: {
6465+
Report_errors_on_unused_locals: {
64606466
code: number;
64616467
category: DiagnosticCategory;
64626468
key: string;
64636469
message: string;
64646470
};
6465-
Report_Errors_on_Unused_Parameters: {
6471+
Report_errors_on_unused_parameters: {
64666472
code: number;
64676473
category: DiagnosticCategory;
64686474
key: string;
@@ -7143,8 +7149,6 @@ declare namespace ts {
71437149
function collapseTextChangeRangesAcrossMultipleVersions(changes: TextChangeRange[]): TextChangeRange;
71447150
function getTypeParameterOwner(d: Declaration): Declaration;
71457151
function isParameterPropertyDeclaration(node: ParameterDeclaration): boolean;
7146-
function startsWith(str: string, prefix: string): boolean;
7147-
function endsWith(str: string, suffix: string): boolean;
71487152
}
71497153
declare namespace ts {
71507154
let parseTime: number;
@@ -7225,6 +7229,12 @@ declare namespace ts {
72257229
const defaultInitCompilerOptions: CompilerOptions;
72267230
function createCompilerHost(options: CompilerOptions, setParentNodes?: boolean): CompilerHost;
72277231
function getPreEmitDiagnostics(program: Program, sourceFile?: SourceFile, cancellationToken?: CancellationToken): Diagnostic[];
7232+
interface FormatDiagnosticsHost {
7233+
getCurrentDirectory(): string;
7234+
getCanonicalFileName(fileName: string): string;
7235+
getNewLine(): string;
7236+
}
7237+
function formatDiagnostics(diagnostics: Diagnostic[], host: FormatDiagnosticsHost): string;
72287238
function flattenDiagnosticMessageText(messageText: string | DiagnosticMessageChain, newLine: string): string;
72297239
function getAutomaticTypeDirectiveNames(options: CompilerOptions, rootFiles: string[], host: CompilerHost): string[];
72307240
function createProgram(rootNames: string[], options: CompilerOptions, host?: CompilerHost, oldProgram?: Program): Program;
@@ -8388,7 +8398,6 @@ declare namespace ts.server {
83888398
class ScriptInfo {
83898399
private host;
83908400
fileName: string;
8391-
content: string;
83928401
isOpen: boolean;
83938402
svc: ScriptVersionCache;
83948403
children: ScriptInfo[];
@@ -8729,7 +8738,7 @@ declare namespace ts {
87298738
getLocalizedDiagnosticMessages(): string;
87308739
getCancellationToken(): HostCancellationToken;
87318740
getCurrentDirectory(): string;
8732-
getDirectories(path: string): string[];
8741+
getDirectories(path: string): string;
87338742
getDefaultLibFileName(options: string): string;
87348743
getNewLine?(): string;
87358744
getProjectVersion?(): string;

0 commit comments

Comments
 (0)