Skip to content

Commit 579748b

Browse files
committed
Merge branch 'master' into requireJson
2 parents ce08af4 + 33ba250 commit 579748b

File tree

485 files changed

+13245
-4390
lines changed

Some content is hidden

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

485 files changed

+13245
-4390
lines changed

.gitmodules

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,23 @@
1818
path = tests/cases/user/TypeScript-WeChat-Starter/TypeScript-WeChat-Starter
1919
url = https://github.com/Microsoft/TypeScript-WeChat-Starter.git
2020
ignore = all
21+
[submodule "tests/cases/user/create-react-app/create-react-app"]
22+
path = tests/cases/user/create-react-app/create-react-app
23+
url = https://github.com/facebook/create-react-app.git
24+
ignore = all
2125
[submodule "tests/cases/user/webpack/webpack"]
2226
path = tests/cases/user/webpack/webpack
2327
url = https://github.com/webpack/webpack.git
2428
ignore = all
29+
[submodule "tests/cases/user/puppeteer/puppeteer"]
30+
path = tests/cases/user/puppeteer/puppeteer
31+
url = https://github.com/GoogleChrome/puppeteer.git
32+
ignore = all
33+
[submodule "tests/cases/user/axios-src/axios-src"]
34+
path = tests/cases/user/axios-src/axios-src
35+
url = https://github.com/axios/axios.git
36+
ignore = all
37+
[submodule "tests/cases/user/prettier/prettier"]
38+
path = tests/cases/user/prettier/prettier
39+
url = https://github.com/prettier/prettier.git
40+
ignore = all

Gulpfile.ts renamed to Gulpfile.js

Lines changed: 126 additions & 131 deletions
Large diffs are not rendered by default.

Jakefile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ compileFile(/*outfile*/configurePrereleaseJs,
491491
/*prereqs*/[configurePrereleaseTs],
492492
/*prefixes*/[],
493493
/*useBuiltCompiler*/ false,
494-
{ noOutFile: false, generateDeclarations: false, keepComments: false, noResolve: false, stripInternal: false });
494+
{ noOutFile: true, generateDeclarations: false, keepComments: false, noResolve: false, stripInternal: false });
495495

