mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-11-18 20:11:14 +00:00
Merge pull request #1160 from Microsoft/weDontNeedNoTemplateStringsArrayPreEs6
Default to 'unknown' for the template strings array type in pre-ES6 targets.
This commit is contained in:
commit
aec8d9621c
14 files changed
+129
-12
No files matched your search
@@ -9102,7 +9102,12 @@ module ts {
|
||||
globalNumberType = getGlobalType("Number");
|
||||
globalBooleanType = getGlobalType("Boolean");
|
||||
globalRegExpType = getGlobalType("RegExp");
|
||||
globalTemplateStringsArrayType = getGlobalType("TemplateStringsArray");
|
||||
|
||||
// If we're in ES6 mode, load the TemplateStringsArray.
|
||||
// Otherwise, default to 'unknown' for the purposes of type checking in LS scenarios.
|
||||
globalTemplateStringsArrayType = compilerOptions.target >= ScriptTarget.ES6
|
||||
? getGlobalType("TemplateStringsArray")
|
||||
: unknownType;
|
||||
}
|
||||
|
||||
initializeTypeChecker();
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
|
||||
/// <reference path='..\services\services.ts' />
|
||||
/// <reference path='..\services\shims.ts' />
|
||||
/// <reference path='..\compiler\core.ts' />
|
||||
/// <reference path='..\compiler\sys.ts' />
|
||||
/// <reference path='external\mocha.d.ts'/>
|
||||
/// <reference path='external\chai.d.ts'/>
|
||||
@@ -1002,8 +1003,12 @@ module Harness {
|
||||
assert.equal(markedErrorCount, fileErrors.length, 'count of errors in ' + inputFile.unitName);
|
||||
});
|
||||
|
||||
var numLibraryDiagnostics = ts.countWhere(diagnostics, diagnostic => {
|
||||
return diagnostic.filename && isLibraryFile(diagnostic.filename);
|
||||
});
|
||||
|
||||
// Verify we didn't miss any errors in total
|
||||
assert.equal(totalErrorsReported, diagnostics.length, 'total number of errors');
|
||||
assert.equal(totalErrorsReported + numLibraryDiagnostics, diagnostics.length, 'total number of errors');
|
||||
|
||||
return minimalDiagnosticsToString(diagnostics) +
|
||||
sys.newLine + sys.newLine + outputLines.join('\r\n');
|
||||
|
||||
Reference in new issue
Block a user