Skip to content

Commit c426fc6

Browse files
committed
Merge branch 'master' into tscWatchExportUpdate
2 parents f97a2b3 + d35ea02 commit c426fc6

File tree

287 files changed

+21354
-15526
lines changed

Some content is hidden

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

287 files changed

+21354
-15526
lines changed

.travis.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,7 @@ matrix:
1616
branches:
1717
only:
1818
- master
19-
- release-2.7
20-
- release-2.8
21-
- release-2.9
22-
- release-3.0
23-
- release-3.1
19+
- /^release-.*/
2420

2521
install:
2622
- npm uninstall typescript --no-save

CONTRIBUTING.md

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -82,19 +82,26 @@ Your pull request should:
8282
* To avoid line ending issues, set `autocrlf = input` and `whitespace = cr-at-eol` in your git configuration
8383

8484
## Contributing `lib.d.ts` fixes
85-
86-
The library sources are in: [src/lib](https://github.com/Microsoft/TypeScript/tree/master/src/lib)
8785

88-
Library files in `built/local/` are updated by running
89-
```Shell
86+
There are three relevant locations to be aware of when it comes to TypeScript's library declaration files:
87+
88+
* `src/lib`: the location of the sources themselves.
89+
* `lib`: the location of the last-known-good (LKG) versions of the files which are updated periodically.
90+
* `built/local`: the build output location, including where `src/lib` files will be copied to.
91+
92+
Any changes should be made to [src/lib](https://github.com/Microsoft/TypeScript/tree/master/src/lib). **Most** of these files can be updated by hand, with the exception of any generated files (see below).
93+
94+
Library files in `built/local/` are updated automatically by running the standard build task:
95+
96+
```sh
9097
jake
9198
```
9299

93-
The files in `lib/` are used to bootstrap compilation and usually do not need to be updated.
100+
The files in `lib/` are used to bootstrap compilation and usually **should not** be updated unless publishing a new version or updating the LKG.
94101

95-
#### `src/lib/dom.generated.d.ts` and `src/lib/webworker.generated.d.ts`
102+
### Modifying generated library files
96103

97-
These two files represent the DOM typings and are auto-generated. To make any modifications to them, please submit a PR to https://github.com/Microsoft/TSJS-lib-generator
104+
The files `src/lib/dom.generated.d.ts` and `src/lib/webworker.generated.d.ts` both represent type declarations for the DOM and are auto-generated. To make any modifications to them, you will have to direct changes to https://github.com/Microsoft/TSJS-lib-generator
98105

99106
## Running the Tests
100107

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@
8282
"mocha": "latest",
8383
"mocha-fivemat-progress-reporter": "latest",
8484
"plugin-error": "latest",
85+
"pretty-hrtime": "^1.0.3",
8586
"prex": "^0.4.3",
8687
"q": "latest",
8788
"remove-internal": "^2.9.2",

scripts/build/project.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -683,11 +683,17 @@ function ensureCompileTask(projectGraph, options) {
683683
}
684684
});
685685
}
686-
const js = (projectGraphConfig.resolvedOptions.js ? projectGraphConfig.resolvedOptions.js(stream.js) : stream.js)
686+
687+
const additionalJsOutputs = projectGraphConfig.resolvedOptions.js ? projectGraphConfig.resolvedOptions.js(stream.js)
688+
.pipe(gulpif(sourceMap || inlineSourceMap, sourcemaps.write(sourceMapPath, sourceMapOptions))) : undefined;
689+
const additionalDtsOutputs = projectGraphConfig.resolvedOptions.dts ? projectGraphConfig.resolvedOptions.dts(stream.dts)
690+
.pipe(gulpif(declarationMap, sourcemaps.write(sourceMapPath, sourceMapOptions))) : undefined;
691+
692+
const js = stream.js
687693
.pipe(gulpif(sourceMap || inlineSourceMap, sourcemaps.write(sourceMapPath, sourceMapOptions)));
688-
const dts = (projectGraphConfig.resolvedOptions.dts ? projectGraphConfig.resolvedOptions.dts(stream.dts) : stream.dts)
694+
const dts = stream.dts
689695
.pipe(gulpif(declarationMap, sourcemaps.write(sourceMapPath, sourceMapOptions)));
690-
return merge2([js, dts])
696+
return merge2([js, dts, additionalJsOutputs, additionalDtsOutputs].filter(x => !!x))
691697
.pipe(gulp.dest(destPath));
692698
});
693699
}

src/compiler/binder.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ namespace ts {
143143

144144
let symbolCount = 0;
145145

146-
let Symbol: { new (flags: SymbolFlags, name: __String): Symbol }; // tslint:disable-line variable-name
146+
let Symbol: new (flags: SymbolFlags, name: __String) => Symbol; // tslint:disable-line variable-name
147147
let classifiableNames: UnderscoreEscapedMap<true>;
148148

149149
const unreachableFlow: FlowNode = { flags: FlowFlags.Unreachable };
@@ -233,6 +233,11 @@ namespace ts {
233233
symbol.members = createSymbolTable();
234234
}
235235

236+
// On merge of const enum module with class or function, reset const enum only flag (namespaces will already recalculate)
237+
if (symbol.constEnumOnlyModule && (symbol.flags & (SymbolFlags.Function | SymbolFlags.Class | SymbolFlags.RegularEnum))) {
238+
symbol.constEnumOnlyModule = false;
239+
}
240+
236241
if (symbolFlags & SymbolFlags.Value) {
237242
setValueDeclaration(symbol, node);
238243
}

0 commit comments

Comments
 (0)