Skip to content

Commit

Permalink
2016-08-26 [ci skip] Version: 1.201608260007.1+0041d5ce7907f9ee974693…
Browse files Browse the repository at this point in the history
…ace54efd64afa1971a
  • Loading branch information
basarat committed Aug 26, 2016
1 parent f9f0ba3 commit 9ec404d
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 34 deletions.
22 changes: 12 additions & 10 deletions bin/ntypescript.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 */) {
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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 <symbol>
checkExpressionCached(node.expression);
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -50697,7 +50699,8 @@ var ts;
var options = {
fileName: "config.js",
compilerOptions: {
target: 2 /* ES6 */
target: 2 /* ES6 */,
removeComments: true
},
reportDiagnostics: true
};
Expand Down Expand Up @@ -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) {
Expand All @@ -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);
Expand Down
22 changes: 12 additions & 10 deletions bin/typescript.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 */) {
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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 <symbol>
checkExpressionCached(node.expression);
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -50697,7 +50699,8 @@ var ts;
var options = {
fileName: "config.js",
compilerOptions: {
target: 2 /* ES6 */
target: 2 /* ES6 */,
removeComments: true
},
reportDiagnostics: true
};
Expand Down Expand Up @@ -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) {
Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion kicktravis
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2016-08-25 [ci skip] Version: 1.201608250007.1+ddb5a00410d695d35b55c5482876a16f7c696c4b
2016-08-26 [ci skip] Version: 1.201608260007.1+0041d5ce7907f9ee974693ace54efd64afa1971a
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
6 changes: 4 additions & 2 deletions src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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 <symbol>
checkExpressionCached((<ExportAssignment>node).expression);
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/commandLineParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/program.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 5 additions & 6 deletions src/services/services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<Node>) => {
if (pos < nodes.pos) {
Expand All @@ -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);
Expand Down
3 changes: 2 additions & 1 deletion src/services/utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -930,7 +930,8 @@ namespace ts {
const options: TranspileOptions = {
fileName: "config.js",
compilerOptions: {
target: ScriptTarget.ES6
target: ScriptTarget.ES6,
removeComments: true
},
reportDiagnostics: true
};
Expand Down

0 comments on commit 9ec404d

Please sign in to comment.