Skip to content

Commit 3071814

Browse files
author
zhengbli
committed
Merge branch 'master' of https://github.com/Microsoft/TypeScript into i8334
2 parents 269416d + f9412f8 commit 3071814

307 files changed

Lines changed: 6831 additions & 901 deletions

File tree

Some content is hidden

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

Jakefile.js

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,12 @@ var es2016LibrarySourceMap = es2016LibrarySource.map(function(source) {
187187
return { target: "lib." + source, sources: ["header.d.ts", source] };
188188
})
189189

190+
var es2017LibrarySource = ["es2017.object.d.ts"];
191+
192+
var es2017LibrarySourceMap = es2017LibrarySource.map(function(source) {
193+
return { target: "lib." + source, sources: ["header.d.ts", source] };
194+
})
195+
190196
var hostsLibrarySources = ["dom.generated.d.ts", "webworker.importscripts.d.ts", "scripthost.d.ts"]
191197

192198
var librarySourceMap = [
@@ -200,11 +206,12 @@ var librarySourceMap = [
200206
{ target: "lib.es5.d.ts", sources: ["header.d.ts", "es5.d.ts"] },
201207
{ target: "lib.es2015.d.ts", sources: ["header.d.ts", "es2015.d.ts"] },
202208
{ target: "lib.es2016.d.ts", sources: ["header.d.ts", "es2016.d.ts"] },
209+
{ target: "lib.es2017.d.ts", sources: ["header.d.ts", "es2017.d.ts"] },
203210

204211
// JavaScript + all host library
205212
{ target: "lib.d.ts", sources: ["header.d.ts", "es5.d.ts"].concat(hostsLibrarySources), },
206213
{ target: "lib.es6.d.ts", sources: ["header.d.ts", "es5.d.ts"].concat(es2015LibrarySources, hostsLibrarySources, "dom.iterable.d.ts"), },
207-
].concat(es2015LibrarySourceMap, es2016LibrarySourceMap);
214+
].concat(es2015LibrarySourceMap, es2016LibrarySourceMap, es2017LibrarySourceMap);
208215

