Merge branch 'master' into specConformanceTests

This commit is contained in:
Jason Freeman
2014-09-08 13:55:22 -07:00
213 changed files with 3701 additions and 3701 deletions
Binary file not shown.
Binary file not shown.
+36 -36
View File
@@ -24,9 +24,9 @@ module ts {
}
/// fullTypeCheck denotes if this instance of the typechecker will be used to get semantic diagnostics.
/// If fullTypeCheck === true - then typechecker should do every possible check to produce all errors
/// If fullTypeCheck === false - typechecker can shortcut and skip checks that only produce errors.
/// NOTE: checks that somehow affects decisions being made during typechecking should be executed in both cases.
/// If fullTypeCheck === true, then the typechecker should do every possible check to produce all errors
/// If fullTypeCheck === false, the typechecker can take shortcuts and skip checks that only produce errors.
/// NOTE: checks that somehow affect decisions being made during typechecking should be executed in both cases.
export function createTypeChecker(program: Program, fullTypeCheck: boolean): TypeChecker {
var Symbol = objectAllocator.getSymbolConstructor();
@@ -573,7 +573,7 @@ module ts {
return (resolveImport(symbol).flags & SymbolFlags.Value) !== 0;
}
// If it is an instantiated symbol, then it is a value if hte symbol it is an
// If it is an instantiated symbol, then it is a value if the symbol it is an
// instantiation of is a value.
if (symbol.flags & SymbolFlags.Instantiated) {
return (getSymbolLinks(symbol).target.flags & SymbolFlags.Value) !== 0;
@@ -697,7 +697,7 @@ module ts {
function getAccessibleSymbolChain(symbol: Symbol, enclosingDeclaration: Node, meaning: SymbolFlags): Symbol[] {
function getAccessibleSymbolChainFromSymbolTable(symbols: SymbolTable): Symbol[] {
function canQualifySymbol(symbolFromSymbolTable: Symbol, meaning: SymbolFlags) {
// If the symbol is equivalent and doesnt need futher qualification, this symbol is accessible
// If the symbol is equivalent and doesn't need further qualification, this symbol is accessible
if (!needsQualification(symbolFromSymbolTable, enclosingDeclaration, meaning)) {
return true;
}
@@ -793,9 +793,9 @@ module ts {
return { accessibility: SymbolAccessibility.Accessible, aliasesToMakeVisible: hasAccessibleDeclarations.aliasesToMakeVisible };
}
// If we havent got the accessible symbol doesnt mean the symbol is actually inaccessible.
// It could be qualified symbol and hence verify the path
// eg:
// If we haven't got the accessible symbol, it doesn't mean the symbol is actually inaccessible.
// It could be a qualified symbol and hence verify the path
// e.g.:
// module m {
// export class c {
// }
@@ -803,7 +803,7 @@ module ts {
// var x: typeof m.c
// In the above example when we start with checking if typeof m.c symbol is accessible,
// we are going to see if c can be accessed in scope directly.
// But it cant, hence the accessible is going to be undefined, but that doesnt mean m.c is accessible
// But it can't, hence the accessible is going to be undefined, but that doesn't mean m.c is inaccessible
// It is accessible if the parent m is accessible because then m.c can be accessed through qualification
meaningToLook = getQualifiedLeftMeaning(meaning);
symbol = getParentOfSymbol(symbol);
@@ -815,7 +815,7 @@ module ts {
if (symbolExternalModule) {
var enclosingExternalModule = getExternalModuleContainer(enclosingDeclaration);
if (symbolExternalModule !== enclosingExternalModule) {
// name from different external module that is not visibile
// name from different external module that is not visible
return {
accessibility: SymbolAccessibility.CannotBeNamed,
errorSymbolName: symbolToString(initialSymbol, enclosingDeclaration, meaning),
@@ -892,7 +892,7 @@ module ts {
{ accessibility: SymbolAccessibility.NotAccessible, errorSymbolName: firstIdentifierName };
}
// Enclosing declaration is optional when we dont want to get qualified name in the enclosing declaration scope
// Enclosing declaration is optional when we don't want to get qualified name in the enclosing declaration scope
// Meaning needs to be specified if the enclosing declaration is given
function symbolToString(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags) {
function getSymbolName(symbol: Symbol) {
@@ -919,7 +919,7 @@ module ts {
currentSymbolName = ts.map(accessibleSymbolChain, accessibleSymbol => getSymbolName(accessibleSymbol)).join(".");
}
else {
// If we didnt find accessible symbol chain for this symbol, break if this is external module
// If we didn't find accessible symbol chain for this symbol, break if this is external module
if (!isFirstName && ts.forEach(symbol.declarations, declaration => hasExternalModuleSymbol(declaration))) {
break;
}
@@ -991,7 +991,7 @@ module ts {
function writeTypeReference(type: TypeReference) {
if (type.target === globalArrayType && !(flags & TypeFormatFlags.WriteArrayAsGenericType)) {
// If we are writing array element type the arrow style signatures are not allowed as
// we need to surround it by curlies, eg. { (): T; }[]; as () => T[] would mean something different
// we need to surround it by curlies, e.g. { (): T; }[]; as () => T[] would mean something different
writeType(type.typeArguments[0], /*allowFunctionOrConstructorTypeLiteral*/ false);
writer.write("[]");
}
@@ -1244,7 +1244,7 @@ module ts {
!(node.kind !== SyntaxKind.ImportDeclaration && parent.kind !== SyntaxKind.SourceFile && isInAmbientContext(parent))) {
return isGlobalSourceFile(parent) || isUsedInExportAssignment(node);
}
// Exported members/ambient module elements (exception import declaraiton) are visible if parent is visible
// Exported members/ambient module elements (exception import declaration) are visible if parent is visible
return isDeclarationVisible(parent);
case SyntaxKind.Property:
@@ -4032,7 +4032,7 @@ module ts {
}
else {
// current declaration belongs to a different symbol
// set cutoffPos so reorderings in the future won't change result set from 0 to cutoffPos
// set cutoffPos so re-orderings in the future won't change result set from 0 to cutoffPos
pos = cutoffPos = result.length;
lastParent = parent;
}
@@ -4330,8 +4330,8 @@ module ts {
var targetType = getTypeFromTypeNode(node.type);
if (fullTypeCheck && targetType !== unknownType) {
var widenedType = getWidenedType(exprType);
if (!(isTypeAssignableTo(exprType, targetType) || isTypeAssignableTo(targetType, widenedType))) {
checkTypeAssignableTo(targetType, widenedType, node, Diagnostics.Neither_type_0_nor_type_1_is_assignable_to_the_other_Colon, Diagnostics.Neither_type_0_nor_type_1_is_assignable_to_the_other);
if (!(isTypeAssignableTo(targetType, widenedType))) {
checkTypeAssignableTo(exprType, targetType, node, Diagnostics.Neither_type_0_nor_type_1_is_assignable_to_the_other_Colon, Diagnostics.Neither_type_0_nor_type_1_is_assignable_to_the_other);
}
}
return targetType;
@@ -4782,7 +4782,7 @@ module ts {
var ok = checkReferenceExpression(node.left, Diagnostics.Invalid_left_hand_side_of_assignment_expression);
// Use default messages
if (ok) {
// to avoid cascading errors check assignability only if 'isReference' check succeded and no errors were reported
// to avoid cascading errors check assignability only if 'isReference' check succeeded and no errors were reported
checkTypeAssignableTo(valueType, leftType, node.left, /*chainedMessage*/ undefined, /*terminalMessage*/ undefined);
}
}
@@ -4828,7 +4828,7 @@ module ts {
// Checks an expression and returns its type. The contextualMapper parameter serves two purposes: When
// contextualMapper is not undefined and not equal to the identityMapper function object it indicates that the
// expression is being inferentially typed (section 4.12.2 in spec) and provides the type mapper to use in
// conjuction with the generic contextual type. When contextualMapper is equal to the identityMapper function
// conjunction with the generic contextual type. When contextualMapper is equal to the identityMapper function
// object, it serves as an indicator that all contained function and arrow expressions should be considered to
// have the wildcard function type; this form of type check is used during overload resolution to exclude
// contextually typed function and arrow expressions in the initial phase.
@@ -4933,7 +4933,7 @@ module ts {
// legal case - parameter initializer references some parameter strictly on left of current parameter declaration
return;
}
// fallthrough to error reporting
// fall through to error reporting
}
error(n, Diagnostics.Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it, identifierToString(parameterDeclaration.name), identifierToString(<Identifier>n));
@@ -5325,7 +5325,7 @@ module ts {
}
// when checking exported function declarations across modules check only duplicate implementations
// names and consistensy of modifiers are verified when we check local symbol
// names and consistency of modifiers are verified when we check local symbol
var isExportSymbolInsideModule = symbol.parent && symbol.parent.flags & SymbolFlags.Module;
for (var i = 0; i < declarations.length; i++) {
var node = <FunctionDeclaration>declarations[i];
@@ -5421,7 +5421,7 @@ module ts {
var symbol: Symbol;
// Exports should be checked only if enclosing module contains both exported and non exported declarations.
// In case if all declarations are non-exported check is unnecesary.
// In case if all declarations are non-exported check is unnecessary.
// if localSymbol is defined on node then node itself is exported - check is required
var symbol = node.localSymbol;
@@ -5866,7 +5866,7 @@ module ts {
checkTypeAssignableTo(checkExpression(node.expression), returnType, node.expression, /*chainedMessage*/ undefined, /*terminalMessage*/ undefined);
}
else if (func.kind == SyntaxKind.Constructor) {
// constructor doesn't have explicit return type annontation and yet its return type is known - declaring type
// constructor doesn't have explicit return type annotation and yet its return type is known - declaring type
// handle constructors and issue specialized error message for them.
if (!isTypeAssignableTo(checkExpression(node.expression), returnType)) {
error(node.expression, Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class);
@@ -6113,7 +6113,7 @@ module ts {
}
if ((base.flags & derived.flags & SymbolFlags.Method) || ((base.flags & SymbolFlags.PropertyOrAccessor) && (derived.flags & SymbolFlags.PropertyOrAccessor))) {
// method is overridden with method or property\accessor is overridden with property\accessor - correct case
// method is overridden with method or property/accessor is overridden with property/accessor - correct case
continue;
}
@@ -6965,7 +6965,7 @@ module ts {
return moduleType ? moduleType.symbol : undefined;
}
// Intentinal fallthrough
// Intentional fall-through
case SyntaxKind.NumericLiteral:
// index access
if (node.parent.kind == SyntaxKind.IndexedAccess && (<IndexedAccess>node.parent).index === node) {
@@ -7030,7 +7030,7 @@ module ts {
var apparentType = getApparentType(type);
if (apparentType.flags & TypeFlags.ObjectType) {
// Augment the apprent type with Function and Object memeber as applicaple
// Augment the apparent type with Function and Object members as applicable
var propertiesByName: Map<Symbol> = {};
var results: Symbol[] = [];
@@ -7187,17 +7187,17 @@ module ts {
var symbol = getSymbolOfNode(node);
var signaturesOfSymbol = getSignaturesOfSymbol(symbol);
// If this function body corresponds to function with multiple signature, it is implementation of overload
// eg: function foo(a: string): string;
// function foo(a: number): number;
// function foo(a: any) { // This is implementation of the overloads
// return a;
// }
// e.g.: function foo(a: string): string;
// function foo(a: number): number;
// function foo(a: any) { // This is implementation of the overloads
// return a;
// }
return signaturesOfSymbol.length > 1 ||
// If there is single signature for the symbol, it is overload if that signature isnt coming from the node
// eg: function foo(a: string): string;
// function foo(a: any) { // This is implementation of the overloads
// return a;
// }
// If there is single signature for the symbol, it is overload if that signature isn't coming from the node
// e.g.: function foo(a: string): string;
// function foo(a: any) { // This is implementation of the overloads
// return a;
// }
(signaturesOfSymbol.length === 1 && signaturesOfSymbol[0].declaration !== node);
}
return false;
+25 -34
View File
@@ -266,7 +266,7 @@ module ts {
}
}
else {
// Single line comment of styly //....
// Single line comment of style //....
writer.write(currentSourceFile.text.substring(comment.pos, comment.end));
}
@@ -393,7 +393,7 @@ module ts {
}
var prevEncodedEmittedColumn = lastEncodedSourceMapSpan.emittedColumn;
// Line/Comma deliminators
// Line/Comma delimiters
if (lastEncodedSourceMapSpan.emittedLine == lastRecordedSourceMapSpan.emittedLine) {
// Emit comma to separate the entry
if (sourceMapData.sourceMapMappings) {
@@ -401,7 +401,7 @@ module ts {
}
}
else {
// Emit line deliminators
// Emit line delimiters
for (var encodedLine = lastEncodedSourceMapSpan.emittedLine; encodedLine < lastRecordedSourceMapSpan.emittedLine; encodedLine++) {
sourceMapData.sourceMapMappings += ";";
}
@@ -470,7 +470,7 @@ module ts {
var emittedLine = writer.getLine();
var emittedColumn = writer.getColumn();
// If this location wasnt recorded or the location in source is going backwards, record the span
// If this location wasn't recorded or the location in source is going backwards, record the span
if (!lastRecordedSourceMapSpan ||
lastRecordedSourceMapSpan.emittedLine != emittedLine ||
lastRecordedSourceMapSpan.emittedColumn != emittedColumn ||
@@ -516,7 +516,7 @@ module ts {
}
function recordNewSourceFileStart(node: SourceFile) {
// Add the the file to tsFilePaths
// Add the file to tsFilePaths
// If sourceroot option: Use the relative path corresponding to the common directory path
// otherwise source locations relative to map file location
var sourcesDirectoryPath = compilerOptions.sourceRoot ? program.getCommonSourceDirectory() : sourceMapDir;
@@ -953,7 +953,7 @@ module ts {
write(tokenToString(node.operator));
}
// In some cases, we need to emit a space between the operator and the operand. One obvious case
// is when the operator is an identifer, like delete or typeof. We also need to do this for plus
// is when the operator is an identifier, like delete or typeof. We also need to do this for plus
// and minus expressions in certain cases. Specifically, consider the following two cases (parens
// are just for clarity of exposition, and not part of the source code):
//
@@ -1755,16 +1755,13 @@ module ts {
if (!isInstantiated(node)) {
return emitPinnedOrTripleSlashComments(node);
}
emitLeadingComments(node);
if (!(node.flags & NodeFlags.Export)) {
emitStart(node);
write("var ");
emit(node.name);
write(";");
emitEnd(node);
writeLine();
}
emitStart(node);
write("var ");
emit(node.name);
write(";");
emitEnd(node);
writeLine();
emitStart(node);
write("(function (");
emitStart(node.name);
@@ -1788,21 +1785,15 @@ module ts {
scopeEmitEnd();
}
write(")(");
if (node.flags & NodeFlags.Export) {
emit(node.name);
write(" = ");
}
emitModuleMemberName(node);
write(" || (");
emitModuleMemberName(node);
write(" = {}));");
emitEnd(node);
if (node.flags & NodeFlags.Export) {
writeLine();
emitStart(node);
write("var ");
emit(node.name);
write(" = ");
emitModuleMemberName(node);
emitEnd(node);
write(";");
}
emitTrailingComments(node);
}
@@ -2125,7 +2116,7 @@ module ts {
}
function getLeadingCommentsToEmit(node: Node) {
// Emit the leading comments only if the parent's pos doesnt match because parent should take care of emitting these comments
// Emit the leading comments only if the parent's pos doesn't match because parent should take care of emitting these comments
if (node.parent.kind === SyntaxKind.SourceFile || node.pos !== node.parent.pos) {
var leadingComments: Comment[];
if (hasDetachedComments(node.pos)) {
@@ -2148,7 +2139,7 @@ module ts {
}
function emitTrailingDeclarationComments(node: Node) {
// Emit the trailing comments only if the parent's end doesnt match
// Emit the trailing comments only if the parent's end doesn't match
if (node.parent.kind === SyntaxKind.SourceFile || node.end !== node.parent.end) {
var trailingComments = getTrailingComments(currentSourceFile.text, node.end);
// trailing comments are emitted at space/*trailing comment1 */space/*trailing comment*/
@@ -2224,7 +2215,7 @@ module ts {
return currentSourceFile.text.charCodeAt(comment.pos + 2) === CharacterCodes.exclamation;
}
// Verify this is /// comment, but do the regexp match only when we first can find /// in the comment text
// so that we dont end up computing comment string and doing match for all // comments
// so that we don't end up computing comment string and doing match for all // comments
else if (currentSourceFile.text.charCodeAt(comment.pos + 1) === CharacterCodes.slash &&
comment.pos + 2 < comment.end &&
currentSourceFile.text.charCodeAt(comment.pos + 2) === CharacterCodes.slash &&
@@ -2700,7 +2691,7 @@ module ts {
}
function emitVariableDeclaration(node: VariableDeclaration) {
// If we are emitting property it isnt moduleElement and hence we already know it needs to be emitted
// If we are emitting property it isn't moduleElement and hence we already know it needs to be emitted
// so there is no check needed to see if declaration is visible
if (node.kind !== SyntaxKind.VariableDeclaration || resolver.isDeclarationVisible(node)) {
emitSourceTextOfNode(node.name);
@@ -2724,7 +2715,7 @@ module ts {
Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_private_module_2 :
Diagnostics.Exported_variable_0_has_or_is_using_private_name_1;
}
// This check is to ensure we dont report error on constructor parameter property as that error would be reported during parameter emit
// This check is to ensure we don't report error on constructor parameter property as that error would be reported during parameter emit
else if (node.kind === SyntaxKind.Property) {
if (node.flags & NodeFlags.Static) {
diagnosticMessage = symbolAccesibilityResult.errorModuleName ?
@@ -2829,7 +2820,7 @@ module ts {
}
function emitFunctionDeclaration(node: FunctionDeclaration) {
// If we are emitting Method/Constructor it isnt moduleElement and hence already determined to be emitting
// If we are emitting Method/Constructor it isn't moduleElement and hence already determined to be emitting
// so no need to verify if the declaration is visible
if ((node.kind !== SyntaxKind.FunctionDeclaration || resolver.isDeclarationVisible(node)) &&
!resolver.isImplementationOfOverload(node)) {
@@ -3105,7 +3096,7 @@ module ts {
}
if (root) {
// Emiting single file so emit references in this file only
// Emitting just a single file, so emit references in this file only
if (!compilerOptions.noResolve) {
var addedGlobalFileReference = false;
forEach(root.referencedFiles, fileReference => {
@@ -3136,9 +3127,9 @@ module ts {
forEach(sourceFile.referencedFiles, fileReference => {
var referencedFile = resolveScriptReference(sourceFile, fileReference);
// If the reference file is declaration file or external module emit that reference
// If the reference file is a declaration file or an external module, emit that reference
if (isExternalModuleOrDeclarationFile(referencedFile) &&
!contains(emittedReferencedFiles, referencedFile)) { // If the file refernece was not already emitted
!contains(emittedReferencedFiles, referencedFile)) { // If the file reference was not already emitted
writeReferencePath(referencedFile);
emittedReferencedFiles.push(referencedFile);
+14 -14
View File
@@ -141,11 +141,11 @@ module ts {
export function getLeadingCommentsOfNode(node: Node, sourceFileOfNode: SourceFile) {
// If parameter/type parameter, the prev token trailing comments are part of this node too
if (node.kind === SyntaxKind.Parameter || node.kind === SyntaxKind.TypeParameter) {
// eg (/** blah */ a, /** blah */ b);
// e.g. (/** blah */ a, /** blah */ b);
return concatenate(getTrailingComments(sourceFileOfNode.text, node.pos),
// eg: (
// /** blah */ a,
// /** blah */ b);
// e.g.: (
// /** blah */ a,
// /** blah */ b);
getLeadingComments(sourceFileOfNode.text, node.pos));
}
else {
@@ -157,7 +157,7 @@ module ts {
return filter(getLeadingCommentsOfNode(node, sourceFileOfNode), comment => isJsDocComment(comment));
function isJsDocComment(comment: Comment) {
// js doc is if comment is starting with /** but not if it is /**/
// True if the comment starts with '/**' but not if it is '/**/'
return sourceFileOfNode.text.charCodeAt(comment.pos + 1) === CharacterCodes.asterisk &&
sourceFileOfNode.text.charCodeAt(comment.pos + 2) === CharacterCodes.asterisk &&
sourceFileOfNode.text.charCodeAt(comment.pos + 3) !== CharacterCodes.slash;
@@ -661,7 +661,7 @@ module ts {
}
function reportInvalidUseInStrictMode(node: Identifier): void {
// identifierToString cannot be used here since it uses backreference to 'parent' that is not yet set
// identifierToString cannot be used here since it uses a backreference to 'parent' that is not yet set
var name = sourceText.substring(skipTrivia(sourceText, node.pos), node.end);
grammarErrorOnNode(node, Diagnostics.Invalid_use_of_0_in_strict_mode, name);
}
@@ -732,7 +732,7 @@ module ts {
lookAheadMode = LookAheadMode.NoErrorYet;
var result = callback();
// If we switched from 1 to to -1 then a parse error occurred during the callback.
// If we switched from 1 to -1 then a parse error occurred during the callback.
// If that's the case, then we want to act as if we never got any result at all.
Debug.assert(lookAheadMode === LookAheadMode.Error || lookAheadMode === LookAheadMode.NoErrorYet);
if (lookAheadMode === LookAheadMode.Error) {
@@ -1634,7 +1634,7 @@ module ts {
// (i.e. they're both BinaryExpressions with an assignment operator in it).
// First, check if we have an arrow function (production '4') that starts with a parenthesized
// parameter list. If we do, we must *not* recurse for productsion 1, 2 or 3. An ArrowFunction is
// parameter list. If we do, we must *not* recurse for productions 1, 2 or 3. An ArrowFunction is
// not a LeftHandSideExpression, nor does it start a ConditionalExpression. So we are done
// with AssignmentExpression if we see one.
var arrowExpression = tryParseParenthesizedArrowFunctionExpression();
@@ -1822,7 +1822,7 @@ module ts {
if (token === SyntaxKind.EqualsGreaterThanToken) {
// ERROR RECOVERY TWEAK:
// If we see a standalone => try to parse it as an arrow function expression as that's
// likely whatthe user intended to write.
// likely what the user intended to write.
return Tristate.True;
}
// Definitely not a parenthesized arrow function.
@@ -2725,8 +2725,8 @@ module ts {
switch (token) {
case SyntaxKind.SemicolonToken:
// If we're in error recovery, then we don't want to treat ';' as an empty statement.
// The problem is that ';' can show up in far too many contexts, and if we see one
// and assume it's a statement, then we may bail out innapropriately from whatever
// The problem is that ';' can show up in far too many contexts, and if we see one
// and assume it's a statement, then we may bail out inappropriately from whatever
// we're parsing. For example, if we have a semicolon in the middle of a class, then
// we really don't want to assume the class is over and we're on a statement in the
// outer module. We just want to consume and move on.
@@ -3286,7 +3286,7 @@ module ts {
function isIntegerLiteral(expression: Expression): boolean {
function isInteger(literalExpression: LiteralExpression): boolean {
// Allows for scientific notation since literalExpression.text was formed by
// coercing a number to a string. Sometimes this coersion can yield a string
// coercing a number to a string. Sometimes this coercion can yield a string
// in scientific notation.
// We also don't need special logic for hex because a hex integer is converted
// to decimal when it is coerced.
@@ -3308,7 +3308,7 @@ module ts {
var inConstantEnumMemberSection = true;
// In an ambient declaration, the grammar only allows integer literals as initializers.
// In a nonambient declaration, the grammar allows uninitialized members only in a
// In a non-ambient declaration, the grammar allows uninitialized members only in a
// ConstantEnumMemberSection, which starts at the beginning of an enum declaration
// or any time an integer literal initializer is encountered.
function parseAndCheckEnumMember(): EnumMember {
@@ -3848,7 +3848,7 @@ module ts {
commonSourceDirectory = getNormalizedPathFromPathCompoments(commonPathComponents);
if (commonSourceDirectory) {
// Make sure directory path ends with directory separator so this string can directly
// used to replace with "" to get the relative path of the source file and the relative path doesnt
// used to replace with "" to get the relative path of the source file and the relative path doesn't
// start with / making it rooted path
commonSourceDirectory += directorySeparator;
}
+4 -4
View File
@@ -192,7 +192,7 @@ module ts {
return false;
}
// Perform binary search in one of the unicode range maps
// Perform binary search in one of the Unicode range maps
var lo: number = 0;
var hi: number = map.length;
var mid: number;
@@ -281,8 +281,8 @@ module ts {
if (lineNumber < 0) {
// If the actual position was not found,
// the binary search returns the negative value of the next line start
// eg. if line starts at [5, 10, 23, 80] and position requested was 20
// the search will return -2
// e.g. if the line starts at [5, 10, 23, 80] and the position requested was 20
// then the search will return -2
lineNumber = (~lineNumber) - 1;
}
return {
@@ -369,7 +369,7 @@ module ts {
// Extract comments from the given source text starting at the given position. If trailing is false, whitespace is skipped until
// the first line break and comments between that location and the next token are returned. If trailing is true, comments occurring
// between the given position and the next line break are returned. The return value is an array containing a TextRange for each
// comment. Single-line comment ranges include the the beginning '//' characters but not the ending line break. Multi-line comment
// comment. Single-line comment ranges include the beginning '//' characters but not the ending line break. Multi-line comment
// ranges include the beginning '/* and ending '*/' characters. The return value is undefined if no comments were found.
function getCommentRanges(text: string, pos: number, trailing: boolean): Comment[] {
var result: Comment[];
+1 -1
View File
@@ -648,7 +648,7 @@ module ts {
export interface SymbolAccessiblityResult {
accessibility: SymbolAccessibility;
errorSymbolName?: string // Optional symbol name that results in error
errorModuleName?: string // If the symbol is not visibile from module, module's name
errorModuleName?: string // If the symbol is not visible from module, module's name
aliasesToMakeVisible?: ImportDeclaration[]; // aliases that need to have this symbol visible
}
@@ -53,11 +53,11 @@ var A;
return Point;
})();
A.Point = Point;
var Point;
(function (Point) {
function Origin() {
return "";
}
Point.Origin = Origin; //expected duplicate identifier error
})(A.Point || (A.Point = {}));
var Point = A.Point;
})(Point = A.Point || (A.Point = {}));
})(A || (A = {}));
@@ -52,10 +52,10 @@ var A;
return Point;
})();
A.Point = Point;
var Point;
(function (Point) {
function Origin() {
return "";
} // not an error since not exported
})(A.Point || (A.Point = {}));
var Point = A.Point;
})(Point = A.Point || (A.Point = {}));
})(A || (A = {}));
@@ -46,8 +46,8 @@ var A;
return Point;
})();
A.Point = Point;
var Point;
(function (Point) {
Point.Origin = ""; //expected duplicate identifier error
})(A.Point || (A.Point = {}));
var Point = A.Point;
})(Point = A.Point || (A.Point = {}));
})(A || (A = {}));
@@ -46,8 +46,8 @@ var A;
return Point;
})();
A.Point = Point;
var Point;
(function (Point) {
var Origin = ""; // not an error since not exported
})(A.Point || (A.Point = {}));
var Point = A.Point;
})(Point = A.Point || (A.Point = {}));
})(A || (A = {}));
@@ -43,6 +43,7 @@ var a: { id: string };
//// [class.js]
var X;
(function (X) {
var Y;
(function (Y) {
var Point = (function () {
function Point(x, y) {
@@ -52,19 +53,18 @@ var X;
return Point;
})();
Y.Point = Point;
})(X.Y || (X.Y = {}));
var Y = X.Y;
})(Y = X.Y || (X.Y = {}));
})(X || (X = {}));
//// [module.js]
var X;
(function (X) {
var Y;
(function (Y) {
var Point;
(function (Point) {
Point.Origin = new Point(0, 0);
})(Y.Point || (Y.Point = {}));
var Point = Y.Point;
})(X.Y || (X.Y = {}));
var Y = X.Y;
})(Point = Y.Point || (Y.Point = {}));
})(Y = X.Y || (X.Y = {}));
})(X || (X = {}));
//// [test.js]
//var cl: { x: number; y: number; }
@@ -31,6 +31,7 @@ var A;
return Point;
})();
A.Point = Point;
var B;
(function (B) {
B.Origin = new Point(0, 0);
var Line = (function () {
@@ -42,6 +43,5 @@ var A;
return Line;
})();
B.Line = Line;
})(A.B || (A.B = {}));
var B = A.B;
})(B = A.B || (A.B = {}));
})(A || (A = {}));
@@ -54,10 +54,10 @@ var A;
//// [module.js]
var A;
(function (A) {
var Point;
(function (Point) {
Point.Origin = { x: 0, y: 0 };
})(A.Point || (A.Point = {}));
var Point = A.Point;
})(Point = A.Point || (A.Point = {}));
})(A || (A = {}));
//// [test.js]
var fn;
@@ -72,10 +72,10 @@ var B;
return { x: 0, y: 0 };
}
B.Point = Point;
var Point;
(function (Point) {
Point.Origin = { x: 0, y: 0 };
})(B.Point || (B.Point = {}));
var Point = B.Point;
})(Point = B.Point || (B.Point = {}));
})(B || (B = {}));
var fn;
var fn = B.Point; // not expected to be an error. bug 840000: [corelang] Function of fundule not assignalbe as expected
@@ -33,10 +33,10 @@ var A;
//// [module.js]
var B;
(function (B) {
var Point;
(function (Point) {
Point.Origin = { x: 0, y: 0 };
})(B.Point || (B.Point = {}));
var Point = B.Point;
})(Point = B.Point || (B.Point = {}));
})(B || (B = {}));
//// [test.js]
var fn;
@@ -34,17 +34,18 @@ class A {
//// [module.js]
var X;
(function (X) {
var Y;
(function (Y) {
var Point;
(function (Point) {
Point.Origin = new Point(0, 0);
})(Y.Point || (Y.Point = {}));
var Point = Y.Point;
})(X.Y || (X.Y = {}));
var Y = X.Y;
})(Point = Y.Point || (Y.Point = {}));
})(Y = X.Y || (X.Y = {}));
})(X || (X = {}));
//// [classPoint.js]
var X;
(function (X) {
var Y;
(function (Y) {
// duplicate identifier
var Point = (function () {
@@ -55,8 +56,7 @@ var X;
return Point;
})();
Y.Point = Point;
})(X.Y || (X.Y = {}));
var Y = X.Y;
})(Y = X.Y || (X.Y = {}));
})(X || (X = {}));
//// [simple.js]
var A;
@@ -32,10 +32,10 @@ module B {
//// [module.js]
var A;
(function (A) {
var Point;
(function (Point) {
Point.Origin = { x: 0, y: 0 };
})(A.Point || (A.Point = {}));
var Point = A.Point;
})(Point = A.Point || (A.Point = {}));
})(A || (A = {}));
//// [function.js]
var A;
@@ -49,10 +49,10 @@ var A;
//// [simple.js]
var B;
(function (B) {
var Point;
(function (Point) {
Point.Origin = { x: 0, y: 0 };
})(B.Point || (B.Point = {}));
var Point = B.Point;
})(Point = B.Point || (B.Point = {}));
// duplicate identifier error
function Point() {
return { x: 0, y: 0 };
@@ -66,7 +66,9 @@ var p;
var p;
var X;
(function (X) {
var Y;
(function (Y) {
var Z;
(function (Z) {
var Line = (function () {
function Line() {
@@ -74,24 +76,22 @@ var X;
return Line;
})();
Z.Line = Line;
})(Y.Z || (Y.Z = {}));
var Z = Y.Z;
})(X.Y || (X.Y = {}));
var Y = X.Y;
})(Z = Y.Z || (Y.Z = {}));
})(Y = X.Y || (X.Y = {}));
})(X || (X = {}));
var X;
(function (X) {
var Y;
(function (Y) {
var Z;
(function (Z) {
var Line = (function () {
function Line() {
}
return Line;
})();
})(Y.Z || (Y.Z = {}));
var Z = Y.Z;
})(X.Y || (X.Y = {}));
var Y = X.Y;
})(Z = Y.Z || (Y.Z = {}));
})(Y = X.Y || (X.Y = {}));
})(X || (X = {}));
// ensure merges as expected
var l;
@@ -44,13 +44,13 @@ var p = new A.Utils.Plane(o, { x: 1, y: 1 });
//// [part1.js]
var A;
(function (A) {
var Utils;
(function (Utils) {
function mirror(p) {
return { x: p.y, y: p.x };
}
Utils.mirror = mirror;
})(A.Utils || (A.Utils = {}));
var Utils = A.Utils;
})(Utils = A.Utils || (A.Utils = {}));
A.Origin = { x: 0, y: 0 };
})(A || (A = {}));
//// [part2.js]
@@ -58,6 +58,7 @@ var A;
(function (A) {
// not a collision, since we don't export
var Origin = "0,0";
var Utils;
(function (Utils) {
var Plane = (function () {
function Plane(tl, br) {
@@ -67,8 +68,7 @@ var A;
return Plane;
})();
Utils.Plane = Plane;
})(A.Utils || (A.Utils = {}));
var Utils = A.Utils;
})(Utils = A.Utils || (A.Utils = {}));
})(A || (A = {}));
//// [part3.js]
// test the merging actually worked
@@ -54,7 +54,9 @@ var A;
})(A || (A = {}));
var X;
(function (X) {
var Y;
(function (Y) {
var Z;
(function (Z) {
var Line = (function () {
function Line() {
@@ -62,14 +64,14 @@ var X;
return Line;
})();
Z.Line = Line;
})(Y.Z || (Y.Z = {}));
var Z = Y.Z;
})(X.Y || (X.Y = {}));
var Y = X.Y;
})(Z = Y.Z || (Y.Z = {}));
})(Y = X.Y || (X.Y = {}));
})(X || (X = {}));
var X;
(function (X) {
var Y;
(function (Y) {
var Z;
(function (Z) {
// expected error
var Line = (function () {
@@ -78,8 +80,6 @@ var X;
return Line;
})();
Z.Line = Line;
})(Y.Z || (Y.Z = {}));
var Z = Y.Z;
})(X.Y || (X.Y = {}));
var Y = X.Y;
})(Z = Y.Z || (Y.Z = {}));
})(Y = X.Y || (X.Y = {}));
})(X || (X = {}));
@@ -37,10 +37,10 @@ var l: X.Y.Z.Line;
//// [TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.js]
var A;
(function (A) {
var B;
(function (B) {
B.x;
})(A.B || (A.B = {}));
var B = A.B;
})(B = A.B || (A.B = {}));
})(A || (A = {}));
var A;
(function (A) {
@@ -54,7 +54,9 @@ var x;
var x = A.B.x;
var X;
(function (X) {
var Y;
(function (Y) {
var Z;
(function (Z) {
var Line = (function () {
function Line() {
@@ -62,13 +64,12 @@ var X;
return Line;
})();
Z.Line = Line;
})(Y.Z || (Y.Z = {}));
var Z = Y.Z;
})(X.Y || (X.Y = {}));
var Y = X.Y;
})(Z = Y.Z || (Y.Z = {}));
})(Y = X.Y || (X.Y = {}));
})(X || (X = {}));
var X;
(function (X) {
var Y;
(function (Y) {
var Z;
(function (Z) {
@@ -79,8 +80,7 @@ var X;
})();
Z.Line = Line;
})(Z || (Z = {}));
})(X.Y || (X.Y = {}));
var Y = X.Y;
})(Y = X.Y || (X.Y = {}));
})(X || (X = {}));
// make sure merging works as expected
var l;
@@ -33,23 +33,25 @@ module otherRoot {
//// [part1.js]
var Root;
(function (Root) {
var A;
(function (A) {
var Utils;
(function (Utils) {
function mirror(p) {
return { x: p.y, y: p.x };
}
Utils.mirror = mirror;
})(A.Utils || (A.Utils = {}));
var Utils = A.Utils;
})(Root.A || (Root.A = {}));
var A = Root.A;
})(Utils = A.Utils || (A.Utils = {}));
})(A = Root.A || (Root.A = {}));
})(Root || (Root = {}));
//// [part2.js]
var otherRoot;
(function (otherRoot) {
var A;
(function (A) {
// have to be fully qualified since in different root
A.Origin = { x: 0, y: 0 };
var Utils;
(function (Utils) {
var Plane = (function () {
function Plane(tl, br) {
@@ -59,8 +61,6 @@ var otherRoot;
return Plane;
})();
Utils.Plane = Plane;
})(A.Utils || (A.Utils = {}));
var Utils = A.Utils;
})(otherRoot.A || (otherRoot.A = {}));
var A = otherRoot.A;
})(Utils = A.Utils || (A.Utils = {}));
})(A = otherRoot.A || (otherRoot.A = {}));
})(otherRoot || (otherRoot = {}));
@@ -42,18 +42,19 @@ var p = new A.Utils.Plane(o, { x: 1, y: 1 });
//// [part1.js]
var A;
(function (A) {
var Utils;
(function (Utils) {
function mirror(p) {
return { x: p.y, y: p.x };
}
Utils.mirror = mirror;
})(A.Utils || (A.Utils = {}));
var Utils = A.Utils;
})(Utils = A.Utils || (A.Utils = {}));
})(A || (A = {}));
//// [part2.js]
var A;
(function (A) {
A.Origin = { x: 0, y: 0 };
var Utils;
(function (Utils) {
var Plane = (function () {
function Plane(tl, br) {
@@ -63,8 +64,7 @@ var A;
return Plane;
})();
Utils.Plane = Plane;
})(A.Utils || (A.Utils = {}));
var Utils = A.Utils;
})(Utils = A.Utils || (A.Utils = {}));
})(A || (A = {}));
//// [part3.js]
// test the merging actually worked
+4 -4
View File
@@ -29,7 +29,9 @@ var foo;
return Provide;
})();
foo.Provide = Provide;
var bar;
(function (bar) {
var baz;
(function (baz) {
var boo = (function () {
function boo() {
@@ -37,10 +39,8 @@ var foo;
return boo;
})();
baz.boo = boo;
})(bar.baz || (bar.baz = {}));
var baz = bar.baz;
})(foo.bar || (foo.bar = {}));
var bar = foo.bar;
})(baz = bar.baz || (bar.baz = {}));
})(bar = foo.bar || (foo.bar = {}));
})(foo || (foo = {}));
var provide = foo;
var booz = foo.bar.baz;
@@ -3,8 +3,9 @@
// has type { foo: string }[], which is not assignable to { id: number }[].
<{ id: number; }[]>[{ foo: "s" }];
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! Neither type '{ id: number; }[]' nor type '{ foo: string; }[]' is assignable to the other:
!!! Type '{ id: number; }' is not assignable to type '{ foo: string; }'.
!!! Neither type '{ foo: string; }[]' nor type '{ id: number; }[]' is assignable to the other:
!!! Type '{ foo: string; }' is not assignable to type '{ id: number; }':
!!! Property 'id' is missing in type '{ foo: string; }'.
// Should succeed, as the {} element causes the type of the array to be {}[]
<{ id: number; }[]>[{ foo: "s" }, {}];
@@ -91,10 +91,10 @@ M = { y: 3 }; // Error
(M) = { y: 3 }; // Error
var M2;
(function (M2) {
var M3;
(function (M3) {
M3.x;
})(M2.M3 || (M2.M3 = {}));
var M3 = M2.M3;
})(M3 = M2.M3 || (M2.M3 = {}));
M3 = { x: 3 }; // Error
})(M2 || (M2 = {}));
M2.M3 = { x: 3 }; // OK
@@ -12,12 +12,12 @@ y.m.foo();
//// [chainedImportAlias_file0.js]
var m;
(function (m) {
function foo() {
}
m.foo = foo;
})(exports.m || (exports.m = {}));
var m = exports.m;
})(m = exports.m || (exports.m = {}));
//// [chainedImportAlias_file1.js]
var x = require('chainedImportAlias_file0');
var y = x;
@@ -26,10 +26,10 @@ var M;
return N;
})();
M.N = N;
var N;
(function (N) {
N.v = 0;
})(M.N || (M.N = {}));
var N = M.N;
})(N = M.N || (M.N = {}));
})(M || (M = {}));
var M;
(function (M) {
@@ -31,9 +31,9 @@ var A;
})(A || (A = {}));
var A;
(function (A) {
var B;
(function (B) {
B.x = 1;
})(A.B || (A.B = {}));
var B = A.B;
})(B = A.B || (A.B = {}));
})(A || (A = {}));
var b; // ok
@@ -16,8 +16,8 @@ var M;
return C;
})();
M.C = C;
var C;
(function (_C) {
_C.C = M.C;
})(M.C || (M.C = {}));
var C = M.C;
})(C = M.C || (M.C = {}));
})(M || (M = {}));
@@ -36,13 +36,13 @@ var Shape = (function () {
})();
var Shape;
(function (Shape) {
var Utils;
(function (Utils) {
function convert() {
return null;
}
Utils.convert = convert;
})(Shape.Utils || (Shape.Utils = {}));
var Utils = Shape.Utils;
})(Utils = Shape.Utils || (Shape.Utils = {}));
})(Shape || (Shape = {}));
var Path = (function (_super) {
__extends(Path, _super);
@@ -53,11 +53,11 @@ var Path = (function (_super) {
})(Shape);
var Path;
(function (Path) {
var Utils;
(function (Utils) {
function convert2() {
return null;
}
Utils.convert2 = convert2;
})(Path.Utils || (Path.Utils = {}));
var Utils = Path.Utils;
})(Utils = Path.Utils || (Path.Utils = {}));
})(Path || (Path = {}));
@@ -24,6 +24,7 @@ module m2 {
//// [collisionExportsRequireAndInternalModuleAlias.js]
define(["require", "exports"], function (require, exports) {
var m;
(function (m) {
var c = (function () {
function c() {
@@ -31,8 +32,7 @@ define(["require", "exports"], function (require, exports) {
return c;
})();
m.c = c;
})(exports.m || (exports.m = {}));
var m = exports.m;
})(m = exports.m || (exports.m = {}));
var exports = m.c;
var require = m.c;
new exports();
@@ -93,6 +93,7 @@ module m4 {
//// [collisionExportsRequireAndModule_externalmodule.js]
define(["require", "exports"], function (require, exports) {
var require;
(function (require) {
var C = (function () {
function C() {
@@ -100,12 +101,12 @@ define(["require", "exports"], function (require, exports) {
return C;
})();
require.C = C;
})(exports.require || (exports.require = {}));
var require = exports.require;
})(require = exports.require || (exports.require = {}));
function foo() {
return null;
}
exports.foo = foo;
var exports;
(function (exports) {
var C = (function () {
function C() {
@@ -113,8 +114,7 @@ define(["require", "exports"], function (require, exports) {
return C;
})();
exports.C = C;
})(exports.exports || (exports.exports = {}));
var exports = exports.exports;
})(exports = exports.exports || (exports.exports = {}));
function foo2() {
return null;
}
@@ -142,6 +142,7 @@ define(["require", "exports"], function (require, exports) {
})(m1 || (m1 = {}));
var m2;
(function (m2) {
var require;
(function (require) {
var C = (function () {
function C() {
@@ -149,8 +150,8 @@ define(["require", "exports"], function (require, exports) {
return C;
})();
require.C = C;
})(m2.require || (m2.require = {}));
var require = m2.require;
})(require = m2.require || (m2.require = {}));
var exports;
(function (exports) {
var C = (function () {
function C() {
@@ -158,8 +159,7 @@ define(["require", "exports"], function (require, exports) {
return C;
})();
exports.C = C;
})(m2.exports || (m2.exports = {}));
var exports = m2.exports;
})(exports = m2.exports || (m2.exports = {}));
})(m2 || (m2 = {}));
});
//// [collisionExportsRequireAndModule_globalFile.js]
@@ -204,6 +204,7 @@ var m3;
})(m3 || (m3 = {}));
var m4;
(function (m4) {
var require;
(function (require) {
var C = (function () {
function C() {
@@ -211,8 +212,8 @@ var m4;
return C;
})();
require.C = C;
})(m4.require || (m4.require = {}));
var require = m4.require;
})(require = m4.require || (m4.require = {}));
var exports;
(function (exports) {
var C = (function () {
function C() {
@@ -220,6 +221,5 @@ var m4;
return C;
})();
exports.C = C;
})(m4.exports || (m4.exports = {}));
var exports = m4.exports;
})(exports = m4.exports || (m4.exports = {}));
})(m4 || (m4 = {}));
@@ -10,7 +10,9 @@ export module outerModule.InnerModule {
//// [commentsDottedModuleName.js]
define(["require", "exports"], function (require, exports) {
/** this is multi declare module*/
var outerModule;
(function (outerModule) {
var InnerModule;
(function (InnerModule) {
/// class b comment
var b = (function () {
@@ -19,10 +21,8 @@ define(["require", "exports"], function (require, exports) {
return b;
})();
InnerModule.b = b;
})(outerModule.InnerModule || (outerModule.InnerModule = {}));
var InnerModule = outerModule.InnerModule;
})(exports.outerModule || (exports.outerModule = {}));
var outerModule = exports.outerModule;
})(InnerModule = outerModule.InnerModule || (outerModule.InnerModule = {}));
})(outerModule = exports.outerModule || (exports.outerModule = {}));
});
@@ -64,6 +64,7 @@ var newVar2 = new extMod.m4.m2.c();
//// [commentsExternalModules_0.js]
define(["require", "exports"], function (require, exports) {
/** Module comment*/
var m1;
(function (m1) {
/** b's comment*/
m1.b;
@@ -72,6 +73,7 @@ define(["require", "exports"], function (require, exports) {
return m1.b;
}
/** m2 comments*/
var m2;
(function (m2) {
/** class comment;*/
var c = (function () {
@@ -83,18 +85,17 @@ define(["require", "exports"], function (require, exports) {
;
/** i*/
m2.i = new c();
})(m1.m2 || (m1.m2 = {}));
var m2 = m1.m2;
})(m2 = m1.m2 || (m1.m2 = {}));
/** exported function*/
function fooExport() {
return foo();
}
m1.fooExport = fooExport;
})(exports.m1 || (exports.m1 = {}));
var m1 = exports.m1;
})(m1 = exports.m1 || (exports.m1 = {}));
m1.fooExport();
var myvar = new m1.m2.c();
/** Module comment */
var m4;
(function (m4) {
/** b's comment */
m4.b;
@@ -105,6 +106,7 @@ define(["require", "exports"], function (require, exports) {
}
/** m2 comments
*/
var m2;
(function (m2) {
/** class comment; */
var c = (function () {
@@ -116,15 +118,13 @@ define(["require", "exports"], function (require, exports) {
;
/** i */
m2.i = new c();
})(m4.m2 || (m4.m2 = {}));
var m2 = m4.m2;
})(m2 = m4.m2 || (m4.m2 = {}));
/** exported function */
function fooExport() {
return foo();
}
m4.fooExport = fooExport;
})(exports.m4 || (exports.m4 = {}));
var m4 = exports.m4;
})(m4 = exports.m4 || (exports.m4 = {}));
m4.fooExport();
var myvar2 = new m4.m2.c();
});
@@ -64,6 +64,7 @@ export var newVar2 = new extMod.m4.m2.c();
//// [commentsExternalModules2_0.js]
define(["require", "exports"], function (require, exports) {
/** Module comment*/
var m1;
(function (m1) {
/** b's comment*/
m1.b;
@@ -72,6 +73,7 @@ define(["require", "exports"], function (require, exports) {
return m1.b;
}
/** m2 comments*/
var m2;
(function (m2) {
/** class comment;*/
var c = (function () {
@@ -83,18 +85,17 @@ define(["require", "exports"], function (require, exports) {
;
/** i*/
m2.i = new c();
})(m1.m2 || (m1.m2 = {}));
var m2 = m1.m2;
})(m2 = m1.m2 || (m1.m2 = {}));
/** exported function*/
function fooExport() {
return foo();
}
m1.fooExport = fooExport;
})(exports.m1 || (exports.m1 = {}));
var m1 = exports.m1;
})(m1 = exports.m1 || (exports.m1 = {}));
m1.fooExport();
var myvar = new m1.m2.c();
/** Module comment */
var m4;
(function (m4) {
/** b's comment */
m4.b;
@@ -105,6 +106,7 @@ define(["require", "exports"], function (require, exports) {
}
/** m2 comments
*/
var m2;
(function (m2) {
/** class comment; */
var c = (function () {
@@ -116,15 +118,13 @@ define(["require", "exports"], function (require, exports) {
;
/** i */
m2.i = new c();
})(m4.m2 || (m4.m2 = {}));
var m2 = m4.m2;
})(m2 = m4.m2 || (m4.m2 = {}));
/** exported function */
function fooExport() {
return foo();
}
m4.fooExport = fooExport;
})(exports.m4 || (exports.m4 = {}));
var m4 = exports.m4;
})(m4 = exports.m4 || (exports.m4 = {}));
m4.fooExport();
var myvar2 = new m4.m2.c();
});
@@ -63,6 +63,7 @@ export var newVar2 = new extMod.m4.m2.c();
//// [commentsExternalModules2_0.js]
/** Module comment*/
var m1;
(function (m1) {
/** b's comment*/
m1.b;
@@ -71,6 +72,7 @@ export var newVar2 = new extMod.m4.m2.c();
return m1.b;
}
/** m2 comments*/
var m2;
(function (m2) {
/** class comment;*/
var c = (function () {
@@ -82,18 +84,17 @@ export var newVar2 = new extMod.m4.m2.c();
;
/** i*/
m2.i = new c();
})(m1.m2 || (m1.m2 = {}));
var m2 = m1.m2;
})(m2 = m1.m2 || (m1.m2 = {}));
/** exported function*/
function fooExport() {
return foo();
}
m1.fooExport = fooExport;
})(exports.m1 || (exports.m1 = {}));
var m1 = exports.m1;
})(m1 = exports.m1 || (exports.m1 = {}));
m1.fooExport();
var myvar = new m1.m2.c();
/** Module comment */
var m4;
(function (m4) {
/** b's comment */
m4.b;
@@ -104,6 +105,7 @@ var myvar = new m1.m2.c();
}
/** m2 comments
*/
var m2;
(function (m2) {
/** class comment; */
var c = (function () {
@@ -115,15 +117,13 @@ var myvar = new m1.m2.c();
;
/** i */
m2.i = new c();
})(m4.m2 || (m4.m2 = {}));
var m2 = m4.m2;
})(m2 = m4.m2 || (m4.m2 = {}));
/** exported function */
function fooExport() {
return foo();
}
m4.fooExport = fooExport;
})(exports.m4 || (exports.m4 = {}));
var m4 = exports.m4;
})(m4 = exports.m4 || (exports.m4 = {}));
m4.fooExport();
var myvar2 = new m4.m2.c();
//// [commentsExternalModules_1.js]
+28 -28
View File
@@ -108,6 +108,7 @@ var m1;
return m1.b;
}
/** m2 comments*/
var m2;
(function (m2) {
/** class comment;*/
var c = (function () {
@@ -119,8 +120,7 @@ var m1;
;
/** i*/
m2.i = new c();
})(m1.m2 || (m1.m2 = {}));
var m2 = m1.m2;
})(m2 = m1.m2 || (m1.m2 = {}));
/** exported function*/
function fooExport() {
return foo();
@@ -147,6 +147,7 @@ var myvar = new m1.m2.c();
/** module comment of m2.m3*/
var m2;
(function (m2) {
var m3;
(function (m3) {
/** Exported class comment*/
var c = (function () {
@@ -155,14 +156,15 @@ var m2;
return c;
})();
m3.c = c;
})(m2.m3 || (m2.m3 = {}));
var m3 = m2.m3;
})(m3 = m2.m3 || (m2.m3 = {}));
})(m2 || (m2 = {})); /* trailing dotted module comment*/
new m2.m3.c();
/** module comment of m3.m4.m5*/
var m3;
(function (m3) {
var m4;
(function (m4) {
var m5;
(function (m5) {
/** Exported class comment*/
var c = (function () {
@@ -171,17 +173,18 @@ var m3;
return c;
})();
m5.c = c;
})(m4.m5 || (m4.m5 = {}));
var m5 = m4.m5;
})(m3.m4 || (m3.m4 = {}));
var m4 = m3.m4;
})(m5 = m4.m5 || (m4.m5 = {}));
})(m4 = m3.m4 || (m3.m4 = {}));
})(m3 || (m3 = {})); // trailing dotted module 2
new m3.m4.m5.c();
/** module comment of m4.m5.m6*/
var m4;
(function (m4) {
var m5;
(function (m5) {
var m6;
(function (m6) {
var m7;
(function (m7) {
/** Exported class comment*/
var c = (function () {
@@ -190,20 +193,20 @@ var m4;
return c;
})();
m7.c = c;
})(m6.m7 || (m6.m7 = {}));
var m7 = m6.m7; /* trailing inner module */ /* multiple comments*/
})(m5.m6 || (m5.m6 = {}));
var m6 = m5.m6;
})(m4.m5 || (m4.m5 = {}));
var m5 = m4.m5;
})(m7 = m6.m7 || (m6.m7 = {})); /* trailing inner module */ /* multiple comments*/
})(m6 = m5.m6 || (m5.m6 = {}));
})(m5 = m4.m5 || (m4.m5 = {}));
})(m4 || (m4 = {}));
new m4.m5.m6.m7.c();
/** module comment of m5.m6.m7*/
var m5;
(function (m5) {
var m6;
(function (m6) {
var m7;
(function (m7) {
/** module m8 comment*/
var m8;
(function (m8) {
/** Exported class comment*/
var c = (function () {
@@ -212,17 +215,16 @@ var m5;
return c;
})();
m8.c = c;
})(m7.m8 || (m7.m8 = {}));
var m8 = m7.m8;
})(m6.m7 || (m6.m7 = {}));
var m7 = m6.m7;
})(m5.m6 || (m5.m6 = {}));
var m6 = m5.m6;
})(m8 = m7.m8 || (m7.m8 = {}));
})(m7 = m6.m7 || (m6.m7 = {}));
})(m6 = m5.m6 || (m5.m6 = {}));
})(m5 || (m5 = {}));
new m5.m6.m7.m8.c();
var m6;
(function (m6) {
var m7;
(function (m7) {
var m8;
(function (m8) {
/** Exported class comment*/
var c = (function () {
@@ -231,16 +233,16 @@ var m6;
return c;
})();
m8.c = c;
})(m7.m8 || (m7.m8 = {}));
var m8 = m7.m8;
})(m6.m7 || (m6.m7 = {}));
var m7 = m6.m7;
})(m8 = m7.m8 || (m7.m8 = {}));
})(m7 = m6.m7 || (m6.m7 = {}));
})(m6 || (m6 = {}));
new m6.m7.m8.c();
var m7;
(function (m7) {
var m8;
(function (m8) {
/** module m9 comment*/
var m9;
(function (m9) {
/** Exported class comment*/
var c = (function () {
@@ -262,10 +264,8 @@ var m7;
return e;
})();
m9.e = e;
})(m8.m9 || (m8.m9 = {}));
var m9 = m8.m9;
})(m7.m8 || (m7.m8 = {}));
var m8 = m7.m8;
})(m9 = m8.m9 || (m8.m9 = {}));
})(m8 = m7.m8 || (m7.m8 = {}));
})(m7 || (m7 = {}));
new m7.m8.m9.c();
@@ -39,6 +39,7 @@ new multiM.d();
//// [commentsMultiModuleMultiFile_0.js]
define(["require", "exports"], function (require, exports) {
/** this is multi declare module*/
var multiM;
(function (multiM) {
/// class b comment
var b = (function () {
@@ -47,9 +48,9 @@ define(["require", "exports"], function (require, exports) {
return b;
})();
multiM.b = b;
})(exports.multiM || (exports.multiM = {}));
var multiM = exports.multiM;
})(multiM = exports.multiM || (exports.multiM = {}));
/** thi is multi module 2*/
var multiM;
(function (multiM) {
/** class c comment*/
var c = (function () {
@@ -65,14 +66,14 @@ define(["require", "exports"], function (require, exports) {
return e;
})();
multiM.e = e;
})(exports.multiM || (exports.multiM = {}));
var multiM = exports.multiM;
})(multiM = exports.multiM || (exports.multiM = {}));
new multiM.b();
new multiM.c();
});
//// [commentsMultiModuleMultiFile_1.js]
define(["require", "exports"], function (require, exports) {
/** this is multi module 3 comment*/
var multiM;
(function (multiM) {
/** class d comment*/
var d = (function () {
@@ -88,8 +89,7 @@ define(["require", "exports"], function (require, exports) {
return f;
})();
multiM.f = f;
})(exports.multiM || (exports.multiM = {}));
var multiM = exports.multiM;
})(multiM = exports.multiM || (exports.multiM = {}));
new multiM.d();
});
@@ -1,4 +1,5 @@
==== tests/cases/compiler/contextualTyping39.ts (1 errors) ====
var foo = <{ (): number; }> function() { return "err"; };
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! Neither type '() => number' nor type '() => string' is assignable to the other.
!!! Neither type '() => string' nor type '() => number' is assignable to the other:
!!! Type 'string' is not assignable to type 'number'.
@@ -1,4 +1,5 @@
==== tests/cases/compiler/contextualTyping41.ts (1 errors) ====
var foo = <{():number; (i:number):number; }> (function(){return "err";});
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! Neither type '{ (): number; (i: number): number; }' nor type '() => string' is assignable to the other.
!!! Neither type '() => string' nor type '{ (): number; (i: number): number; }' is assignable to the other:
!!! Type 'string' is not assignable to type 'number'.
@@ -28,7 +28,9 @@ module MsPortal.Util.TemplateEngine {
//// [crashRegressionTest.js]
var MsPortal;
(function (MsPortal) {
var Util;
(function (Util) {
var TemplateEngine;
(function (TemplateEngine) {
"use strict";
var StringTemplate = (function () {
@@ -48,8 +50,6 @@ var MsPortal;
return TemplateStorage;
})();
TemplateEngine.TemplateStorage = TemplateStorage;
})(Util.TemplateEngine || (Util.TemplateEngine = {}));
var TemplateEngine = Util.TemplateEngine;
})(MsPortal.Util || (MsPortal.Util = {}));
var Util = MsPortal.Util;
})(TemplateEngine = Util.TemplateEngine || (Util.TemplateEngine = {}));
})(Util = MsPortal.Util || (MsPortal.Util = {}));
})(MsPortal || (MsPortal = {}));
@@ -28,6 +28,7 @@ export var x: c.b1.a.m2.c1;
define(["require", "exports"], function (require, exports) {
var m1;
(function (m1) {
var m2;
(function (m2) {
var c1 = (function () {
function c1() {
@@ -35,8 +36,7 @@ define(["require", "exports"], function (require, exports) {
return c1;
})();
m2.c1 = c1;
})(m1.m2 || (m1.m2 = {}));
var m2 = m1.m2;
})(m2 = m1.m2 || (m1.m2 = {}));
})(m1 || (m1 = {}));
return m1;
});
@@ -25,6 +25,7 @@ export var x: c.b.m2.c1;
define(["require", "exports"], function (require, exports) {
var m1;
(function (m1) {
var m2;
(function (m2) {
var c1 = (function () {
function c1() {
@@ -32,8 +33,7 @@ define(["require", "exports"], function (require, exports) {
return c1;
})();
m2.c1 = c1;
})(m1.m2 || (m1.m2 = {}));
var m2 = m1.m2;
})(m2 = m1.m2 || (m1.m2 = {}));
})(m1 || (m1 = {}));
return m1;
});
@@ -46,6 +46,7 @@ var __extends = this.__extends || function (d, b) {
__.prototype = b.prototype;
d.prototype = new __();
};
var C;
(function (C) {
var A = (function () {
function A() {
@@ -90,8 +91,7 @@ var __extends = this.__extends || function (d, b) {
return D;
})();
C.D = D;
})(exports.C || (exports.C = {}));
var C = exports.C;
})(C = exports.C || (exports.C = {}));
exports.a;
exports.b = C.F;
exports.c = C.F2;
@@ -52,7 +52,9 @@ var __extends = this.__extends || function (d, b) {
// Module
var templa;
(function (templa) {
var dom;
(function (dom) {
var mvc;
(function (mvc) {
var AbstractElementController = (function (_super) {
__extends(AbstractElementController, _super);
@@ -62,16 +64,17 @@ var templa;
return AbstractElementController;
})(templa.mvc.AbstractController);
mvc.AbstractElementController = AbstractElementController;
})(dom.mvc || (dom.mvc = {}));
var mvc = dom.mvc;
})(templa.dom || (templa.dom = {}));
var dom = templa.dom;
})(mvc = dom.mvc || (dom.mvc = {}));
})(dom = templa.dom || (templa.dom = {}));
})(templa || (templa = {}));
// Module
var templa;
(function (templa) {
var dom;
(function (dom) {
var mvc;
(function (mvc) {
var composite;
(function (composite) {
var AbstractCompositeElementController = (function (_super) {
__extends(AbstractCompositeElementController, _super);
@@ -82,12 +85,9 @@ var templa;
return AbstractCompositeElementController;
})(templa.dom.mvc.AbstractElementController);
composite.AbstractCompositeElementController = AbstractCompositeElementController;
})(mvc.composite || (mvc.composite = {}));
var composite = mvc.composite;
})(dom.mvc || (dom.mvc = {}));
var mvc = dom.mvc;
})(templa.dom || (templa.dom = {}));
var dom = templa.dom;
})(composite = mvc.composite || (mvc.composite = {}));
})(mvc = dom.mvc || (dom.mvc = {}));
})(dom = templa.dom || (templa.dom = {}));
})(templa || (templa = {}));
@@ -12,6 +12,7 @@ export = b;
//// [declFileImportChainInExportAssignment.js]
var m;
(function (m) {
var c;
(function (_c) {
var c = (function () {
function c() {
@@ -19,8 +20,7 @@ var m;
return c;
})();
_c.c = c;
})(m.c || (m.c = {}));
var c = m.c;
})(c = m.c || (m.c = {}));
})(m || (m = {}));
var a = m.c;
var b = a;
@@ -12,7 +12,9 @@ module A.B.C {
//// [declFileModuleContinuation.js]
var A;
(function (A) {
var B;
(function (B) {
var C;
(function (C) {
var W = (function () {
function W() {
@@ -20,10 +22,8 @@ var A;
return W;
})();
C.W = W;
})(B.C || (B.C = {}));
var C = B.C;
})(A.B || (A.B = {}));
var B = A.B;
})(C = B.C || (B.C = {}));
})(B = A.B || (A.B = {}));
})(A || (A = {}));
@@ -29,7 +29,9 @@ var __extends = this.__extends || function (d, b) {
};
var X;
(function (X) {
var Y;
(function (Y) {
var base;
(function (base) {
var W = (function (_super) {
__extends(W, _super);
@@ -39,15 +41,16 @@ var X;
return W;
})(A.B.Base.W);
base.W = W;
})(Y.base || (Y.base = {}));
var base = Y.base;
})(X.Y || (X.Y = {}));
var Y = X.Y;
})(base = Y.base || (Y.base = {}));
})(Y = X.Y || (X.Y = {}));
})(X || (X = {}));
var X;
(function (X) {
var Y;
(function (Y) {
var base;
(function (base) {
var Z;
(function (Z) {
var W = (function (_super) {
__extends(W, _super);
@@ -57,12 +60,9 @@ var X;
return W;
})(X.Y.base.W);
Z.W = W;
})(base.Z || (base.Z = {}));
var Z = base.Z;
})(Y.base || (Y.base = {}));
var base = Y.base;
})(X.Y || (X.Y = {}));
var Y = X.Y;
})(Z = base.Z || (base.Z = {}));
})(base = Y.base || (Y.base = {}));
})(Y = X.Y || (X.Y = {}));
})(X || (X = {}));
@@ -27,6 +27,7 @@ var __extends = this.__extends || function (d, b) {
};
var A;
(function (A) {
var B;
(function (B) {
var EventManager = (function () {
function EventManager() {
@@ -34,12 +35,13 @@ var A;
return EventManager;
})();
B.EventManager = EventManager;
})(A.B || (A.B = {}));
var B = A.B;
})(B = A.B || (A.B = {}));
})(A || (A = {}));
var A;
(function (A) {
var B;
(function (B) {
var C;
(function (C) {
var ContextMenu = (function (_super) {
__extends(ContextMenu, _super);
@@ -49,10 +51,8 @@ var A;
return ContextMenu;
})(B.EventManager);
C.ContextMenu = ContextMenu;
})(B.C || (B.C = {}));
var C = B.C;
})(A.B || (A.B = {}));
var B = A.B;
})(C = B.C || (B.C = {}));
})(B = A.B || (A.B = {}));
})(A || (A = {}));
@@ -14,8 +14,11 @@ module X.A.B.C {
//// [declFileWithInternalModuleNameConflictsInExtendsClause1.js]
var X;
(function (X) {
var A;
(function (A) {
var B;
(function (B) {
var C;
(function (C) {
var W = (function () {
function W() {
@@ -23,12 +26,9 @@ var X;
return W;
})();
C.W = W;
})(B.C || (B.C = {}));
var C = B.C;
})(A.B || (A.B = {}));
var B = A.B;
})(X.A || (X.A = {}));
var A = X.A;
})(C = B.C || (B.C = {}));
})(B = A.B || (A.B = {}));
})(A = X.A || (X.A = {}));
})(X || (X = {}));
@@ -17,8 +17,11 @@ module X.A.B.C {
//// [declFileWithInternalModuleNameConflictsInExtendsClause2.js]
var X;
(function (X) {
var A;
(function (A) {
var B;
(function (B) {
var C;
(function (C) {
var W = (function () {
function W() {
@@ -26,12 +29,9 @@ var X;
return W;
})();
C.W = W;
})(B.C || (B.C = {}));
var C = B.C;
})(A.B || (A.B = {}));
var B = A.B;
})(X.A || (X.A = {}));
var A = X.A;
})(C = B.C || (B.C = {}));
})(B = A.B || (A.B = {}));
})(A = X.A || (X.A = {}));
})(X || (X = {}));
@@ -17,8 +17,11 @@ module X.A.B.C {
//// [declFileWithInternalModuleNameConflictsInExtendsClause3.js]
var X;
(function (X) {
var A;
(function (A) {
var B;
(function (B) {
var C;
(function (C) {
var W = (function () {
function W() {
@@ -26,12 +29,9 @@ var X;
return W;
})();
C.W = W;
})(B.C || (B.C = {}));
var C = B.C;
})(A.B || (A.B = {}));
var B = A.B;
})(X.A || (X.A = {}));
var A = X.A;
})(C = B.C || (B.C = {}));
})(B = A.B || (A.B = {}));
})(A = X.A || (X.A = {}));
})(X || (X = {}));
@@ -62,6 +62,7 @@ var f;
module.exports = f;
//// [declarationEmit_nameConflicts_0.js]
var im = require('declarationEmit_nameConflicts_1');
var M;
(function (M) {
function f() {
}
@@ -72,20 +73,21 @@ var im = require('declarationEmit_nameConflicts_1');
return C;
})();
M.C = C;
var N;
(function (N) {
function g() {
}
N.g = g;
;
})(M.N || (M.N = {}));
var N = M.N;
})(N = M.N || (M.N = {}));
M.a = M.f;
M.b = M.C;
M.c = N;
M.d = im;
})(exports.M || (exports.M = {}));
var M = exports.M;
})(M = exports.M || (exports.M = {}));
var M;
(function (M) {
var P;
(function (P) {
function f() {
}
@@ -96,24 +98,24 @@ var M = exports.M;
return C;
})();
P.C = C;
var N;
(function (N) {
function g() {
}
N.g = g;
;
})(P.N || (P.N = {}));
var N = P.N;
})(N = P.N || (P.N = {}));
P.im = M.P.f;
P.a = M.a; // emitted incorrectly as typeof f
P.b = M.b; // ok
P.c = M.c; // ok
P.g = M.c.g; // ok
P.d = M.d; // emitted incorrectly as typeof im
})(M.P || (M.P = {}));
var P = M.P;
})(exports.M || (exports.M = {}));
var M = exports.M;
})(P = M.P || (M.P = {}));
})(M = exports.M || (exports.M = {}));
var M;
(function (M) {
var Q;
(function (Q) {
function f() {
}
@@ -124,17 +126,15 @@ var M = exports.M;
return C;
})();
Q.C = C;
var N;
(function (N) {
function g() {
}
N.g = g;
;
})(Q.N || (Q.N = {}));
var N = Q.N;
})(M.Q || (M.Q = {}));
var Q = M.Q;
})(exports.M || (exports.M = {}));
var M = exports.M;
})(N = Q.N || (Q.N = {}));
})(Q = M.Q || (M.Q = {}));
})(M = exports.M || (exports.M = {}));
//// [declarationEmit_nameConflicts_1.d.ts]
@@ -18,7 +18,9 @@ module X.Y.base.Z {
//// [declarationEmit_nameConflicts2.js]
var X;
(function (X) {
var Y;
(function (Y) {
var base;
(function (base) {
function f() {
}
@@ -29,33 +31,31 @@ var X;
return C;
})();
base.C = C;
var M;
(function (M) {
M.v;
})(base.M || (base.M = {}));
var M = base.M;
})(M = base.M || (base.M = {}));
(function (E) {
})(base.E || (base.E = {}));
var E = base.E;
})(Y.base || (Y.base = {}));
var base = Y.base;
})(X.Y || (X.Y = {}));
var Y = X.Y;
})(base = Y.base || (Y.base = {}));
})(Y = X.Y || (X.Y = {}));
})(X || (X = {}));
var X;
(function (X) {
var Y;
(function (Y) {
var base;
(function (base) {
var Z;
(function (Z) {
Z.f = X.Y.base.f; // Should be base.f
Z.C = X.Y.base.C; // Should be base.C
Z.M = X.Y.base.M; // Should be base.M
Z.E = X.Y.base.E; // Should be base.E
})(base.Z || (base.Z = {}));
var Z = base.Z;
})(Y.base || (Y.base = {}));
var base = Y.base;
})(X.Y || (X.Y = {}));
var Y = X.Y;
})(Z = base.Z || (base.Z = {}));
})(base = Y.base || (Y.base = {}));
})(Y = X.Y || (X.Y = {}));
})(X || (X = {}));
@@ -35,27 +35,28 @@ var __extends = this.__extends || function (d, b) {
};
var M;
(function (M) {
var D;
(function (D) {
function f() {
}
D.f = f;
})(M.D || (M.D = {}));
var D = M.D;
})(D = M.D || (M.D = {}));
var C;
(function (C) {
function f() {
}
C.f = f;
})(M.C || (M.C = {}));
var C = M.C;
})(C = M.C || (M.C = {}));
var E;
(function (E) {
function f() {
}
E.f = f;
})(M.E || (M.E = {}));
var E = M.E;
})(E = M.E || (M.E = {}));
})(M || (M = {}));
var M;
(function (M) {
var P;
(function (P) {
var C = (function () {
function C() {
@@ -81,8 +82,7 @@ var M;
P.w = M.D.f; // error, should be typeof M.D.f
P.x = M.C.f; // error, should be typeof M.C.f
P.x = M.E.f; // error, should be typeof M.E.f
})(M.P || (M.P = {}));
var P = M.P;
})(P = M.P || (M.P = {}));
})(M || (M = {}));
@@ -7,10 +7,10 @@ export module M {
}
//// [declarationEmit_nameConflictsWithAlias.js]
var M;
(function (M) {
M.w; // Gets emitted as C.I, which is the wrong interface
})(exports.M || (exports.M = {}));
var M = exports.M;
})(M = exports.M || (exports.M = {}));
//// [declarationEmit_nameConflictsWithAlias.d.ts]
@@ -22,7 +22,7 @@
// Contextually type the default arg with the type annotation
var f3 = function (a: (s: string) => any = (s) => <number>s) { };
~~~~~~~~~
!!! Neither type 'number' nor type 'string' is assignable to the other.
!!! Neither type 'string' nor type 'number' is assignable to the other.
// Type check using the function's contextual type
var f4: (a: number) => void = function (a = "") { };
@@ -32,7 +32,7 @@
// Contextually type the default arg using the function's contextual type
var f5: (a: (s: string) => any) => void = function (a = s => <number>s) { };
~~~~~~~~~
!!! Neither type 'number' nor type 'string' is assignable to the other.
!!! Neither type 'string' nor type 'number' is assignable to the other.
// Instantiated module
module T { }
@@ -46,27 +46,27 @@ module M
//// [dottedModuleName2.js]
var A;
(function (A) {
var B;
(function (B) {
B.x = 1;
})(A.B || (A.B = {}));
var B = A.B;
})(B = A.B || (A.B = {}));
})(A || (A = {}));
var AA;
(function (AA) {
var B;
(function (B) {
B.x = 1;
})(AA.B || (AA.B = {}));
var B = AA.B;
})(B = AA.B || (AA.B = {}));
})(AA || (AA = {}));
var tmpOK = AA.B.x;
var tmpError = A.B.x;
var A;
(function (A) {
var B;
(function (B) {
var C;
(function (C) {
C.x = 1;
})(B.C || (B.C = {}));
var C = B.C;
})(A.B || (A.B = {}));
var B = A.B;
})(C = B.C || (B.C = {}));
})(B = A.B || (A.B = {}));
})(A || (A = {}));
@@ -124,8 +124,8 @@ var Foo;
})(Foo || (Foo = {}));
var N;
(function (N) {
var F;
(function (F) {
var t;
})(N.F || (N.F = {}));
var F = N.F;
})(F = N.F || (N.F = {}));
})(N || (N = {}));
@@ -74,10 +74,10 @@ define(["require", "exports"], function (require, exports) {
(function (inst) {
var t;
})(inst || (inst = {}));
var inst;
(function (inst) {
var t;
})(M.inst || (M.inst = {}));
var inst = M.inst;
})(inst = M.inst || (M.inst = {}));
})(M || (M = {}));
// Variables of the same / different type
var M2;
@@ -104,9 +104,9 @@ define(["require", "exports"], function (require, exports) {
}
return C;
})();
var C;
(function (C) {
var t;
})(M.C || (M.C = {}));
var C = M.C;
})(C = M.C || (M.C = {}));
})(M || (M = {}));
});
@@ -29,7 +29,9 @@ module Microsoft.PeopleAtWork.Model {
"use strict";
var Microsoft;
(function (Microsoft) {
var PeopleAtWork;
(function (PeopleAtWork) {
var Model;
(function (Model) {
var _Person = (function () {
function _Person() {
@@ -40,10 +42,8 @@ var Microsoft;
return _Person;
})();
Model._Person = _Person;
})(PeopleAtWork.Model || (PeopleAtWork.Model = {}));
var Model = PeopleAtWork.Model;
})(Microsoft.PeopleAtWork || (Microsoft.PeopleAtWork = {}));
var PeopleAtWork = Microsoft.PeopleAtWork;
})(Model = PeopleAtWork.Model || (PeopleAtWork.Model = {}));
})(PeopleAtWork = Microsoft.PeopleAtWork || (Microsoft.PeopleAtWork = {}));
})(Microsoft || (Microsoft = {}));
//// [emitMemberAccessExpression_file1.js]
/// <reference path="emitMemberAccessExpression_file3.ts" />
@@ -53,7 +53,9 @@ var Microsoft;
/// <reference path="emitMemberAccessExpression_file1.ts" />
var Microsoft;
(function (Microsoft) {
var PeopleAtWork;
(function (PeopleAtWork) {
var Model;
(function (Model) {
var KnockoutExtentions = (function () {
function KnockoutExtentions() {
@@ -61,8 +63,6 @@ var Microsoft;
return KnockoutExtentions;
})();
Model.KnockoutExtentions = KnockoutExtentions;
})(PeopleAtWork.Model || (PeopleAtWork.Model = {}));
var Model = PeopleAtWork.Model;
})(Microsoft.PeopleAtWork || (Microsoft.PeopleAtWork = {}));
var PeopleAtWork = Microsoft.PeopleAtWork;
})(Model = PeopleAtWork.Model || (PeopleAtWork.Model = {}));
})(PeopleAtWork = Microsoft.PeopleAtWork || (Microsoft.PeopleAtWork = {}));
})(Microsoft || (Microsoft = {}));
+4 -4
View File
@@ -150,6 +150,7 @@ var M5;
})(M5 || (M5 = {}));
var M6;
(function (M6) {
var A;
(function (A) {
(function (Color) {
Color[Color["Red"] = 0] = "Red";
@@ -157,18 +158,17 @@ var M6;
Color[Color["Blue"] = 2] = "Blue";
})(A.Color || (A.Color = {}));
var Color = A.Color;
})(M6.A || (M6.A = {}));
var A = M6.A;
})(A = M6.A || (M6.A = {}));
})(M6 || (M6 = {}));
var M6;
(function (M6) {
var A;
(function (A) {
(function (Color) {
Color[Color["Yellow"] = 1] = "Yellow";
})(A.Color || (A.Color = {}));
var Color = A.Color;
})(M6.A || (M6.A = {}));
var A = M6.A;
})(A = M6.A || (M6.A = {}));
var t = 1 /* Yellow */;
t = 0 /* Red */;
})(M6 || (M6 = {}));
@@ -39,10 +39,10 @@ var Foo;
return a;
}
Foo.c = c;
var Test;
(function (Test) {
Test.answer = 42;
})(Foo.Test || (Foo.Test = {}));
var Test = Foo.Test;
})(Test = Foo.Test || (Foo.Test = {}));
})(Foo || (Foo = {}));
module.exports = Foo;
//// [foo_1.js]
+2 -2
View File
@@ -103,10 +103,10 @@ var E;
return C;
})();
E.C = C;
var M;
(function (M) {
M.x = 42;
})(E.M || (E.M = {}));
var M = E.M;
})(M = E.M || (E.M = {}));
})(E || (E = {}));
// validate all exportable statements,
// which are not exported
@@ -96,6 +96,7 @@ var X;
return 42;
}
X.Y = Y;
var Y;
(function (Y) {
var Point = (function () {
function Point(x, y) {
@@ -105,8 +106,7 @@ var X;
return Point;
})();
Y.Point = Point;
})(X.Y || (X.Y = {}));
var Y = X.Y;
})(Y = X.Y || (X.Y = {}));
})(X || (X = {}));
var Z;
(function (Z) {
@@ -124,10 +124,10 @@ var K;
return L;
})();
K.L = L;
var L;
(function (L) {
L.y = 12;
})(K.L || (K.L = {}));
var L = K.L;
})(L = K.L || (K.L = {}));
})(K || (K = {}));
var M;
(function (M) {
@@ -29,10 +29,10 @@ var K;
return L;
})();
K.L = L;
var L;
(function (L) {
L.y = 12;
})(K.L || (K.L = {}));
var L = K.L;
})(L = K.L || (K.L = {}));
})(K || (K = {}));
var M;
(function (M) {
@@ -20,20 +20,20 @@ function foo(title) {
}
var foo;
(function (foo) {
var Bar;
(function (Bar) {
function f() {
}
Bar.f = f;
})(foo.Bar || (foo.Bar = {}));
var Bar = foo.Bar;
})(Bar = foo.Bar || (foo.Bar = {}));
})(foo || (foo = {}));
var foo;
(function (foo) {
var Baz;
(function (Baz) {
function g() {
foo.Bar.f();
}
Baz.g = g;
})(foo.Baz || (foo.Baz = {}));
var Baz = foo.Baz;
})(Baz = foo.Baz || (foo.Baz = {}));
})(foo || (foo = {}));
+2 -1
View File
@@ -32,7 +32,8 @@
worksToo():R {
return <R>({ oneI: this });
~~~~~~~~~~~~~~~~~~~
!!! Neither type 'R' nor type '{ oneI: C; }' is assignable to the other.
!!! Neither type '{ oneI: C; }' nor type 'R' is assignable to the other:
!!! Property 'anything' is missing in type '{ oneI: C; }'.
}
}
}
@@ -84,7 +84,9 @@ var __extends = this.__extends || function (d, b) {
};
var Portal;
(function (Portal) {
var Controls;
(function (Controls) {
var Validators;
(function (Validators) {
var Validator = (function () {
function Validator(message) {
@@ -97,15 +99,16 @@ var Portal;
return Validator;
})();
Validators.Validator = Validator;
})(Controls.Validators || (Controls.Validators = {}));
var Validators = Controls.Validators;
})(Portal.Controls || (Portal.Controls = {}));
var Controls = Portal.Controls;
})(Validators = Controls.Validators || (Controls.Validators = {}));
})(Controls = Portal.Controls || (Portal.Controls = {}));
})(Portal || (Portal = {}));
var PortalFx;
(function (PortalFx) {
var ViewModels;
(function (ViewModels) {
var Controls;
(function (Controls) {
var Validators;
(function (Validators) {
var Validator = (function (_super) {
__extends(Validator, _super);
@@ -115,12 +118,9 @@ var PortalFx;
return Validator;
})(Portal.Controls.Validators.Validator);
Validators.Validator = Validator;
})(Controls.Validators || (Controls.Validators = {}));
var Validators = Controls.Validators;
})(ViewModels.Controls || (ViewModels.Controls = {}));
var Controls = ViewModels.Controls;
})(PortalFx.ViewModels || (PortalFx.ViewModels = {}));
var ViewModels = PortalFx.ViewModels;
})(Validators = Controls.Validators || (Controls.Validators = {}));
})(Controls = ViewModels.Controls || (ViewModels.Controls = {}));
})(ViewModels = PortalFx.ViewModels || (PortalFx.ViewModels = {}));
})(PortalFx || (PortalFx = {}));
var ViewModel = (function () {
function ViewModel() {
@@ -25,10 +25,10 @@ var A;
return B;
})();
A.B = B;
var B;
(function (B) {
B.x = 1;
})(A.B || (A.B = {}));
var B = A.B;
})(B = A.B || (A.B = {}));
})(A || (A = {}));
var b;
b.foo();
@@ -31,10 +31,10 @@ var A;
})(A || (A = {}));
var A;
(function (A) {
var B;
(function (B) {
B.x = 1;
})(A.B || (A.B = {}));
var B = A.B;
})(B = A.B || (A.B = {}));
})(A || (A = {}));
var b;
b.foo();
@@ -35,6 +35,7 @@ var __extends = this.__extends || function (d, b) {
};
var EndGate;
(function (EndGate) {
var Tweening;
(function (Tweening) {
var Tween = (function () {
function Tween(from) {
@@ -43,11 +44,11 @@ var EndGate;
return Tween;
})();
Tweening.Tween = Tween;
})(EndGate.Tweening || (EndGate.Tweening = {}));
var Tweening = EndGate.Tweening;
})(Tweening = EndGate.Tweening || (EndGate.Tweening = {}));
})(EndGate || (EndGate = {}));
var EndGate;
(function (EndGate) {
var Tweening;
(function (Tweening) {
var NumberTween = (function (_super) {
__extends(NumberTween, _super);
@@ -57,6 +58,5 @@ var EndGate;
return NumberTween;
})(Tweening.Tween);
Tweening.NumberTween = NumberTween;
})(EndGate.Tweening || (EndGate.Tweening = {}));
var Tweening = EndGate.Tweening;
})(Tweening = EndGate.Tweening || (EndGate.Tweening = {}));
})(EndGate || (EndGate = {}));
@@ -34,6 +34,7 @@ var __extends = this.__extends || function (d, b) {
};
var EndGate;
(function (EndGate) {
var Tweening;
(function (Tweening) {
var Tween = (function () {
function Tween(from) {
@@ -42,11 +43,11 @@ var EndGate;
return Tween;
})();
Tweening.Tween = Tween;
})(EndGate.Tweening || (EndGate.Tweening = {}));
var Tweening = EndGate.Tweening;
})(Tweening = EndGate.Tweening || (EndGate.Tweening = {}));
})(EndGate || (EndGate = {}));
var EndGate;
(function (EndGate) {
var Tweening;
(function (Tweening) {
var NumberTween = (function (_super) {
__extends(NumberTween, _super);
@@ -56,6 +57,5 @@ var EndGate;
return NumberTween;
})(Tweening.Tween);
Tweening.NumberTween = NumberTween;
})(EndGate.Tweening || (EndGate.Tweening = {}));
var Tweening = EndGate.Tweening;
})(Tweening = EndGate.Tweening || (EndGate.Tweening = {}));
})(EndGate || (EndGate = {}));
@@ -16,10 +16,10 @@ var A;
return x;
}
A.B = B;
var B;
(function (B) {
B.x = 1;
})(A.B || (A.B = {}));
var B = A.B;
})(B = A.B || (A.B = {}));
})(A || (A = {}));
var b;
A.B(1);
@@ -22,10 +22,10 @@ var A;
})(A || (A = {}));
var A;
(function (A) {
var B;
(function (B) {
B.x = 1;
})(A.B || (A.B = {}));
var B = A.B;
})(B = A.B || (A.B = {}));
})(A || (A = {}));
var b;
A.B(1);
@@ -31,6 +31,7 @@ var M;
return C;
})();
M.C = C;
var C;
(function (C) {
var X = (function () {
function X() {
@@ -38,8 +39,7 @@ var M;
return X;
})();
C.X = X;
})(M.C || (M.C = {}));
var C = M.C;
})(C = M.C || (M.C = {}));
var g1 = new G();
g1.bar(null).foo();
})(M || (M = {}));
@@ -34,6 +34,7 @@ var M;
return C;
})();
M.C = C;
var C;
(function (C) {
var X = (function () {
function X() {
@@ -41,8 +42,7 @@ var M;
return X;
})();
C.X = X;
})(M.C || (M.C = {}));
var C = M.C;
})(C = M.C || (M.C = {}));
var g1 = new G();
g1.bar(null).foo(); // no error
})(M || (M = {}));
@@ -10,5 +10,6 @@
!!! Type 'A<A<number>>' is not assignable to type 'A<number>':
!!! Type 'A<number>' is not assignable to type 'number'.
~~~~~~~~~~~~~~~~~
!!! Neither type 'A<A<number>>' nor type 'A<number>' is assignable to the other:
!!! Type 'A<number>' is not assignable to type 'number'.
!!! Neither type 'A<number>' nor type 'A<A<number>>' is assignable to the other:
!!! Type 'number' is not assignable to type 'A<number>':
!!! Property 'foo' is missing in type 'Number'.
@@ -22,4 +22,5 @@
var r4: A<number> = <A<number>>new A();
var r5: A<number> = <A<number>>[]; // error
~~~~~~~~~~~~~
!!! Neither type 'A<number>' nor type 'any[]' is assignable to the other.
!!! Neither type 'undefined[]' nor type 'A<number>' is assignable to the other:
!!! Property 'foo' is missing in type 'undefined[]'.
@@ -29,8 +29,8 @@
y = <T>a;
y = <T>b; // error: cannot convert B to T
~~~~
!!! Neither type 'T' nor type 'B' is assignable to the other.
!!! Neither type 'B' nor type 'T' is assignable to the other.
y = <T>c; // error: cannot convert C to T
~~~~
!!! Neither type 'T' nor type 'C' is assignable to the other.
!!! Neither type 'C' nor type 'T' is assignable to the other.
}
@@ -29,8 +29,8 @@
y = <T>a;
y = <T>b; // error: cannot convert B to T
~~~~
!!! Neither type 'T' nor type 'B' is assignable to the other.
!!! Neither type 'B' nor type 'T' is assignable to the other.
y = <T>c; // error: cannot convert C to T
~~~~
!!! Neither type 'T' nor type 'C' is assignable to the other.
!!! Neither type 'C' nor type 'T' is assignable to the other.
}
@@ -8,10 +8,10 @@
f(x: T, y: U) {
x = <T>y;
~~~~
!!! Neither type 'T' nor type 'U' is assignable to the other.
!!! Neither type 'U' nor type 'T' is assignable to the other.
y = <U>x;
~~~~
!!! Neither type 'U' nor type 'T' is assignable to the other.
!!! Neither type 'T' nor type 'U' is assignable to the other.
}
}
@@ -23,7 +23,7 @@
var d = <U>new Date();
var e = <T><U>new Date();
~~~~~~~~~~~~~~~~
!!! Neither type 'T' nor type 'U' is assignable to the other.
!!! Neither type 'U' nor type 'T' is assignable to the other.
}
}
@@ -16,10 +16,10 @@ module A {
var M;
(function (M) {
M.x = 1;
var N;
(function (N) {
N.y = 2;
})(M.N || (M.N = {}));
var N = M.N;
})(N = M.N || (M.N = {}));
})(M || (M = {}));
var A;
(function (A) {
+4 -4
View File
@@ -144,6 +144,7 @@ var m4 = require("importDecl_require"); // Emit used
exports.x4 = m4.x;
exports.d4 = m4.d;
exports.f4 = m4.foo();
var m1;
(function (m1) {
m1.x2 = m4.x;
m1.d2 = m4.d;
@@ -151,8 +152,7 @@ exports.f4 = m4.foo();
var x3 = m4.x;
var d3 = m4.d;
var f3 = m4.foo();
})(exports.m1 || (exports.m1 = {}));
var m1 = exports.m1;
})(m1 = exports.m1 || (exports.m1 = {}));
//Emit global only usage
var glo_m4 = require("importDecl_require1");
exports.useGlo_m4_d4 = glo_m4.d;
@@ -162,12 +162,12 @@ var fncOnly_m4 = require("importDecl_require2");
exports.useFncOnly_m4_f4 = fncOnly_m4.foo();
// only used privately no need to emit
var private_m4 = require("importDecl_require3");
var usePrivate_m4_m1;
(function (usePrivate_m4_m1) {
var x3 = private_m4.x;
var d3 = private_m4.d;
var f3 = private_m4.foo();
})(exports.usePrivate_m4_m1 || (exports.usePrivate_m4_m1 = {}));
var usePrivate_m4_m1 = exports.usePrivate_m4_m1;
})(usePrivate_m4_m1 = exports.usePrivate_m4_m1 || (exports.usePrivate_m4_m1 = {}));
// Do not emit unused import
var m5 = require("importDecl_require4");
exports.d = m5.foo2();
@@ -25,6 +25,7 @@ var x = new UserServices().getUserName();
define(["require", "exports"], function (require, exports) {
var App;
(function (App) {
var Services;
(function (Services) {
var UserServices = (function () {
function UserServices() {
@@ -35,8 +36,7 @@ define(["require", "exports"], function (require, exports) {
return UserServices;
})();
Services.UserServices = UserServices;
})(App.Services || (App.Services = {}));
var Services = App.Services;
})(Services = App.Services || (App.Services = {}));
})(App || (App = {}));
var Mod = App;
return Mod;
@@ -19,7 +19,9 @@ var x = new Services.UserServices().getUserName();
//// [file1.js]
define(["require", "exports"], function (require, exports) {
var App;
(function (App) {
var Services;
(function (Services) {
var UserServices = (function () {
function UserServices() {
@@ -30,10 +32,8 @@ define(["require", "exports"], function (require, exports) {
return UserServices;
})();
Services.UserServices = UserServices;
})(App.Services || (App.Services = {}));
var Services = App.Services;
})(exports.App || (exports.App = {}));
var App = exports.App;
})(Services = App.Services || (App.Services = {}));
})(App = exports.App || (exports.App = {}));
});
//// [file2.js]
define(["require", "exports", "file1"], function (require, exports, appJs) {
+6 -6
View File
@@ -26,7 +26,9 @@ c = new D.inner.Class1();
//// [innerAliases.js]
var A;
(function (A) {
var B;
(function (B) {
var C;
(function (C) {
var Class1 = (function () {
function Class1() {
@@ -34,15 +36,14 @@ var A;
return Class1;
})();
C.Class1 = Class1;
})(B.C || (B.C = {}));
var C = B.C;
})(A.B || (A.B = {}));
var B = A.B;
})(C = B.C || (B.C = {}));
})(B = A.B || (A.B = {}));
})(A || (A = {}));
var D;
(function (D) {
var inner = A.B.C;
var c1 = new inner.Class1();
var E;
(function (E) {
var Class2 = (function () {
function Class2() {
@@ -50,8 +51,7 @@ var D;
return Class2;
})();
E.Class2 = Class2;
})(D.E || (D.E = {}));
var E = D.E;
})(E = D.E || (D.E = {}));
})(D || (D = {}));
var c;
c = new D.inner.Class1();
+2 -2
View File
@@ -16,6 +16,7 @@ module A {
//// [innerExtern.js]
var A;
(function (A) {
var B;
(function (B) {
var C = (function () {
function C() {
@@ -24,6 +25,5 @@ var A;
return C;
})();
B.C = C;
})(A.B || (A.B = {}));
var B = A.B;
})(B = A.B || (A.B = {}));
})(A || (A = {}));
@@ -315,7 +315,7 @@
var obj69: i7 = new obj66;
var obj70: i7 = <i7>new Base;
~~~~~~~~~~~~
!!! Neither type 'i7' nor type 'Base' is assignable to the other.
!!! Neither type 'Base' nor type 'i7' is assignable to the other.
var obj71: i7 = null;
var obj72: i7 = function () { };
~~~~~
@@ -18,12 +18,12 @@ var x: A.B = A.B.createB();
//// [interMixingModulesInterfaces0.js]
var A;
(function (A) {
var B;
(function (B) {
function createB() {
return null;
}
B.createB = createB;
})(A.B || (A.B = {}));
var B = A.B;
})(B = A.B || (A.B = {}));
})(A || (A = {}));
var x = A.B.createB();
@@ -18,12 +18,12 @@ var x: A.B = A.B.createB();
//// [interMixingModulesInterfaces1.js]
var A;
(function (A) {
var B;
(function (B) {
function createB() {
return null;
}
B.createB = createB;
})(A.B || (A.B = {}));
var B = A.B;
})(B = A.B || (A.B = {}));
})(A || (A = {}));
var x = A.B.createB();
@@ -18,12 +18,12 @@ var x : number = A.B.createB();
//// [interMixingModulesInterfaces4.js]
var A;
(function (A) {
var B;
(function (B) {
function createB() {
return null;
}
B.createB = createB;
})(A.B || (A.B = {}));
var B = A.B;
})(B = A.B || (A.B = {}));
})(A || (A = {}));
var x = A.B.createB();
@@ -18,12 +18,12 @@ var x: number = A.B.createB();
//// [interMixingModulesInterfaces5.js]
var A;
(function (A) {
var B;
(function (B) {
function createB() {
return null;
}
B.createB = createB;
})(A.B || (A.B = {}));
var B = A.B;
})(B = A.B || (A.B = {}));
})(A || (A = {}));
var x = A.B.createB();
@@ -85,6 +85,7 @@ define(["require", "exports"], function (require, exports) {
return C5;
})();
})(M1 || (M1 = {}));
var M2;
(function (M2) {
var C1 = (function () {
function C1() {
@@ -101,8 +102,7 @@ define(["require", "exports"], function (require, exports) {
}
return C3;
})();
})(exports.M2 || (exports.M2 = {}));
var M2 = exports.M2;
})(M2 = exports.M2 || (exports.M2 = {}));
var C1 = (function () {
function C1() {
}
@@ -18,6 +18,7 @@ export module m2 {
export var d = new m2.m3.c();
//// [internalAliasClassInsideLocalModuleWithExport.js]
var x;
(function (x) {
var c = (function () {
function c() {
@@ -28,17 +29,16 @@ export var d = new m2.m3.c();
return c;
})();
x.c = c;
})(exports.x || (exports.x = {}));
var x = exports.x;
})(x = exports.x || (exports.x = {}));
var m2;
(function (m2) {
var m3;
(function (m3) {
m3.c = x.c;
m3.cProp = new m3.c();
var cReturnVal = m3.cProp.foo(10);
})(m2.m3 || (m2.m3 = {}));
var m3 = m2.m3;
})(exports.m2 || (exports.m2 = {}));
var m2 = exports.m2;
})(m3 = m2.m3 || (m2.m3 = {}));
})(m2 = exports.m2 || (exports.m2 = {}));
exports.d = new m2.m3.c();
@@ -16,6 +16,7 @@ export module m2 {
}
//// [internalAliasClassInsideLocalModuleWithoutExport.js]
var x;
(function (x) {
var c = (function () {
function c() {
@@ -26,17 +27,16 @@ export module m2 {
return c;
})();
x.c = c;
})(exports.x || (exports.x = {}));
var x = exports.x;
})(x = exports.x || (exports.x = {}));
var m2;
(function (m2) {
var m3;
(function (m3) {
var c = x.c;
m3.cProp = new c();
var cReturnVal = m3.cProp.foo(10);
})(m2.m3 || (m2.m3 = {}));
var m3 = m2.m3;
})(exports.m2 || (exports.m2 = {}));
var m2 = exports.m2;
})(m3 = m2.m3 || (m2.m3 = {}));
})(m2 = exports.m2 || (exports.m2 = {}));
//// [internalAliasClassInsideLocalModuleWithoutExport.d.ts]
@@ -18,6 +18,7 @@ export module m2 {
export var d = new m2.m3.c();
//// [internalAliasClassInsideLocalModuleWithoutExportAccessError.js]
var x;
(function (x) {
var c = (function () {
function c() {
@@ -28,15 +29,14 @@ export var d = new m2.m3.c();
return c;
})();
x.c = c;
})(exports.x || (exports.x = {}));
var x = exports.x;
})(x = exports.x || (exports.x = {}));
var m2;
(function (m2) {
var m3;
(function (m3) {
var c = x.c;
m3.cProp = new c();
var cReturnVal = m3.cProp.foo(10);
})(m2.m3 || (m2.m3 = {}));
var m3 = m2.m3;
})(exports.m2 || (exports.m2 = {}));
var m2 = exports.m2;
})(m3 = m2.m3 || (m2.m3 = {}));
})(m2 = exports.m2 || (exports.m2 = {}));
exports.d = new m2.m3.c();

Some files were not shown because too many files have changed in this diff Show More