Skip to content

Commit a05f1e8

Browse files
committed
Merge pull request #2467 from Microsoft/exportEqualsMerged
Merge master into exportEquals
2 parents 7356775 + fad8892 commit a05f1e8

File tree

1,245 files changed

+27969
-9977
lines changed

Some content is hidden

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

1,245 files changed

+27969
-9977
lines changed

.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.js linguist-language=TypeScript

.travis.yml

+1-10
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,4 @@ language: node_js
33
node_js:
44
- '0.10'
55

6-
sudo: false
7-
8-
before_script: npm install -g codeclimate-test-reporter
9-
10-
after_script:
11-
- cat coverage/lcov.info | codeclimate
12-
13-
addons:
14-
code_climate:
15-
repo_token: 9852ac5362c8cc38c07ca5adc0f94c20c6c79bd78e17933dc284598a65338656
6+
sudo: false

Jakefile

+5-3
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ var compilerSources = [
3939
"utilities.ts",
4040
"binder.ts",
4141
"checker.ts",
42+
"declarationEmitter.ts",
4243
"emitter.ts",
4344
"program.ts",
4445
"commandLineParser.ts",
@@ -57,6 +58,7 @@ var servicesSources = [
5758
"utilities.ts",
5859
"binder.ts",
5960
"checker.ts",
61+
"declarationEmitter.ts",
6062
"emitter.ts",
6163
"program.ts",
6264
"commandLineParser.ts",
@@ -65,7 +67,7 @@ var servicesSources = [
6567
return path.join(compilerDirectory, f);
6668
}).concat([
6769
"breakpoints.ts",
68-
"navigateTo.ts",
70+
"navigateTo.ts",
6971
"navigationBar.ts",
7072
"outliningElementsCollector.ts",
7173
"patternMatcher.ts",
@@ -539,7 +541,7 @@ function cleanTestDirs() {
539541
}
540542

541543
jake.mkdirP(localRwcBaseline);
542-
jake.mkdirP(localTest262Baseline);
544+
jake.mkdirP(localTest262Baseline);
543545
jake.mkdirP(localBaseline);
544546
}
545547

@@ -718,7 +720,7 @@ file(loggedIOJsPath, [builtLocalDirectory, loggedIOpath], function() {
718720

719721
var instrumenterPath = harnessDirectory + 'instrumenter.ts';
720722
var instrumenterJsPath = builtLocalDirectory + 'instrumenter.js';
721-
compileFile(instrumenterJsPath, [instrumenterPath], [tscFile, instrumenterPath], [], /*useBuiltCompiler*/ true);
723+
compileFile(instrumenterJsPath, [instrumenterPath], [tscFile, instrumenterPath].concat(libraryTargets), [], /*useBuiltCompiler*/ true);
722724

723725
desc("Builds an instrumented tsc.js");
724726
task('tsc-instrumented', [loggedIOJsPath, instrumenterJsPath, tscFile], function() {

package.json

+2-3
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,9 @@
3838
"mocha": "latest",
3939
"chai": "latest",
4040
"browserify": "latest",
41-
"istanbul": "latest",
42-
"codeclimate-test-reporter": "latest"
41+
"istanbul": "latest"
4342
},
4443
"scripts": {
45-
"test": "jake generate-code-coverage"
44+
"test": "jake runtests"
4645
}
4746
}

scripts/processDiagnosticMessages.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,7 @@ function buildInfoFileOutput(messageTable: InputDiagnosticMessageTable, nameMap:
6565
' ' + convertPropertyName(nameMap[name]) +
6666
': { code: ' + diagnosticDetails.code +
6767
', category: DiagnosticCategory.' + diagnosticDetails.category +
68-
', key: "' + name.replace('"', '\\"') + '"' +
69-
(diagnosticDetails.isEarly ? ', isEarly: true' : '') +
68+
', key: "' + name.replace(/[\"]/g, '\\"') + '"' +
7069
' },\r\n';
7170
}
7271

src/compiler/binder.ts

+8-7
Original file line numberDiff line numberDiff line change
@@ -346,13 +346,14 @@ module ts {
346346
}
347347
else {
348348
bindDeclaration(node, SymbolFlags.ValueModule, SymbolFlags.ValueModuleExcludes, /*isBlockScopeContainer*/ true);
349-
if (state === ModuleInstanceState.ConstEnumOnly) {
350-
// mark value module as module that contains only enums
351-
node.symbol.constEnumOnlyModule = true;
349+
let currentModuleIsConstEnumOnly = state === ModuleInstanceState.ConstEnumOnly;
350+
if (node.symbol.constEnumOnlyModule === undefined) {
351+
// non-merged case - use the current state
352+
node.symbol.constEnumOnlyModule = currentModuleIsConstEnumOnly;
352353
}
353-
else if (node.symbol.constEnumOnlyModule) {
354-
// const only value module was merged with instantiated module - reset flag
355-
node.symbol.constEnumOnlyModule = false;
354+
else {
355+
// merged case: module is const enum only if all its pieces are non-instantiated or const enum
356+
node.symbol.constEnumOnlyModule = node.symbol.constEnumOnlyModule && currentModuleIsConstEnumOnly;
356357
}
357358
}
358359
}
@@ -529,7 +530,7 @@ module ts {
529530
bindChildren(node, 0, /*isBlockScopeContainer*/ false);
530531
break;
531532
case SyntaxKind.ExportAssignment:
532-
if ((<ExportAssignment>node).expression.kind === SyntaxKind.Identifier) {
533+
if ((<ExportAssignment>node).expression && (<ExportAssignment>node).expression.kind === SyntaxKind.Identifier) {
533534
// An export default clause with an identifier exports all meanings of that identifier
534535
declareSymbol(container.symbol.exports, container.symbol, <Declaration>node, SymbolFlags.Alias, SymbolFlags.PropertyExcludes | SymbolFlags.AliasExcludes);
535536
}

0 commit comments

Comments
 (0)