@@ -132,10 +132,10 @@ var ts;
132
132
var ts;
133
133
(function (ts) {
134
134
ts.versionMajorMinor = "2.7";
135
- ts.version = ts.versionMajorMinor + ".2-dev.20180325 ";
135
+ ts.version = ts.versionMajorMinor + ".2";
136
136
})(ts || (ts = {}));
137
137
(function (ts) {
138
- ts.version_plus = "2.7.3 ";
138
+ ts.version_plus = "2.7.4 ";
139
139
})(ts || (ts = {}));
140
140
(function (ts) {
141
141
function isExternalModuleNameRelative(moduleName) {
@@ -54184,6 +54184,7 @@ var ts;
54184
54184
var rootFileNames;
54185
54185
var dependencyMap;
54186
54186
var pathWeightMap;
54187
+ var visitedBlocks;
54187
54188
function createMap() {
54188
54189
var map = Object.create(null);
54189
54190
map["__"] = undefined;
@@ -54194,12 +54195,14 @@ var ts;
54194
54195
sourceFiles = program.getSourceFiles();
54195
54196
rootFileNames = program.getRootFileNames();
54196
54197
checker = program.getTypeChecker();
54198
+ visitedBlocks = [];
54197
54199
buildDependencyMap();
54198
54200
var result = sortOnDependency();
54199
54201
sourceFiles = null;
54200
54202
rootFileNames = null;
54201
54203
checker = null;
54202
54204
dependencyMap = null;
54205
+ visitedBlocks = null;
54203
54206
return result;
54204
54207
}
54205
54208
ts.reorderSourceFiles = reorderSourceFiles;
@@ -54445,7 +54448,7 @@ var ts;
54445
54448
function visitDecorators(decorators) {
54446
54449
for (var _i = 0, decorators_2 = decorators; _i < decorators_2.length; _i++) {
54447
54450
var decorator = decorators_2[_i];
54448
- visitExpression (decorator.expression);
54451
+ visitCallExpression (decorator.expression);
54449
54452
}
54450
54453
}
54451
54454
function visitExpression(expression) {
@@ -54455,7 +54458,8 @@ var ts;
54455
54458
switch (expression.kind) {
54456
54459
case 183:
54457
54460
case 182:
54458
- visitCallExpression(expression);
54461
+ visitCallArguments(expression);
54462
+ visitCallExpression(expression.expression);
54459
54463
break;
54460
54464
case 71:
54461
54465
checkDependencyAtLocation(expression);
@@ -54573,13 +54577,15 @@ var ts;
54573
54577
}
54574
54578
});
54575
54579
}
54576
- function visitCallExpression (callExpression) {
54580
+ function visitCallArguments (callExpression) {
54577
54581
if (callExpression.arguments) {
54578
54582
callExpression.arguments.forEach(function (argument) {
54579
54583
visitExpression(argument);
54580
54584
});
54581
54585
}
54582
- var expression = escapeParenthesized(callExpression.expression);
54586
+ }
54587
+ function visitCallExpression(expression) {
54588
+ expression = escapeParenthesized(expression);
54583
54589
visitExpression(expression);
54584
54590
switch (expression.kind) {
54585
54591
case 187:
@@ -54588,10 +54594,61 @@ var ts;
54588
54594
break;
54589
54595
case 180:
54590
54596
case 71:
54591
- var callerFileName = getSourceFileOfNode(callExpression ).fileName;
54597
+ var callerFileName = getSourceFileOfNode(expression ).fileName;
54592
54598
checkCallTarget(callerFileName, expression);
54593
54599
break;
54600
+ case 182:
54601
+ visitReturnedFunction(expression.expression);
54602
+ break;
54603
+ }
54604
+ }
54605
+ function visitReturnedFunction(expression) {
54606
+ expression = escapeParenthesized(expression);
54607
+ var returnExpressions = [];
54608
+ if (expression.kind === 182) {
54609
+ var expressions = visitReturnedFunction(expression.expression);
54610
+ for (var _i = 0, expressions_2 = expressions; _i < expressions_2.length; _i++) {
54611
+ var returnExpression = expressions_2[_i];
54612
+ var returns = visitReturnedFunction(returnExpression);
54613
+ returnExpressions = returnExpressions.concat(returns);
54614
+ }
54615
+ return returnExpressions;
54616
+ }
54617
+ var functionBlocks = [];
54618
+ switch (expression.kind) {
54619
+ case 187:
54620
+ functionBlocks.push(expression.body);
54621
+ break;
54622
+ case 180:
54623
+ case 71:
54624
+ var callerFileName = getSourceFileOfNode(expression).fileName;
54625
+ var declarations = [];
54626
+ getForwardDeclarations(expression, declarations, callerFileName);
54627
+ for (var _a = 0, declarations_9 = declarations; _a < declarations_9.length; _a++) {
54628
+ var declaration = declarations_9[_a];
54629
+ var sourceFile = getSourceFileOfNode(declaration);
54630
+ if (!sourceFile || sourceFile.isDeclarationFile) {
54631
+ continue;
54632
+ }
54633
+ if (declaration.kind === 229 ||
54634
+ declaration.kind === 152) {
54635
+ functionBlocks.push(declaration.body);
54636
+ }
54637
+ }
54638
+ break;
54594
54639
}
54640
+ for (var _b = 0, functionBlocks_1 = functionBlocks; _b < functionBlocks_1.length; _b++) {
54641
+ var block = functionBlocks_1[_b];
54642
+ for (var _c = 0, _d = block.statements; _c < _d.length; _c++) {
54643
+ var statement = _d[_c];
54644
+ if (statement.kind === 220) {
54645
+ var returnExpression = statement.expression;
54646
+ returnExpressions.push(returnExpression);
54647
+ visitCallExpression(returnExpression);
54648
+ }
54649
+ }
54650
+ }
54651
+ return returnExpressions;
54595
54652
}
54596
54653
function escapeParenthesized(expression) {
54597
54654
if (expression.kind === 186) {
@@ -54602,11 +54659,11 @@ var ts;
54602
54659
function checkCallTarget(callerFileName, target) {
54603
54660
var declarations = [];
54604
54661
getForwardDeclarations(target, declarations, callerFileName);
54605
- for (var _i = 0, declarations_9 = declarations; _i < declarations_9 .length; _i++) {
54606
- var declaration = declarations_9 [_i];
54662
+ for (var _i = 0, declarations_10 = declarations; _i < declarations_10 .length; _i++) {
54663
+ var declaration = declarations_10 [_i];
54607
54664
var sourceFile = getSourceFileOfNode(declaration);
54608
54665
if (!sourceFile || sourceFile.isDeclarationFile) {
54609
- return ;
54666
+ continue ;
54610
54667
}
54611
54668
addDependency(callerFileName, sourceFile.fileName);
54612
54669
if (declaration.kind === 229 ||
@@ -54686,14 +54743,15 @@ var ts;
54686
54743
}
54687
54744
}
54688
54745
function visitBlock(block) {
54689
- if (!block || block.visitedBySorting ) {
54746
+ if (!block || visitedBlocks.indexOf(block) != -1 ) {
54690
54747
return;
54691
54748
}
54692
- block.visitedBySorting = true ;
54749
+ visitedBlocks.push(block) ;
54693
54750
for (var _i = 0, _a = block.statements; _i < _a.length; _i++) {
54694
54751
var statement = _a[_i];
54695
54752
visitStatement(statement);
54696
54753
}
54754
+ visitedBlocks.pop();
54697
54755
}
54698
54756
function visitVariableList(variables) {
54699
54757
if (!variables) {
0 commit comments