Skip to content

Commit ebfcd25

Browse files
committed
merge with master
2 parents eb04f32 + 1b5dc0d commit ebfcd25

586 files changed

Lines changed: 6942 additions & 2978 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.

.npmignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@ doc
33
scripts
44
src
55
tests
6+
internal
7+
tslint.json
68
Jakefile.js
7-
.travis.yml
9+
.editorconfig
10+
.gitattributes
811
.settings/
12+
.travis.yml
913
.vscode/

Jakefile.js

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -628,10 +628,9 @@ function deleteTemporaryProjectOutput() {
628628

629629
var testTimeout = 20000;
630630
desc("Runs the tests using the built run.js file. Syntax is jake runtests. Optional parameters 'host=', 'tests=[regex], reporter=[list|spec|json|<more>]', debug=true.");
631-
task("runtests", ["tests", builtLocalDirectory], function() {
631+
task("runtests", ["build-rules", "tests", builtLocalDirectory], function() {
632632
cleanTestDirs();
633633
var debug = process.env.debug || process.env.d;
634-
host = "mocha"
635634
tests = process.env.test || process.env.tests || process.env.t;
636635
var light = process.env.light || false;
637636
var testConfigFile = 'test.config';
@@ -653,9 +652,16 @@ task("runtests", ["tests", builtLocalDirectory], function() {
653652
reporter = process.env.reporter || process.env.r || 'mocha-fivemat-progress-reporter';
654653
// timeout normally isn't necessary but Travis-CI has been timing out on compiler baselines occasionally
655654
// default timeout is 2sec which really should be enough, but maybe we just need a small amount longer
656-
var cmd = host + (debug ? " --debug-brk" : "") + " -R " + reporter + tests + colors + ' -t ' + testTimeout + ' ' + run;
655+
var cmd = "mocha" + (debug ? " --debug-brk" : "") + " -R " + reporter + tests + colors + ' -t ' + testTimeout + ' ' + run;
657656
console.log(cmd);
658-
exec(cmd, deleteTemporaryProjectOutput);
657+
exec(cmd, function() {
658+
deleteTemporaryProjectOutput();
659+
var lint = jake.Task['lint'];
660+
lint.addListener('complete', function () {
661+
complete();
662+
});
663+
lint.invoke();
664+
});
659665
}, {async: true});
660666

661667
desc("Generates code coverage data via instanbul");
@@ -825,7 +831,7 @@ var tslintRulesOutFiles = tslintRules.map(function(p) {
825831
desc("Compiles tslint rules to js");
826832
task("build-rules", tslintRulesOutFiles);
827833
tslintRulesFiles.forEach(function(ruleFile, i) {
828-
compileFile(tslintRulesOutFiles[i], [ruleFile], [ruleFile], [], /*useBuiltCompiler*/ true, /*noOutFile*/ true, /*generateDeclarations*/ false, path.join(builtLocalDirectory, "tslint"));
834+
compileFile(tslintRulesOutFiles[i], [ruleFile], [ruleFile], [], /*useBuiltCompiler*/ false, /*noOutFile*/ true, /*generateDeclarations*/ false, path.join(builtLocalDirectory, "tslint"));
829835
});
830836

831837
function getLinterOptions() {
@@ -859,8 +865,6 @@ function lintFileAsync(options, path, cb) {
859865

860866
var lintTargets = compilerSources.concat(harnessCoreSources);
861867

862-
// if the codebase were free of linter errors we could make jake runtests
863-
// run this task automatically
864868
desc("Runs tslint on the compiler sources");
865869
task("lint", ["build-rules"], function() {
866870
var lintOptions = getLinterOptions();

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
},
4141
"scripts": {
4242
"pretest": "jake tests",
43-
"test": "jake runtests && npm run lint",
43+
"test": "jake runtests",
4444
"build": "npm run build:compiler && npm run build:tests",
4545
"build:compiler": "jake local",
4646
"build:tests": "jake tests",

src/compiler/binder.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,9 @@ namespace ts {
207207
function declareSymbol(symbolTable: SymbolTable, parent: Symbol, node: Declaration, includes: SymbolFlags, excludes: SymbolFlags): Symbol {
208208
Debug.assert(!hasDynamicName(node));
209209

210+
let isDefaultExport = node.flags & NodeFlags.Default;
210211
// The exported symbol for an export default function/class node is always named "default"
211-
let name = node.flags & NodeFlags.Default && parent ? "default" : getDeclarationName(node);
212+
let name = isDefaultExport && parent ? "default" : getDeclarationName(node);
212213

213214
let symbol: Symbol;
214215
if (name !== undefined) {
@@ -249,6 +250,13 @@ namespace ts {
249250
let message = symbol.flags & SymbolFlags.BlockScopedVariable
250251
? Diagnostics.Cannot_redeclare_block_scoped_variable_0
251252
: Diagnostics.Duplicate_identifier_0;
253+
254+
forEach(symbol.declarations, declaration => {
255+
if (declaration.flags & NodeFlags.Default) {
256+
message = Diagnostics.A_module_cannot_have_multiple_default_exports;
257+
}
258+
});
259+
252260
forEach(symbol.declarations, declaration => {
253261
file.bindDiagnostics.push(createDiagnosticForNode(declaration.name || declaration, message, getDisplayName(declaration)));
254262
});

0 commit comments

Comments
 (0)