209216
var libraryTargets = librarySourceMap.map(function (f) {
210217
return path.join(builtLocalDirectory, f.target);
@@ -705,6 +712,7 @@ function runConsoleTests(defaultReporter, defaultSubsets) {
705712
colors = process.env.colors || process.env.color
706713
colors = colors ? ' --no-colors ' : ' --colors ';
707714
reporter = process.env.reporter || process.env.r || defaultReporter;
715+
var lintFlag = process.env.lint !== 'false';
708716

709717
// timeout normally isn't necessary but Travis-CI has been timing out on compiler baselines occasionally
710718
// default timeout is 2sec which really should be enough, but maybe we just need a small amount longer
@@ -723,7 +731,7 @@ function runConsoleTests(defaultReporter, defaultSubsets) {
723731
console.log(cmd);
724732
exec(cmd, function () {
725733
deleteTemporaryProjectOutput();
726-
if (i === 0) {
734+
if (lintFlag && i === 0) {
727735
var lint = jake.Task['lint'];
728736
lint.addListener('complete', function () {
729737
complete();
@@ -743,7 +751,7 @@ task("runtests-parallel", ["build-rules", "tests", builtLocalDirectory], functio
743751
runConsoleTests('min', ['compiler', 'conformance', 'Projects', 'fourslash']);
744752
}, {async: true});
745753

746-
desc("Runs the tests using the built run.js file. Optional arguments are: t[ests]=regex r[eporter]=[list|spec|json|<more>] d[ebug]=true color[s]=false.");
754+
desc("Runs the tests using the built run.js file. Optional arguments are: t[ests]=regex r[eporter]=[list|spec|json|<more>] d[ebug]=true color[s]=false lint=true.");
747755
task("runtests", ["build-rules", "tests", builtLocalDirectory], function() {
748756
runConsoleTests('mocha-fivemat-progress-reporter', []);
749757
}, {async: true});
@@ -954,6 +962,7 @@ function lintFileAsync(options, path, cb) {
954962

955963
var servicesLintTargets = [
956964
"navigateTo.ts",
965+
"navigationBar.ts",
957966
"outliningElementsCollector.ts",
958967
"patternMatcher.ts",
959968
"services.ts",
@@ -968,15 +977,19 @@ var lintTargets = compilerSources
968977
.concat(tslintRulesFiles)
969978
.concat(servicesLintTargets);
970979

971-
desc("Runs tslint on the compiler sources");
980+
desc("Runs tslint on the compiler sources. Optional arguments are: f[iles]=regex");
972981
task("lint", ["build-rules"], function() {
973982
var lintOptions = getLinterOptions();
974983
var failed = 0;
984+
var fileMatcher = RegExp(process.env.f || process.env.file || process.env.files || "");
975985
for (var i in lintTargets) {
976-
var result = lintFile(lintOptions, lintTargets[i]);
977-
if (result.failureCount > 0) {
978-
console.log(result.output);
979-
failed += result.failureCount;
986+
var target = lintTargets[i];
987+
if (fileMatcher.test(target)) {
988+
var result = lintFile(lintOptions, target);
989+
if (result.failureCount > 0) {
990+
console.log(result.output);
991+
failed += result.failureCount;
992+
}
980993
}
981994
}
982995
if (failed > 0) {

scripts/configureNightly.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ function getNightlyVersionString(versionString: string): string {
6767
const now = new Date();
6868
const timeStr = now.toISOString().replace(/:|T|\.|-/g, "").slice(0, 8);
6969

70-
return `${versionString}-dev.${timeStr}`;
70+
return `${versionString}-dev.${timeStr}-1.0`;
7171
}
7272

7373
main();

src/compiler/binder.ts

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,9 @@ namespace ts {
580580
case SyntaxKind.BinaryExpression:
581581
bindBinaryExpressionFlow(<BinaryExpression>node);
582582
break;
583+
case SyntaxKind.DeleteExpression:
584+
bindDeleteExpressionFlow(<DeleteExpression>node);
585+
break;
583586
case SyntaxKind.ConditionalExpression:
584587
bindConditionalExpressionFlow(<ConditionalExpression>node);
585588
break;
@@ -696,23 +699,6 @@ namespace ts {
696699
};
697700
}
698701

699-
function skipSimpleConditionalFlow(flow: FlowNode) {
700-
// We skip over simple conditional flows of the form 'x ? aaa : bbb', where 'aaa' and 'bbb' contain
701-
// no constructs that affect control flow type analysis. Such simple flows have no effect on the
702-
// code paths that follow and ignoring them means we'll do less work.
703-
if (flow.flags & FlowFlags.BranchLabel && (<FlowLabel>flow).antecedents.length === 2) {
704-
const a = (<FlowLabel>flow).antecedents[0];
705-
const b = (<FlowLabel>flow).antecedents[1];
706-
if ((a.flags & FlowFlags.TrueCondition && b.flags & FlowFlags.FalseCondition ||
707-
a.flags & FlowFlags.FalseCondition && b.flags & FlowFlags.TrueCondition) &&
708-
(<FlowCondition>a).antecedent === (<FlowCondition>b).antecedent &&
709-
(<FlowCondition>a).expression === (<FlowCondition>b).expression) {
710-
return (<FlowCondition>a).antecedent;
711-
}
712-
}
713-
return flow;
714-
}
715-
716702
function finishFlowLabel(flow: FlowLabel): FlowNode {
717703
const antecedents = flow.antecedents;
718704
if (!antecedents) {
@@ -721,7 +707,7 @@ namespace ts {
721707
if (antecedents.length === 1) {
722708
return antecedents[0];
723709
}
724-
return skipSimpleConditionalFlow(flow);
710+
return flow;
725711
}
726712

727713
function isStatementCondition(node: Node) {
@@ -1072,6 +1058,13 @@ namespace ts {
10721058
}
10731059
}
10741060

1061+
function bindDeleteExpressionFlow(node: DeleteExpression) {
1062+
forEachChild(node, bind);
1063+
if (node.expression.kind === SyntaxKind.PropertyAccessExpression) {
1064+
bindAssignmentTargetFlow(node.expression);
1065+
}
1066+
}
1067+
10751068
function bindConditionalExpressionFlow(node: ConditionalExpression) {
10761069
const trueLabel = createBranchLabel();
10771070
const falseLabel = createBranchLabel();

0 commit comments

Comments
 (0)