496496
task("setDebugMode", function () {
497497
useDebugMode = true;

issue_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Please help us by doing the following steps before logging an issue:
2424
-->
2525

2626
<!-- Please try to reproduce the issue with `typescript@next`. It may have already been fixed. -->
27-
**TypeScript Version:** 2.7.0-dev.201xxxxx
27+
**TypeScript Version:** 2.9.0-dev.201xxxxx
2828

2929
<!-- Search terms you tried before logging this (so others can find this issue more easily) -->
3030
**Search Terms:**

package-lock.json

Lines changed: 670 additions & 892 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,12 @@
4848
"@types/q": "latest",
4949
"@types/run-sequence": "latest",
5050
"@types/through2": "latest",
51+
"@types/travis-fold": "latest",
5152
"@types/xml2js": "^0.4.0",
52-
"xml2js": "^0.4.19",
5353
"browser-resolve": "^1.11.2",
5454
"browserify": "latest",
5555
"chai": "latest",
56+
"chalk": "latest",
5657
"convert-source-map": "latest",
5758
"del": "latest",
5859
"gulp": "3.X",
@@ -76,11 +77,10 @@
7677
"source-map-support": "latest",
7778
"through2": "latest",
7879
"travis-fold": "latest",
79-
"ts-node": "latest",
8080
"tslint": "latest",
81+
"typescript": "next",
8182
"vinyl": "latest",
82-
"chalk": "latest",
83-
"typescript": "next"
83+
"xml2js": "^0.4.19"
8484
},
8585
"scripts": {
8686
"pretest": "jake tests",

scripts/buildProtocol.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ function writeProtocolFile(outputFile: string, protocolTs: string, typeScriptSer
178178
ts.sys.writeFile(outputFile, protocolDts);
179179

180180
if (diagnostics.length) {
181-
const flattenedDiagnostics = diagnostics.map(d => `${ts.flattenDiagnosticMessageText(d.messageText, "\n")} at ${d.file.fileName} line ${d.start}`).join("\n");
181+
const flattenedDiagnostics = diagnostics.map(d => `${ts.flattenDiagnosticMessageText(d.messageText, "\n")} at ${d.file ? d.file.fileName : "<unknown>"} line ${d.start}`).join("\n");
182182
throw new Error(`Unexpected errors during sanity check: ${flattenedDiagnostics}`);
183183
}
184184
}

scripts/configurePrerelease.ts

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
/// <reference path="../src/compiler/sys.ts" />
1+
/// <reference types="node"/>
2+
import { normalize } from "path";
3+
import assert = require("assert");
4+
import { readFileSync, writeFileSync } from "fs";
5+
const args = process.argv.slice(2);
6+
27

38
/**
49
* A minimal description for a parsed package.json object.
@@ -10,28 +15,27 @@ interface PackageJson {
1015
}
1116

1217
function main(): void {
13-
const sys = ts.sys;
14-
if (sys.args.length < 3) {
15-
sys.write("Usage:" + sys.newLine)
16-
sys.write("\tnode configureNightly.js <dev|insiders> <package.json location> <file containing version>" + sys.newLine);
18+
if (args.length < 3) {
19+
console.log("Usage:");
20+
console.log("\tnode configureNightly.js <dev|insiders> <package.json location> <file containing version>");
1721
return;
1822
}
1923

20-
const tag = sys.args[0];
24+
const tag = args[0];
2125
if (tag !== "dev" && tag !== "insiders") {
2226
throw new Error(`Unexpected tag name '${tag}'.`);
2327
}
2428

2529
// Acquire the version from the package.json file and modify it appropriately.
26-
const packageJsonFilePath = ts.normalizePath(sys.args[1]);
27-
const packageJsonValue: PackageJson = JSON.parse(sys.readFile(packageJsonFilePath));
30+
const packageJsonFilePath = normalize(args[1]);
31+
const packageJsonValue: PackageJson = JSON.parse(readFileSync(packageJsonFilePath).toString());
2832

2933
const { majorMinor, patch } = parsePackageJsonVersion(packageJsonValue.version);
3034
const prereleasePatch = getPrereleasePatch(tag, patch);
3135

3236
// Acquire and modify the source file that exposes the version string.
33-
const tsFilePath = ts.normalizePath(sys.args[2]);
34-
const tsFileContents = ts.sys.readFile(tsFilePath);
37+
const tsFilePath = normalize(args[2]);
38+
const tsFileContents = readFileSync(tsFilePath).toString();
3539
const modifiedTsFileContents = updateTsFile(tsFilePath, tsFileContents, majorMinor, patch, prereleasePatch);
3640

3741
// Ensure we are actually changing something - the user probably wants to know that the update failed.
@@ -44,20 +48,20 @@ function main(): void {
4448
// Finally write the changes to disk.
4549
// Modify the package.json structure
4650
packageJsonValue.version = `${majorMinor}.${prereleasePatch}`;
47-
sys.writeFile(packageJsonFilePath, JSON.stringify(packageJsonValue, /*replacer:*/ undefined, /*space:*/ 4))
48-
sys.writeFile(tsFilePath, modifiedTsFileContents);
51+
writeFileSync(packageJsonFilePath, JSON.stringify(packageJsonValue, /*replacer:*/ undefined, /*space:*/ 4))
52+
writeFileSync(tsFilePath, modifiedTsFileContents);
4953
}
5054

