Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c7613e2

Browse filesBrowse files
committed
Merge pull request immutable-js#745 from facebook/typescript
Update to use latest version of typescript
2 parents 2c93401 + eae7a01 commit c7613e2
Copy full SHA for c7613e2

File tree

Expand file treeCollapse file tree

3 files changed

+25
-16
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+25
-16
lines changed

‎__tests__/zip.ts

Copy file name to clipboardExpand all lines: __tests__/zip.ts
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ describe('zip', () => {
5858
it('can zip to create immutable collections', () => {
5959
expect(
6060
I.Seq.of(1,2,3).zipWith(
61-
() => I.List(arguments),
61+
function () { return I.List(arguments); },
6262
I.Seq.of(4,5,6),
6363
I.Seq.of(7,8,9)
6464
).toJS()

‎package.json

Copy file name to clipboardExpand all lines: package.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
"rollup": "0.24.0",
7676
"run-sequence": "1.1.5",
7777
"through2": "2.0.0",
78-
"typescript": "~1.4.1",
78+
"typescript": "1.7.5",
7979
"uglify-js": "2.6.1",
8080
"vinyl-buffer": "1.0.0",
8181
"vinyl-source-stream": "1.1.0"

‎resources/jestPreprocessor.js

Copy file name to clipboardExpand all lines: resources/jestPreprocessor.js
+23-14Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,22 +34,31 @@ function compileTypeScript(filePath) {
3434

3535
var host = typescript.createCompilerHost(options);
3636
var program = typescript.createProgram([filePath], options, host);
37-
var checker = typescript.createTypeChecker(program, /*fullTypeCheck*/ true);
38-
var result = checker.emitFiles();
39-
40-
program.getDiagnostics()
41-
.concat(checker.getDiagnostics())
42-
.concat(result.diagnostics)
43-
.forEach(function(diagnostic) {
44-
var lineChar = diagnostic.file.getLineAndCharacterFromPosition(diagnostic.start);
45-
console.error('%s %d:%d %s', diagnostic.file.filename, lineChar.line, lineChar.character, diagnostic.messageText);
46-
});
47-
48-
if (result.emitResultStatus !== typescript.EmitReturnStatus.Succeeded) {
49-
throw new Error('Compiling ' + filePath + ' failed');
37+
38+
var diagnostics = program.getSyntacticDiagnostics();
39+
40+
if (diagnostics.length === 0) {
41+
diagnostics = program.getGlobalDiagnostics();
42+
}
43+
44+
if (diagnostics.length === 0) {
45+
diagnostics = program.getSemanticDiagnostics();
46+
}
47+
48+
if (diagnostics.length === 0) {
49+
var emitOutput = program.emit();
50+
diagnostics = emitOutput.diagnostics;
51+
}
52+
53+
if (diagnostics.length === 0) {
54+
return fs.readFileSync(outputPath, {encoding: 'utf8'});
5055
}
5156

52-
return fs.readFileSync(outputPath, {encoding: 'utf8'});
57+
diagnostics.forEach(function(diagnostic) {
58+
var loc = typescript.getLineAndCharacterOfPosition(diagnostic.file, diagnostic.start);
59+
console.error('%s %d:%d %s', diagnostic.file.fileName, loc.line, loc.character, diagnostic.messageText);
60+
});
61+
throw new Error('Compiling ' + filePath + ' failed');
5362
}
5463

5564
function withLocalImmutable(filePath, jsSrc) {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.