From 9ec404d42ceea38a42712653ef6c0769c324eb69 Mon Sep 17 00:00:00 2001 From: Travis-CI Date: Fri, 26 Aug 2016 00:07:09 +0000 Subject: [PATCH] 2016-08-26 [ci skip] Version: 1.201608260007.1+0041d5ce7907f9ee974693ace54efd64afa1971a --- TypeScript | 2 +- bin/ntypescript.js | 22 ++++++++++++---------- bin/typescript.js | 22 ++++++++++++---------- kicktravis | 2 +- package.json | 2 +- src/compiler/checker.ts | 6 ++++-- src/compiler/commandLineParser.ts | 2 +- src/compiler/program.ts | 2 +- src/services/services.ts | 11 +++++------ src/services/utilities.ts | 3 ++- 10 files changed, 40 insertions(+), 34 deletions(-) diff --git a/TypeScript b/TypeScript index ddb5a00..0041d5c 160000 --- a/TypeScript +++ b/TypeScript @@ -1 +1 @@ -Subproject commit ddb5a00410d695d35b55c5482876a16f7c696c4b +Subproject commit 0041d5ce7907f9ee974693ace54efd64afa1971a diff --git a/bin/ntypescript.js b/bin/ntypescript.js index 80bfa1d..8fbdd62 100644 --- a/bin/ntypescript.js +++ b/bin/ntypescript.js @@ -17418,7 +17418,7 @@ var ts; } } function getDeclarationOfAliasSymbol(symbol) { - return ts.findMap(symbol.declarations, function (d) { return ts.isAliasSymbolDeclaration(d) ? d : undefined; }); + return ts.forEach(symbol.declarations, function (d) { return ts.isAliasSymbolDeclaration(d) ? d : undefined; }); } function getTargetOfImportEqualsDeclaration(node) { if (node.moduleReference.kind === 240 /* ExternalModuleReference */) { @@ -17571,6 +17571,7 @@ var ts; if (!links.target) { links.target = resolvingSymbol; var node = getDeclarationOfAliasSymbol(symbol); + ts.Debug.assert(!!node); var target = getTargetOfAliasDeclaration(node); if (links.target === resolvingSymbol) { links.target = target || unknownSymbol; @@ -17603,6 +17604,7 @@ var ts; if (!links.referenced) { links.referenced = true; var node = getDeclarationOfAliasSymbol(symbol); + ts.Debug.assert(!!node); if (node.kind === 235 /* ExportAssignment */) { // export default checkExpressionCached(node.expression); @@ -35456,7 +35458,7 @@ var ts; } ts.convertTypingOptionsFromJson = convertTypingOptionsFromJson; function convertCompilerOptionsFromJsonWorker(jsonOptions, basePath, errors, configFileName) { - var options = ts.getBaseFileName(configFileName) === "jsconfig.json" ? { allowJs: true } : {}; + var options = ts.getBaseFileName(configFileName) === "jsconfig.json" ? { allowJs: true, maxNodeModuleJsDepth: 2 } : {}; convertOptionsFromJson(ts.optionDeclarations, jsonOptions, basePath, options, ts.Diagnostics.Unknown_compiler_option_0, errors); return options; } @@ -46079,7 +46081,7 @@ var ts; // - This calls resolveModuleNames, and then calls findSourceFile for each resolved module. // As all these operations happen - and are nested - within the createProgram call, they close over the below variables. // The current resolution depth is tracked by incrementing/decrementing as the depth first search progresses. - var maxNodeModulesJsDepth = typeof options.maxNodeModuleJsDepth === "number" ? options.maxNodeModuleJsDepth : 2; + var maxNodeModulesJsDepth = typeof options.maxNodeModuleJsDepth === "number" ? options.maxNodeModuleJsDepth : 0; var currentNodeModulesDepth = 0; // If a module has some of its imports skipped due to being at the depth limit under node_modules, then track // this, as it may be imported at a shallower depth later, and then it will need its skipped imports processed. @@ -50697,7 +50699,8 @@ var ts; var options = { fileName: "config.js", compilerOptions: { - target: 2 /* ES6 */ + target: 2 /* ES6 */, + removeComments: true }, reportDiagnostics: true }; @@ -53853,11 +53856,14 @@ var ts; var pos_3 = this.pos; var useJSDocScanner_1 = this.kind >= 273 /* FirstJSDocTagNode */ && this.kind <= 285 /* LastJSDocTagNode */; var processNode = function (node) { - if (pos_3 < node.pos) { + var isJSDocTagNode = ts.isJSDocTag(node); + if (!isJSDocTagNode && pos_3 < node.pos) { pos_3 = _this.addSyntheticNodes(children, pos_3, node.pos, useJSDocScanner_1); } children.push(node); - pos_3 = node.end; + if (!isJSDocTagNode) { + pos_3 = node.end; + } }; var processNodes = function (nodes) { if (pos_3 < nodes.pos) { @@ -53873,10 +53879,6 @@ var ts; processNode(jsDocComment); } } - // For syntactic classifications, all trivia are classcified together, including jsdoc comments. - // For that to work, the jsdoc comments should still be the leading trivia of the first child. - // Restoring the scanner position ensures that. - pos_3 = this.pos; ts.forEachChild(this, processNode, processNodes); if (pos_3 < this.end) { this.addSyntheticNodes(children, pos_3, this.end); diff --git a/bin/typescript.js b/bin/typescript.js index 5616657..70f5d35 100644 --- a/bin/typescript.js +++ b/bin/typescript.js @@ -17418,7 +17418,7 @@ var ts; } } function getDeclarationOfAliasSymbol(symbol) { - return ts.findMap(symbol.declarations, function (d) { return ts.isAliasSymbolDeclaration(d) ? d : undefined; }); + return ts.forEach(symbol.declarations, function (d) { return ts.isAliasSymbolDeclaration(d) ? d : undefined; }); } function getTargetOfImportEqualsDeclaration(node) { if (node.moduleReference.kind === 240 /* ExternalModuleReference */) { @@ -17571,6 +17571,7 @@ var ts; if (!links.target) { links.target = resolvingSymbol; var node = getDeclarationOfAliasSymbol(symbol); + ts.Debug.assert(!!node); var target = getTargetOfAliasDeclaration(node); if (links.target === resolvingSymbol) { links.target = target || unknownSymbol; @@ -17603,6 +17604,7 @@ var ts; if (!links.referenced) { links.referenced = true; var node = getDeclarationOfAliasSymbol(symbol); + ts.Debug.assert(!!node); if (node.kind === 235 /* ExportAssignment */) { // export default checkExpressionCached(node.expression); @@ -35456,7 +35458,7 @@ var ts; } ts.convertTypingOptionsFromJson = convertTypingOptionsFromJson; function convertCompilerOptionsFromJsonWorker(jsonOptions, basePath, errors, configFileName) { - var options = ts.getBaseFileName(configFileName) === "jsconfig.json" ? { allowJs: true } : {}; + var options = ts.getBaseFileName(configFileName) === "jsconfig.json" ? { allowJs: true, maxNodeModuleJsDepth: 2 } : {}; convertOptionsFromJson(ts.optionDeclarations, jsonOptions, basePath, options, ts.Diagnostics.Unknown_compiler_option_0, errors); return options; } @@ -46079,7 +46081,7 @@ var ts; // - This calls resolveModuleNames, and then calls findSourceFile for each resolved module. // As all these operations happen - and are nested - within the createProgram call, they close over the below variables. // The current resolution depth is tracked by incrementing/decrementing as the depth first search progresses. - var maxNodeModulesJsDepth = typeof options.maxNodeModuleJsDepth === "number" ? options.maxNodeModuleJsDepth : 2; + var maxNodeModulesJsDepth = typeof options.maxNodeModuleJsDepth === "number" ? options.maxNodeModuleJsDepth : 0; var currentNodeModulesDepth = 0; // If a module has some of its imports skipped due to being at the depth limit under node_modules, then track // this, as it may be imported at a shallower depth later, and then it will need its skipped imports processed. @@ -50697,7 +50699,8 @@ var ts; var options = { fileName: "config.js", compilerOptions: { - target: 2 /* ES6 */ + target: 2 /* ES6 */, + removeComments: true }, reportDiagnostics: true }; @@ -53853,11 +53856,14 @@ var ts; var pos_3 = this.pos; var useJSDocScanner_1 = this.kind >= 273 /* FirstJSDocTagNode */ && this.kind <= 285 /* LastJSDocTagNode */; var processNode = function (node) { - if (pos_3 < node.pos) { + var isJSDocTagNode = ts.isJSDocTag(node); + if (!isJSDocTagNode && pos_3 < node.pos) { pos_3 = _this.addSyntheticNodes(children, pos_3, node.pos, useJSDocScanner_1); } children.push(node); - pos_3 = node.end; + if (!isJSDocTagNode) { + pos_3 = node.end; + } }; var processNodes = function (nodes) { if (pos_3 < nodes.pos) { @@ -53873,10 +53879,6 @@ var ts; processNode(jsDocComment); } } - // For syntactic classifications, all trivia are classcified together, including jsdoc comments. - // For that to work, the jsdoc comments should still be the leading trivia of the first child. - // Restoring the scanner position ensures that. - pos_3 = this.pos; ts.forEachChild(this, processNode, processNodes); if (pos_3 < this.end) { this.addSyntheticNodes(children, pos_3, this.end); diff --git a/kicktravis b/kicktravis index 7f70ea2..c2d34f1 100644 --- a/kicktravis +++ b/kicktravis @@ -1 +1 @@ -2016-08-25 [ci skip] Version: 1.201608250007.1+ddb5a00410d695d35b55c5482876a16f7c696c4b +2016-08-26 [ci skip] Version: 1.201608260007.1+0041d5ce7907f9ee974693ace54efd64afa1971a diff --git a/package.json b/package.json index 81dbfd5..81e16e6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ntypescript", - "version": "1.201608250007.1+ddb5a00410d695d35b55c5482876a16f7c696c4b", + "version": "1.201608260007.1+0041d5ce7907f9ee974693ace54efd64afa1971a", "description": "A nicer version of microsoft/typescript packaged and released for API developers", "main": "./bin/ntypescript.js", "bin": { diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 3d74190..2341a0f 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -1023,8 +1023,8 @@ namespace ts { } } - function getDeclarationOfAliasSymbol(symbol: Symbol): Declaration { - return findMap(symbol.declarations, d => isAliasSymbolDeclaration(d) ? d : undefined); + function getDeclarationOfAliasSymbol(symbol: Symbol): Declaration | undefined { + return forEach(symbol.declarations, d => isAliasSymbolDeclaration(d) ? d : undefined); } function getTargetOfImportEqualsDeclaration(node: ImportEqualsDeclaration): Symbol { @@ -1191,6 +1191,7 @@ namespace ts { if (!links.target) { links.target = resolvingSymbol; const node = getDeclarationOfAliasSymbol(symbol); + Debug.assert(!!node); const target = getTargetOfAliasDeclaration(node); if (links.target === resolvingSymbol) { links.target = target || unknownSymbol; @@ -1226,6 +1227,7 @@ namespace ts { if (!links.referenced) { links.referenced = true; const node = getDeclarationOfAliasSymbol(symbol); + Debug.assert(!!node); if (node.kind === SyntaxKind.ExportAssignment) { // export default checkExpressionCached((node).expression); diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index 6406455..e1175c4 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -885,7 +885,7 @@ namespace ts { function convertCompilerOptionsFromJsonWorker(jsonOptions: any, basePath: string, errors: Diagnostic[], configFileName?: string): CompilerOptions { - const options: CompilerOptions = getBaseFileName(configFileName) === "jsconfig.json" ? { allowJs: true } : {}; + const options: CompilerOptions = getBaseFileName(configFileName) === "jsconfig.json" ? { allowJs: true, maxNodeModuleJsDepth: 2 } : {}; convertOptionsFromJson(optionDeclarations, jsonOptions, basePath, options, Diagnostics.Unknown_compiler_option_0, errors); return options; } diff --git a/src/compiler/program.ts b/src/compiler/program.ts index f099d85..49f6198 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -1101,7 +1101,7 @@ namespace ts { // - This calls resolveModuleNames, and then calls findSourceFile for each resolved module. // As all these operations happen - and are nested - within the createProgram call, they close over the below variables. // The current resolution depth is tracked by incrementing/decrementing as the depth first search progresses. - const maxNodeModulesJsDepth = typeof options.maxNodeModuleJsDepth === "number" ? options.maxNodeModuleJsDepth : 2; + const maxNodeModulesJsDepth = typeof options.maxNodeModuleJsDepth === "number" ? options.maxNodeModuleJsDepth : 0; let currentNodeModulesDepth = 0; // If a module has some of its imports skipped due to being at the depth limit under node_modules, then track diff --git a/src/services/services.ts b/src/services/services.ts index babb5cf..a55f2cf 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -280,11 +280,14 @@ namespace ts { let pos = this.pos; const useJSDocScanner = this.kind >= SyntaxKind.FirstJSDocTagNode && this.kind <= SyntaxKind.LastJSDocTagNode; const processNode = (node: Node) => { - if (pos < node.pos) { + const isJSDocTagNode = isJSDocTag(node); + if (!isJSDocTagNode && pos < node.pos) { pos = this.addSyntheticNodes(children, pos, node.pos, useJSDocScanner); } children.push(node); - pos = node.end; + if (!isJSDocTagNode) { + pos = node.end; + } }; const processNodes = (nodes: NodeArray) => { if (pos < nodes.pos) { @@ -299,10 +302,6 @@ namespace ts { processNode(jsDocComment); } } - // For syntactic classifications, all trivia are classcified together, including jsdoc comments. - // For that to work, the jsdoc comments should still be the leading trivia of the first child. - // Restoring the scanner position ensures that. - pos = this.pos; forEachChild(this, processNode, processNodes); if (pos < this.end) { this.addSyntheticNodes(children, pos, this.end); diff --git a/src/services/utilities.ts b/src/services/utilities.ts index 858f889..9b34696 100644 --- a/src/services/utilities.ts +++ b/src/services/utilities.ts @@ -930,7 +930,8 @@ namespace ts { const options: TranspileOptions = { fileName: "config.js", compilerOptions: { - target: ScriptTarget.ES6 + target: ScriptTarget.ES6, + removeComments: true }, reportDiagnostics: true };