Merge branch 'master' into emit-module-in-strict-mode

This commit is contained in:
Wesley Wigham
2015-11-23 17:06:02 -08:00
10 changed files with 153 additions and 10 deletions
+7 -8
View File
@@ -1028,16 +1028,12 @@ namespace ts {
// Module names are escaped in our symbol table. However, string literal values aren't.
// Escape the name in the "require(...)" clause to ensure we find the right symbol.
let moduleName = escapeIdentifier(moduleReferenceLiteral.text);
const moduleName = escapeIdentifier(moduleReferenceLiteral.text);
if (moduleName === undefined) {
return;
}
if (moduleName.indexOf("!") >= 0) {
moduleName = moduleName.substr(0, moduleName.indexOf("!"));
}
const isRelative = isExternalModuleNameRelative(moduleName);
if (!isRelative) {
const symbol = getSymbol(globals, "\"" + moduleName + "\"", SymbolFlags.ValueModule);
@@ -5228,9 +5224,12 @@ namespace ts {
const id = relation !== identityRelation || apparentSource.id < target.id ? apparentSource.id + "," + target.id : target.id + "," + apparentSource.id;
const related = relation[id];
if (related !== undefined) {
// If we computed this relation already and it was failed and reported, or if we're not being asked to elaborate
// errors, we can use the cached value. Otherwise, recompute the relation
if (!elaborateErrors || (related === RelationComparisonResult.FailedAndReported)) {
if (elaborateErrors && related === RelationComparisonResult.Failed) {
// We are elaborating errors and the cached result is an unreported failure. Record the result as a reported
// failure and continue computing the relation such that errors get reported.
relation[id] = RelationComparisonResult.FailedAndReported;
}
else {
return related === RelationComparisonResult.Succeeded ? Ternary.True : Ternary.False;
}
}