5155
function updateTsFile(tsFilePath: string, tsFileContents: string, majorMinor: string, patch: string, nightlyPatch: string): string {
5256
const majorMinorRgx = /export const versionMajorMinor = "(\d+\.\d+)"/;
5357
const majorMinorMatch = majorMinorRgx.exec(tsFileContents);
54-
ts.Debug.assert(majorMinorMatch !== null, "", () => `The file seems to no longer have a string matching '${majorMinorRgx}'.`);
58+
assert(majorMinorMatch !== null, `The file seems to no longer have a string matching '${majorMinorRgx}'.`);
5559
const parsedMajorMinor = majorMinorMatch[1];
56-
ts.Debug.assert(parsedMajorMinor === majorMinor, "versionMajorMinor does not match.", () => `${tsFilePath}: '${parsedMajorMinor}'; package.json: '${majorMinor}'`);
60+
assert(parsedMajorMinor === majorMinor, `versionMajorMinor does not match. ${tsFilePath}: '${parsedMajorMinor}'; package.json: '${majorMinor}'`);
5761

5862
const versionRgx = /export const version = `\$\{versionMajorMinor\}\.(\d)(-dev)?`;/;
5963
const patchMatch = versionRgx.exec(tsFileContents);
60-
ts.Debug.assert(patchMatch !== null, "The file seems to no longer have a string matching", () => versionRgx.toString());
64+
assert(patchMatch !== null, "The file seems to no longer have a string matching " + versionRgx.toString());
6165
const parsedPatch = patchMatch[1];
6266
if (parsedPatch !== patch) {
6367
throw new Error(`patch does not match. ${tsFilePath}: '${parsedPatch}; package.json: '${patch}'`);
@@ -69,7 +73,7 @@ function updateTsFile(tsFilePath: string, tsFileContents: string, majorMinor: st
6973
function parsePackageJsonVersion(versionString: string): { majorMinor: string, patch: string } {
7074
const versionRgx = /(\d+\.\d+)\.(\d+)($|\-)/;
7175
const match = versionString.match(versionRgx);
72-
ts.Debug.assert(match !== null, "package.json 'version' should match", () => versionRgx.toString());
76+
assert(match !== null, "package.json 'version' should match " + versionRgx.toString());
7377
return { majorMinor: match[1], patch: match[2] };
7478
}
7579

scripts/types/ambient.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,3 @@ declare module "gulp-insert" {
1414
}
1515

1616
declare module "sorcery";
17-
declare module "travis-fold";

src/compiler/binder.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -520,8 +520,9 @@ namespace ts {
520520
const saveReturnTarget = currentReturnTarget;
521521
const saveActiveLabels = activeLabels;
522522
const saveHasExplicitReturn = hasExplicitReturn;
523-
const isIIFE = containerFlags & ContainerFlags.IsFunctionExpression && !hasModifier(node, ModifierFlags.Async) && !!getImmediatelyInvokedFunctionExpression(node);
524-
// A non-async IIFE is considered part of the containing control flow. Return statements behave
523+
const isIIFE = containerFlags & ContainerFlags.IsFunctionExpression && !hasModifier(node, ModifierFlags.Async) &&
524+
!(<FunctionLikeDeclaration>node).asteriskToken && !!getImmediatelyInvokedFunctionExpression(node);
525+
// A non-async, non-generator IIFE is considered part of the containing control flow. Return statements behave
525526
// similarly to break statements that exit to a label just past the statement body.
526527
if (!isIIFE) {
527528
currentFlow = { flags: FlowFlags.Start };
@@ -2230,14 +2231,14 @@ namespace ts {
22302231
bindAnonymousDeclaration(file, SymbolFlags.ValueModule, `"${removeFileExtension(file.fileName)}"` as __String);
22312232
}
22322233

2233-
function bindExportAssignment(node: ExportAssignment | BinaryExpression) {
2234+
function bindExportAssignment(node: ExportAssignment) {
22342235
if (!container.symbol || !container.symbol.exports) {
22352236
// Export assignment in some sort of block construct
22362237
bindAnonymousDeclaration(node, SymbolFlags.Alias, getDeclarationName(node));
22372238
}
22382239
else {
22392240
const flags = node.kind === SyntaxKind.ExportAssignment && exportAssignmentIsAlias(node)
2240-
// An export default clause with an EntityNameExpression exports all meanings of that identifier
2241+
// An export default clause with an EntityNameExpression or a class expression exports all meanings of that identifier or expression;
22412242
? SymbolFlags.Alias
22422243
// An export default clause with any other expression exports a value
22432244
: SymbolFlags.Property;
@@ -2332,7 +2333,10 @@ namespace ts {
23322333

23332334
// 'module.exports = expr' assignment
23342335
setCommonJsModuleIndicator(node);
2335-
declareSymbol(file.symbol.exports, file.symbol, node, SymbolFlags.Property | SymbolFlags.ExportValue | SymbolFlags.ValueModule, SymbolFlags.None);
2336+
const flags = exportAssignmentIsAlias(node)
2337+
? SymbolFlags.Alias // An export= with an EntityNameExpression or a ClassExpression exports all meanings of that identifier or class
2338+
: SymbolFlags.Property | SymbolFlags.ExportValue | SymbolFlags.ValueModule;
2339+
declareSymbol(file.symbol.exports, file.symbol, node, flags, SymbolFlags.None);
23362340
}
23372341

23382342
function bindThisPropertyAssignment(node: BinaryExpression | PropertyAccessExpression) {

0 commit comments

Comments
 (0)