Skip to content

Commit 4c35296

Browse files
committed
Merge branch 'master' into jsdoc-string-literal-types
2 parents e5973b8 + 18fb33d commit 4c35296

File tree

616 files changed

+17355
-33132
lines changed

Some content is hidden

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

616 files changed

+17355
-33132
lines changed

.travis.yml

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,24 @@ node_js:
77

88
sudo: false
99

10-
os:
11-
- linux
12-
- osx
13-
1410
matrix:
1511
fast_finish: true
16-
exclude:
17-
- os: osx
18-
node_js: '4'
12+
include:
1913
- os: osx
20-
node_js: '0.10'
14+
node_js: stable
15+
osx_image: xcode7.3
2116

2217
branches:
2318
only:
2419
- master
25-
- transforms
20+
- transforms
21+
22+
install:
23+
- npm uninstall typescript
24+
- npm uninstall tslint
25+
- npm install
26+
- npm update
27+
28+
cache:
29+
directories:
30+
- node_modules

Gulpfile.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ const cmdLineOptions = minimist(process.argv.slice(2), {
5959
browser: process.env.browser || process.env.b || "IE",
6060
tests: process.env.test || process.env.tests || process.env.t,
6161
light: process.env.light || false,
62-
port: process.env.port || process.env.p || "8888",
6362
reporter: process.env.reporter || process.env.r,
6463
lint: process.env.lint || true,
6564
files: process.env.f || process.env.file || process.env.files || "",
@@ -766,7 +765,7 @@ function writeTestConfigFile(tests: string, light: boolean, taskConfigsFolder?:
766765
}
767766

768767

769-
gulp.task("runtests-browser", "Runs the tests using the built run.js file like 'gulp runtests'. Syntax is gulp runtests-browser. Additional optional parameters --tests=[regex], --port=, --browser=[chrome|IE]", ["browserify", nodeServerOutFile], (done) => {
768+
gulp.task("runtests-browser", "Runs the tests using the built run.js file like 'gulp runtests'. Syntax is gulp runtests-browser. Additional optional parameters --tests=[regex], --browser=[chrome|IE]", ["browserify", nodeServerOutFile], (done) => {
770769
cleanTestDirs((err) => {
771770
if (err) { console.error(err); done(err); process.exit(1); }
772771
host = "node";
@@ -781,9 +780,6 @@ gulp.task("runtests-browser", "Runs the tests using the built run.js file like '
781780
}
782781

783782
const args = [nodeServerOutFile];
784-
if (cmdLineOptions["port"]) {
785-
args.push(cmdLineOptions["port"]);
786-
}
787783
if (cmdLineOptions["browser"]) {
788784
args.push(cmdLineOptions["browser"]);
789785
}
@@ -960,6 +956,7 @@ const lintTargets = [
960956
"src/server/**/*.ts",
961957
"scripts/tslint/**/*.ts",
962958
"src/services/**/*.ts",
959+
"tests/*.ts", "tests/webhost/*.ts" // Note: does *not* descend recursively
963960
];
964961

965962

Jakefile.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -847,11 +847,10 @@ task("browserify", ["tests", builtLocalDirectory, nodeServerOutFile], function()
847847
exec(cmd);
848848
}, {async: true});
849849

850-
desc("Runs the tests using the built run.js file like 'jake runtests'. Syntax is jake runtests-browser. Additional optional parameters tests=[regex], port=, browser=[chrome|IE]");
850+
desc("Runs the tests using the built run.js file like 'jake runtests'. Syntax is jake runtests-browser. Additional optional parameters tests=[regex], browser=[chrome|IE]");
851851
task("runtests-browser", ["tests", "browserify", builtLocalDirectory, servicesFileInBrowserTest], function() {
852852
cleanTestDirs();
853853
host = "node";
854-
port = process.env.port || process.env.p || '8888';
855854
browser = process.env.browser || process.env.b || "IE";
856855
tests = process.env.test || process.env.tests || process.env.t;
857856
var light = process.env.light || false;
@@ -864,7 +863,7 @@ task("runtests-browser", ["tests", "browserify", builtLocalDirectory, servicesFi
864863
}
865864

866865
tests = tests ? tests : '';
867-
var cmd = host + " tests/webTestServer.js " + port + " " + browser + " " + JSON.stringify(tests);
866+
var cmd = host + " tests/webTestServer.js " + browser + " " + JSON.stringify(tests);
868867
console.log(cmd);
869868
exec(cmd);
870869
}, {async: true});
@@ -1042,7 +1041,8 @@ var lintTargets = compilerSources
10421041
.concat(serverCoreSources)
10431042
.concat(tslintRulesFiles)
10441043
.concat(servicesSources)
1045-
.concat(["Gulpfile.ts"]);
1044+
.concat(["Gulpfile.ts"])
1045+
.concat([nodeServerInFile, perftscPath, "tests/perfsys.ts", webhostPath]);
10461046

10471047

10481048
desc("Runs tslint on the compiler sources. Optional arguments are: f[iles]=regex");

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
"run-sequence": "latest",
7373
"sorcery": "latest",
7474
"through2": "latest",
75-
"ts-node": "~1.1.0",
75+
"ts-node": "latest",
7676
"tslint": "next",
7777
"typescript": "next"
7878
},

src/compiler/binder.ts

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -618,18 +618,10 @@ namespace ts {
618618
return false;
619619
}
620620

621-
function isNarrowingNullCheckOperands(expr1: Expression, expr2: Expression) {
622-
return (expr1.kind === SyntaxKind.NullKeyword || expr1.kind === SyntaxKind.Identifier && (<Identifier>expr1).text === "undefined") && isNarrowableOperand(expr2);
623-
}
624-
625621
function isNarrowingTypeofOperands(expr1: Expression, expr2: Expression) {
626622
return expr1.kind === SyntaxKind.TypeOfExpression && isNarrowableOperand((<TypeOfExpression>expr1).expression) && expr2.kind === SyntaxKind.StringLiteral;
627623
}
628624

629-
function isNarrowingDiscriminant(expr: Expression) {
630-
return expr.kind === SyntaxKind.PropertyAccessExpression && isNarrowableReference((<PropertyAccessExpression>expr).expression);
631-
}
632-
633625
function isNarrowingBinaryExpression(expr: BinaryExpression) {
634626
switch (expr.operatorToken.kind) {
635627
case SyntaxKind.EqualsToken:
@@ -638,9 +630,8 @@ namespace ts {
638630
case SyntaxKind.ExclamationEqualsToken:
639631
case SyntaxKind.EqualsEqualsEqualsToken:
640632
case SyntaxKind.ExclamationEqualsEqualsToken:
641-
return isNarrowingNullCheckOperands(expr.right, expr.left) || isNarrowingNullCheckOperands(expr.left, expr.right) ||
642-
isNarrowingTypeofOperands(expr.right, expr.left) || isNarrowingTypeofOperands(expr.left, expr.right) ||
643-
isNarrowingDiscriminant(expr.left) || isNarrowingDiscriminant(expr.right);
633+
return isNarrowableOperand(expr.left) || isNarrowableOperand(expr.right) ||
634+
isNarrowingTypeofOperands(expr.right, expr.left) || isNarrowingTypeofOperands(expr.left, expr.right);
644635
case SyntaxKind.InstanceOfKeyword:
645636
return isNarrowableOperand(expr.left);
646637
case SyntaxKind.CommaToken:
@@ -664,11 +655,6 @@ namespace ts {
664655
return isNarrowableReference(expr);
665656
}
666657

667-
function isNarrowingSwitchStatement(switchStatement: SwitchStatement) {
668-
const expr = switchStatement.expression;
669-
return expr.kind === SyntaxKind.PropertyAccessExpression && isNarrowableReference((<PropertyAccessExpression>expr).expression);
670-
}
671-
672658
function createBranchLabel(): FlowLabel {
673659
return {
674660
flags: FlowFlags.BranchLabel,
@@ -718,7 +704,7 @@ namespace ts {
718704
}
719705

720706
function createFlowSwitchClause(antecedent: FlowNode, switchStatement: SwitchStatement, clauseStart: number, clauseEnd: number): FlowNode {
721-
if (!isNarrowingSwitchStatement(switchStatement)) {
707+
if (!isNarrowingExpression(switchStatement.expression)) {
722708
return antecedent;
723709
}
724710
setFlowNodeReferenced(antecedent);
@@ -1983,7 +1969,7 @@ namespace ts {
19831969
function bindThisPropertyAssignment(node: BinaryExpression) {
19841970
// Declare a 'member' in case it turns out the container was an ES5 class or ES6 constructor
19851971
let assignee: Node;
1986-
if (container.kind === SyntaxKind.FunctionDeclaration || container.kind === SyntaxKind.FunctionDeclaration) {
1972+
if (container.kind === SyntaxKind.FunctionDeclaration || container.kind === SyntaxKind.FunctionExpression) {
19871973
assignee = container;
19881974
}
19891975
else if (container.kind === SyntaxKind.Constructor) {

0 commit comments

Comments
 (0)