Skip to content

Commit

Permalink
Merge pull request #2467 from Microsoft/exportEqualsMerged
Browse files Browse the repository at this point in the history
Merge master into exportEquals
  • Loading branch information
ahejlsberg committed Mar 25, 2015
2 parents 7356775 + fad8892 commit a05f1e8
Show file tree
Hide file tree
Showing 1,245 changed files with 27,969 additions and 9,977 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.js linguist-language=TypeScript
11 changes: 1 addition & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,4 @@ language: node_js
node_js:
- '0.10'

sudo: false

before_script: npm install -g codeclimate-test-reporter

after_script:
- cat coverage/lcov.info | codeclimate

addons:
code_climate:
repo_token: 9852ac5362c8cc38c07ca5adc0f94c20c6c79bd78e17933dc284598a65338656
sudo: false
8 changes: 5 additions & 3 deletions Jakefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ var compilerSources = [
"utilities.ts",
"binder.ts",
"checker.ts",
"declarationEmitter.ts",
"emitter.ts",
"program.ts",
"commandLineParser.ts",
Expand All @@ -57,6 +58,7 @@ var servicesSources = [
"utilities.ts",
"binder.ts",
"checker.ts",
"declarationEmitter.ts",
"emitter.ts",
"program.ts",
"commandLineParser.ts",
Expand All @@ -65,7 +67,7 @@ var servicesSources = [
return path.join(compilerDirectory, f);
}).concat([
"breakpoints.ts",
"navigateTo.ts",
"navigateTo.ts",
"navigationBar.ts",
"outliningElementsCollector.ts",
"patternMatcher.ts",
Expand Down Expand Up @@ -539,7 +541,7 @@ function cleanTestDirs() {
}

jake.mkdirP(localRwcBaseline);
jake.mkdirP(localTest262Baseline);
jake.mkdirP(localTest262Baseline);
jake.mkdirP(localBaseline);
}

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

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

desc("Builds an instrumented tsc.js");
task('tsc-instrumented', [loggedIOJsPath, instrumenterJsPath, tscFile], function() {
Expand Down
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,9 @@
"mocha": "latest",
"chai": "latest",
"browserify": "latest",
"istanbul": "latest",
"codeclimate-test-reporter": "latest"
"istanbul": "latest"
},
"scripts": {
"test": "jake generate-code-coverage"
"test": "jake runtests"
}
}
3 changes: 1 addition & 2 deletions scripts/processDiagnosticMessages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ function buildInfoFileOutput(messageTable: InputDiagnosticMessageTable, nameMap:
' ' + convertPropertyName(nameMap[name]) +
': { code: ' + diagnosticDetails.code +
', category: DiagnosticCategory.' + diagnosticDetails.category +
', key: "' + name.replace('"', '\\"') + '"' +
(diagnosticDetails.isEarly ? ', isEarly: true' : '') +
', key: "' + name.replace(/[\"]/g, '\\"') + '"' +
' },\r\n';
}

Expand Down
15 changes: 8 additions & 7 deletions src/compiler/binder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -346,13 +346,14 @@ module ts {
}
else {
bindDeclaration(node, SymbolFlags.ValueModule, SymbolFlags.ValueModuleExcludes, /*isBlockScopeContainer*/ true);
if (state === ModuleInstanceState.ConstEnumOnly) {
// mark value module as module that contains only enums
node.symbol.constEnumOnlyModule = true;
let currentModuleIsConstEnumOnly = state === ModuleInstanceState.ConstEnumOnly;
if (node.symbol.constEnumOnlyModule === undefined) {
// non-merged case - use the current state
node.symbol.constEnumOnlyModule = currentModuleIsConstEnumOnly;
}
else if (node.symbol.constEnumOnlyModule) {
// const only value module was merged with instantiated module - reset flag
node.symbol.constEnumOnlyModule = false;
else {
// merged case: module is const enum only if all its pieces are non-instantiated or const enum
node.symbol.constEnumOnlyModule = node.symbol.constEnumOnlyModule && currentModuleIsConstEnumOnly;
}
}
}
Expand Down Expand Up @@ -529,7 +530,7 @@ module ts {
bindChildren(node, 0, /*isBlockScopeContainer*/ false);
break;
case SyntaxKind.ExportAssignment:
if ((<ExportAssignment>node).expression.kind === SyntaxKind.Identifier) {
if ((<ExportAssignment>node).expression && (<ExportAssignment>node).expression.kind === SyntaxKind.Identifier) {
// An export default clause with an identifier exports all meanings of that identifier
declareSymbol(container.symbol.exports, container.symbol, <Declaration>node, SymbolFlags.Alias, SymbolFlags.PropertyExcludes | SymbolFlags.AliasExcludes);
}
Expand Down
Loading

0 comments on commit a05f1e8

Please sign in to comment.