mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Merge remote-tracking branch 'origin/master' into importGotoDef
This commit is contained in:
@@ -574,7 +574,7 @@ task("runtests", ["tests", builtLocalDirectory], function() {
|
||||
}
|
||||
|
||||
colors = process.env.colors || process.env.color
|
||||
colors = colors ? ' --no-colors ' : ''
|
||||
colors = colors ? ' --no-colors ' : ' --colors ';
|
||||
tests = tests ? ' -g ' + tests : '';
|
||||
reporter = process.env.reporter || process.env.r || 'dot';
|
||||
// timeout normally isn't necessary but Travis-CI has been timing out on compiler baselines occasionally
|
||||
|
||||
+56
-1
@@ -3899,7 +3899,9 @@ module ts {
|
||||
emitSignatureParameters(node);
|
||||
}
|
||||
|
||||
if (isSingleLineEmptyBlock(node.body) || !node.body) {
|
||||
if (!node.body) {
|
||||
// There can be no body when there are parse errors. Just emit an empty block
|
||||
// in that case.
|
||||
write(" { }");
|
||||
}
|
||||
else if (node.body.kind === SyntaxKind.Block) {
|
||||
@@ -3932,6 +3934,17 @@ module ts {
|
||||
}
|
||||
|
||||
function emitExpressionFunctionBody(node: FunctionLikeDeclaration, body: Expression) {
|
||||
if (languageVersion < ScriptTarget.ES6) {
|
||||
emitDownLevelExpressionFunctionBody(node, body);
|
||||
return;
|
||||
}
|
||||
|
||||
// For es6 and higher we can emit the expression as is.
|
||||
write(" ");
|
||||
emit(body);
|
||||
}
|
||||
|
||||
function emitDownLevelExpressionFunctionBody(node: FunctionLikeDeclaration, body: Expression) {
|
||||
write(" {");
|
||||
scopeEmitStart(node);
|
||||
|
||||
@@ -3979,15 +3992,57 @@ module ts {
|
||||
}
|
||||
|
||||
function emitBlockFunctionBody(node: FunctionLikeDeclaration, body: Block) {
|
||||
// If the body has no statements, and we know there's no code that would cause any
|
||||
// prologue to be emitted, then just do a simple emit if the empty block.
|
||||
if (body.statements.length === 0 && !anyParameterHasBindingPatternOrInitializer(node)) {
|
||||
emitFunctionBodyWithNoStatements(node, body);
|
||||
}
|
||||
else {
|
||||
emitFunctionBodyWithStatements(node, body);
|
||||
}
|
||||
}
|
||||
|
||||
function anyParameterHasBindingPatternOrInitializer(func: FunctionLikeDeclaration) {
|
||||
return forEach(func.parameters, hasBindingPatternOrInitializer);
|
||||
}
|
||||
|
||||
function hasBindingPatternOrInitializer(parameter: ParameterDeclaration) {
|
||||
return parameter.initializer || isBindingPattern(parameter.name);
|
||||
}
|
||||
|
||||
function emitFunctionBodyWithNoStatements(node: FunctionLikeDeclaration, body: Block) {
|
||||
var singleLine = isSingleLineEmptyBlock(node.body);
|
||||
|
||||
write(" {");
|
||||
if (singleLine) {
|
||||
write(" ");
|
||||
}
|
||||
else {
|
||||
increaseIndent();
|
||||
writeLine();
|
||||
}
|
||||
|
||||
emitLeadingCommentsOfPosition(body.statements.end);
|
||||
|
||||
if (!singleLine) {
|
||||
decreaseIndent();
|
||||
}
|
||||
|
||||
emitToken(SyntaxKind.CloseBraceToken, body.statements.end);
|
||||
}
|
||||
|
||||
function emitFunctionBodyWithStatements(node: FunctionLikeDeclaration, body: Block) {
|
||||
write(" {");
|
||||
scopeEmitStart(node);
|
||||
|
||||
var outPos = writer.getTextPos();
|
||||
|
||||
increaseIndent();
|
||||
emitDetachedComments(body.statements);
|
||||
var startIndex = emitDirectivePrologues(body.statements, /*startWithNewLine*/ true);
|
||||
emitFunctionBodyPreamble(node);
|
||||
decreaseIndent();
|
||||
|
||||
var preambleEmitted = writer.getTextPos() !== outPos;
|
||||
|
||||
if (!preambleEmitted && nodeEndIsOnSameLineAsNodeStart(body, body)) {
|
||||
|
||||
@@ -2366,17 +2366,14 @@ module ts {
|
||||
}
|
||||
|
||||
function parseTypeMemberSemicolon() {
|
||||
// Try to parse out an explicit or implicit (ASI) semicolon for a type member. If we
|
||||
// don't have one, then an appropriate error will be reported.
|
||||
if (parseSemicolon()) {
|
||||
// We allow type members to be separated by commas or (possibly ASI) semicolons.
|
||||
// First check if it was a comma. If so, we're done with the member.
|
||||
if (parseOptional(SyntaxKind.CommaToken)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// If we don't have a semicolon, then the user may have written a comma instead
|
||||
// accidently (pretty easy to do since commas are so prevalent as list separators). So
|
||||
// just consume the comma and keep going. Note: we'll have already reported the error
|
||||
// about the missing semicolon above.
|
||||
parseOptional(SyntaxKind.CommaToken);
|
||||
// Didn't have a comma. We must have a (possible ASI) semicolon.
|
||||
parseSemicolon();
|
||||
}
|
||||
|
||||
function parseSignatureMember(kind: SyntaxKind): SignatureDeclaration {
|
||||
|
||||
@@ -229,6 +229,7 @@ module ts.server {
|
||||
kind: entry.kind,
|
||||
kindModifiers: entry.kindModifiers,
|
||||
matchKind: entry.matchKind,
|
||||
isCaseSensitive: entry.isCaseSensitive,
|
||||
fileName: fileName,
|
||||
textSpan: ts.createTextSpanFromBounds(start, end)
|
||||
};
|
||||
|
||||
Vendored
+5
@@ -711,6 +711,11 @@ declare module ts.server.protocol {
|
||||
* exact, substring, or prefix.
|
||||
*/
|
||||
matchKind?: string;
|
||||
|
||||
/**
|
||||
* If this was a case sensitive or insensitive match.
|
||||
*/
|
||||
isCaseSensitive?: boolean;
|
||||
|
||||
/**
|
||||
* Optional modifiers for the kind (such as 'public').
|
||||
|
||||
+157
-65
@@ -1,35 +1,46 @@
|
||||
module ts.NavigateTo {
|
||||
type RawNavigateToItem = { name: string; fileName: string; matchKind: MatchKind; declaration: Declaration };
|
||||
|
||||
enum MatchKind {
|
||||
none = 0,
|
||||
exact = 1,
|
||||
substring = 2,
|
||||
prefix = 3
|
||||
}
|
||||
|
||||
export function getNavigateToItems(program: Program, cancellationToken: CancellationTokenObject, searchValue: string, maxResultCount: number): NavigateToItem[]{
|
||||
// Split search value in terms array
|
||||
var terms = searchValue.split(" ");
|
||||
|
||||
// default NavigateTo approach: if search term contains only lower-case chars - use case-insensitive search, otherwise switch to case-sensitive version
|
||||
var searchTerms = map(terms, t => ({ caseSensitive: hasAnyUpperCaseCharacter(t), term: t }));
|
||||
type RawNavigateToItem = { name: string; fileName: string; matchKind: PatternMatchKind; isCaseSensitive: boolean; declaration: Declaration };
|
||||
|
||||
export function getNavigateToItems(program: Program, cancellationToken: CancellationTokenObject, searchValue: string, maxResultCount: number): NavigateToItem[] {
|
||||
var patternMatcher = createPatternMatcher(searchValue);
|
||||
var rawItems: RawNavigateToItem[] = [];
|
||||
|
||||
// Search the declarations in all files and output matched NavigateToItem into array of NavigateToItem[]
|
||||
forEach(program.getSourceFiles(), sourceFile => {
|
||||
cancellationToken.throwIfCancellationRequested();
|
||||
|
||||
var fileName = sourceFile.fileName;
|
||||
var declarations = sourceFile.getNamedDeclarations();
|
||||
for (var i = 0, n = declarations.length; i < n; i++) {
|
||||
var declaration = declarations[i];
|
||||
// TODO(jfreeman): Skip this declaration if it has a computed name
|
||||
var name = (<Identifier>declaration.name).text;
|
||||
var matchKind = getMatchKind(searchTerms, name);
|
||||
if (matchKind !== MatchKind.none) {
|
||||
rawItems.push({ name, fileName, matchKind, declaration });
|
||||
var name = getDeclarationName(declaration);
|
||||
if (name !== undefined) {
|
||||
|
||||
// First do a quick check to see if the name of the declaration matches the
|
||||
// last portion of the (possibly) dotted name they're searching for.
|
||||
var matches = patternMatcher.getMatchesForLastSegmentOfPattern(name);
|
||||
|
||||
if (!matches) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// It was a match! If the pattern has dots in it, then also see if hte
|
||||
// declaration container matches as well.
|
||||
if (patternMatcher.patternContainsDots) {
|
||||
var containers = getContainers(declaration);
|
||||
if (!containers) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
matches = patternMatcher.getMatches(containers, name);
|
||||
|
||||
if (!matches) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
var fileName = sourceFile.fileName;
|
||||
var matchKind = bestMatchKind(matches);
|
||||
rawItems.push({ name, fileName, matchKind, isCaseSensitive: allMatchesAreCaseSensitive(matches), declaration });
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -43,6 +54,129 @@ module ts.NavigateTo {
|
||||
|
||||
return items;
|
||||
|
||||
function allMatchesAreCaseSensitive(matches: PatternMatch[]): boolean {
|
||||
Debug.assert(matches.length > 0);
|
||||
|
||||
// This is a case sensitive match, only if all the submatches were case sensitive.
|
||||
for (var i = 0, n = matches.length; i < n; i++) {
|
||||
if (!matches[i].isCaseSensitive) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function getDeclarationName(declaration: Declaration): string {
|
||||
var result = getTextOfIdentifierOrLiteral(declaration.name);
|
||||
if (result !== undefined) {
|
||||
return result;
|
||||
}
|
||||
|
||||
if (declaration.name.kind === SyntaxKind.ComputedPropertyName) {
|
||||
var expr = (<ComputedPropertyName>declaration.name).expression;
|
||||
if (expr.kind === SyntaxKind.PropertyAccessExpression) {
|
||||
return (<PropertyAccessExpression>expr).name.text;
|
||||
}
|
||||
|
||||
return getTextOfIdentifierOrLiteral(expr);
|
||||
}
|
||||
|
||||
return undefined;
|
||||
}
|
||||
|
||||
function getTextOfIdentifierOrLiteral(node: Node) {
|
||||
if (node.kind === SyntaxKind.Identifier ||
|
||||
node.kind === SyntaxKind.StringLiteral ||
|
||||
node.kind === SyntaxKind.NumericLiteral) {
|
||||
|
||||
return (<Identifier | LiteralExpression>node).text;
|
||||
}
|
||||
|
||||
return undefined;
|
||||
}
|
||||
|
||||
function tryAddSingleDeclarationName(declaration: Declaration, containers: string[]) {
|
||||
if (declaration && declaration.name) {
|
||||
var text = getTextOfIdentifierOrLiteral(declaration.name);
|
||||
if (text !== undefined) {
|
||||
containers.unshift(text);
|
||||
}
|
||||
else if (declaration.name.kind === SyntaxKind.ComputedPropertyName) {
|
||||
return tryAddComputedPropertyName((<ComputedPropertyName>declaration.name).expression, containers, /*includeLastPortion:*/ true);
|
||||
}
|
||||
else {
|
||||
// Don't know how to add this.
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Only added the names of computed properties if they're simple dotted expressions, like:
|
||||
//
|
||||
// [X.Y.Z]() { }
|
||||
function tryAddComputedPropertyName(expression: Expression, containers: string[], includeLastPortion: boolean): boolean {
|
||||
var text = getTextOfIdentifierOrLiteral(expression);
|
||||
if (text !== undefined) {
|
||||
if (includeLastPortion) {
|
||||
containers.unshift(text);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
if (expression.kind === SyntaxKind.PropertyAccessExpression) {
|
||||
var propertyAccess = <PropertyAccessExpression>expression;
|
||||
if (includeLastPortion) {
|
||||
containers.unshift(propertyAccess.name.text);
|
||||
}
|
||||
|
||||
return tryAddComputedPropertyName(propertyAccess.expression, containers, /*includeLastPortion:*/ true);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function getContainers(declaration: Declaration) {
|
||||
var containers: string[] = [];
|
||||
|
||||
// First, if we started with a computed property name, then add all but the last
|
||||
// portion into the container array.
|
||||
if (declaration.name.kind === SyntaxKind.ComputedPropertyName) {
|
||||
if (!tryAddComputedPropertyName((<ComputedPropertyName>declaration.name).expression, containers, /*includeLastPortion:*/ false)) {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
// Now, walk up our containers, adding all their names to the container array.
|
||||
declaration = getContainerNode(declaration);
|
||||
|
||||
while (declaration) {
|
||||
if (!tryAddSingleDeclarationName(declaration, containers)) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
declaration = getContainerNode(declaration);
|
||||
}
|
||||
|
||||
return containers;
|
||||
}
|
||||
|
||||
function bestMatchKind(matches: PatternMatch[]) {
|
||||
Debug.assert(matches.length > 0);
|
||||
var bestMatchKind = PatternMatchKind.camelCase;
|
||||
|
||||
for (var i = 0, n = matches.length; i < n; i++) {
|
||||
var kind = matches[i].kind;
|
||||
if (kind < bestMatchKind) {
|
||||
bestMatchKind = kind;
|
||||
}
|
||||
}
|
||||
|
||||
return bestMatchKind;
|
||||
}
|
||||
|
||||
// This means "compare in a case insensitive manner."
|
||||
var baseSensitivity: Intl.CollatorOptions = { sensitivity: "base" };
|
||||
function compareNavigateToItems(i1: RawNavigateToItem, i2: RawNavigateToItem) {
|
||||
@@ -62,7 +196,8 @@ module ts.NavigateTo {
|
||||
name: rawItem.name,
|
||||
kind: getNodeKind(declaration),
|
||||
kindModifiers: getNodeModifiers(declaration),
|
||||
matchKind: MatchKind[rawItem.matchKind],
|
||||
matchKind: PatternMatchKind[rawItem.matchKind],
|
||||
isCaseSensitive: rawItem.isCaseSensitive,
|
||||
fileName: rawItem.fileName,
|
||||
textSpan: createTextSpanFromBounds(declaration.getStart(), declaration.getEnd()),
|
||||
// TODO(jfreeman): What should be the containerName when the container has a computed name?
|
||||
@@ -70,48 +205,5 @@ module ts.NavigateTo {
|
||||
containerKind: container && container.name ? getNodeKind(container) : ""
|
||||
};
|
||||
}
|
||||
|
||||
function hasAnyUpperCaseCharacter(s: string): boolean {
|
||||
for (var i = 0, n = s.length; i < n; i++) {
|
||||
var c = s.charCodeAt(i);
|
||||
if ((CharacterCodes.A <= c && c <= CharacterCodes.Z) ||
|
||||
(c >= CharacterCodes.maxAsciiCharacter && s.charAt(i).toLocaleLowerCase() !== s.charAt(i))) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function getMatchKind(searchTerms: { caseSensitive: boolean; term: string }[], name: string): MatchKind {
|
||||
var matchKind = MatchKind.none;
|
||||
|
||||
if (name) {
|
||||
for (var j = 0, n = searchTerms.length; j < n; j++) {
|
||||
var searchTerm = searchTerms[j];
|
||||
var nameToSearch = searchTerm.caseSensitive ? name : name.toLocaleLowerCase();
|
||||
// in case of case-insensitive search searchTerm.term will already be lower-cased
|
||||
var index = nameToSearch.indexOf(searchTerm.term);
|
||||
if (index < 0) {
|
||||
// Didn't match.
|
||||
return MatchKind.none;
|
||||
}
|
||||
|
||||
var termKind = MatchKind.substring;
|
||||
if (index === 0) {
|
||||
// here we know that match occur at the beginning of the string.
|
||||
// if search term and declName has the same length - we have an exact match, otherwise declName have longer length and this will be prefix match
|
||||
termKind = name.length === searchTerm.term.length ? MatchKind.exact : MatchKind.prefix;
|
||||
}
|
||||
|
||||
// Update our match kind if we don't have one, or if this match is better.
|
||||
if (matchKind === MatchKind.none || termKind < matchKind) {
|
||||
matchKind = termKind;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return matchKind;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
module ts {
|
||||
// Note(cyrusn): this enum is ordered from strongest match type to weakest match type.
|
||||
export enum PatternMatchKind {
|
||||
Exact,
|
||||
Prefix,
|
||||
Substring,
|
||||
CamelCase
|
||||
exact,
|
||||
prefix,
|
||||
substring,
|
||||
camelCase
|
||||
}
|
||||
|
||||
// Information about a match made by the pattern matcher between a candidate and the
|
||||
@@ -46,7 +46,7 @@ module ts {
|
||||
// Fully checks a candidate, with an dotted container, against the search pattern.
|
||||
// The candidate must match the last part of the search pattern, and the dotted container
|
||||
// must match the preceding segments of the pattern.
|
||||
getMatches(candidate: string, dottedContainer: string): PatternMatch[];
|
||||
getMatches(candidateContainers: string[], candidate: string): PatternMatch[];
|
||||
|
||||
// Whether or not the pattern contained dots or not. Clients can use this to determine
|
||||
// If they should call getMatches, or if getMatchesForLastSegmentOfPattern is sufficient.
|
||||
@@ -139,7 +139,7 @@ module ts {
|
||||
return matchSegment(candidate, lastOrUndefined(dotSeparatedSegments));
|
||||
}
|
||||
|
||||
function getMatches(candidate: string, dottedContainer: string): PatternMatch[] {
|
||||
function getMatches(candidateContainers: string[], candidate: string): PatternMatch[] {
|
||||
if (skipMatch(candidate)) {
|
||||
return undefined;
|
||||
}
|
||||
@@ -152,27 +152,26 @@ module ts {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
dottedContainer = dottedContainer || "";
|
||||
var containerParts = dottedContainer.split(".");
|
||||
candidateContainers = candidateContainers || [];
|
||||
|
||||
// -1 because the last part was checked against the name, and only the rest
|
||||
// of the parts are checked against the container.
|
||||
if (dotSeparatedSegments.length - 1 > containerParts.length) {
|
||||
if (dotSeparatedSegments.length - 1 > candidateContainers.length) {
|
||||
// There weren't enough container parts to match against the pattern parts.
|
||||
// So this definitely doesn't match.
|
||||
return null;
|
||||
return undefined;
|
||||
}
|
||||
|
||||
// So far so good. Now break up the container for the candidate and check if all
|
||||
// the dotted parts match up correctly.
|
||||
var totalMatch = candidateMatch;
|
||||
|
||||
for (var i = dotSeparatedSegments.length - 2, j = containerParts.length - 1;
|
||||
for (var i = dotSeparatedSegments.length - 2, j = candidateContainers.length - 1;
|
||||
i >= 0;
|
||||
i--, j--) {
|
||||
|
||||
var segment = dotSeparatedSegments[i];
|
||||
var containerName = containerParts[j];
|
||||
var containerName = candidateContainers[j];
|
||||
|
||||
var containerMatch = matchSegment(containerName, segment);
|
||||
if (!containerMatch) {
|
||||
@@ -202,12 +201,12 @@ module ts {
|
||||
if (chunk.text.length === candidate.length) {
|
||||
// a) Check if the part matches the candidate entirely, in an case insensitive or
|
||||
// sensitive manner. If it does, return that there was an exact match.
|
||||
return createPatternMatch(PatternMatchKind.Exact, punctuationStripped, /*isCaseSensitive:*/ candidate === chunk.text);
|
||||
return createPatternMatch(PatternMatchKind.exact, punctuationStripped, /*isCaseSensitive:*/ candidate === chunk.text);
|
||||
}
|
||||
else {
|
||||
// b) Check if the part is a prefix of the candidate, in a case insensitive or sensitive
|
||||
// manner. If it does, return that there was a prefix match.
|
||||
return createPatternMatch(PatternMatchKind.Prefix, punctuationStripped, /*isCaseSensitive:*/ startsWith(candidate, chunk.text));
|
||||
return createPatternMatch(PatternMatchKind.prefix, punctuationStripped, /*isCaseSensitive:*/ startsWith(candidate, chunk.text));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -225,7 +224,7 @@ module ts {
|
||||
for (var i = 0, n = wordSpans.length; i < n; i++) {
|
||||
var span = wordSpans[i]
|
||||
if (partStartsWith(candidate, span, chunk.text, /*ignoreCase:*/ true)) {
|
||||
return createPatternMatch(PatternMatchKind.Substring, punctuationStripped,
|
||||
return createPatternMatch(PatternMatchKind.substring, punctuationStripped,
|
||||
/*isCaseSensitive:*/ partStartsWith(candidate, span, chunk.text, /*ignoreCase:*/ false));
|
||||
}
|
||||
}
|
||||
@@ -236,7 +235,7 @@ module ts {
|
||||
// candidate in a case *sensitive* manner. If so, return that there was a substring
|
||||
// match.
|
||||
if (candidate.indexOf(chunk.text) > 0) {
|
||||
return createPatternMatch(PatternMatchKind.Substring, punctuationStripped, /*isCaseSensitive:*/ true);
|
||||
return createPatternMatch(PatternMatchKind.substring, punctuationStripped, /*isCaseSensitive:*/ true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -246,12 +245,12 @@ module ts {
|
||||
var candidateParts = getWordSpans(candidate);
|
||||
var camelCaseWeight = tryCamelCaseMatch(candidate, candidateParts, chunk, /*ignoreCase:*/ false);
|
||||
if (camelCaseWeight !== undefined) {
|
||||
return createPatternMatch(PatternMatchKind.CamelCase, punctuationStripped, /*isCaseSensitive:*/ true, /*camelCaseWeight:*/ camelCaseWeight);
|
||||
return createPatternMatch(PatternMatchKind.camelCase, punctuationStripped, /*isCaseSensitive:*/ true, /*camelCaseWeight:*/ camelCaseWeight);
|
||||
}
|
||||
|
||||
camelCaseWeight = tryCamelCaseMatch(candidate, candidateParts, chunk, /*ignoreCase:*/ true);
|
||||
if (camelCaseWeight !== undefined) {
|
||||
return createPatternMatch(PatternMatchKind.CamelCase, punctuationStripped, /*isCaseSensitive:*/ false, /*camelCaseWeight:*/ camelCaseWeight);
|
||||
return createPatternMatch(PatternMatchKind.camelCase, punctuationStripped, /*isCaseSensitive:*/ false, /*camelCaseWeight:*/ camelCaseWeight);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -266,7 +265,7 @@ module ts {
|
||||
// (Pattern: fogbar, Candidate: quuxfogbarFogBar).
|
||||
if (chunk.text.length < candidate.length) {
|
||||
if (index > 0 && isUpperCaseLetter(candidate.charCodeAt(index))) {
|
||||
return createPatternMatch(PatternMatchKind.Substring, punctuationStripped, /*isCaseSensitive:*/ false);
|
||||
return createPatternMatch(PatternMatchKind.substring, punctuationStripped, /*isCaseSensitive:*/ false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -508,7 +507,7 @@ module ts {
|
||||
}
|
||||
|
||||
function compareCamelCase(result1: PatternMatch, result2: PatternMatch) {
|
||||
if (result1.kind === PatternMatchKind.CamelCase && result2.kind === PatternMatchKind.CamelCase) {
|
||||
if (result1.kind === PatternMatchKind.camelCase && result2.kind === PatternMatchKind.camelCase) {
|
||||
// Swap the values here. If result1 has a higher weight, then we want it to come
|
||||
// first.
|
||||
return result2.camelCaseWeight - result1.camelCaseWeight;
|
||||
|
||||
@@ -970,6 +970,7 @@ module ts {
|
||||
kind: string;
|
||||
kindModifiers: string;
|
||||
matchKind: string;
|
||||
isCaseSensitive: boolean;
|
||||
fileName: string;
|
||||
textSpan: TextSpan;
|
||||
containerName: string;
|
||||
@@ -1957,7 +1958,7 @@ module ts {
|
||||
});
|
||||
}
|
||||
|
||||
/* @internal */ export function getContainerNode(node: Node): Node {
|
||||
/* @internal */ export function getContainerNode(node: Node): Declaration {
|
||||
while (true) {
|
||||
node = node.parent;
|
||||
if (!node) {
|
||||
@@ -1975,7 +1976,7 @@ module ts {
|
||||
case SyntaxKind.InterfaceDeclaration:
|
||||
case SyntaxKind.EnumDeclaration:
|
||||
case SyntaxKind.ModuleDeclaration:
|
||||
return node;
|
||||
return <Declaration>node;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1639,6 +1639,7 @@ declare module "typescript" {
|
||||
kind: string;
|
||||
kindModifiers: string;
|
||||
matchKind: string;
|
||||
isCaseSensitive: boolean;
|
||||
fileName: string;
|
||||
textSpan: TextSpan;
|
||||
containerName: string;
|
||||
|
||||
@@ -5314,6 +5314,9 @@ declare module "typescript" {
|
||||
matchKind: string;
|
||||
>matchKind : string
|
||||
|
||||
isCaseSensitive: boolean;
|
||||
>isCaseSensitive : boolean
|
||||
|
||||
fileName: string;
|
||||
>fileName : string
|
||||
|
||||
|
||||
@@ -1670,6 +1670,7 @@ declare module "typescript" {
|
||||
kind: string;
|
||||
kindModifiers: string;
|
||||
matchKind: string;
|
||||
isCaseSensitive: boolean;
|
||||
fileName: string;
|
||||
textSpan: TextSpan;
|
||||
containerName: string;
|
||||
|
||||
@@ -5460,6 +5460,9 @@ declare module "typescript" {
|
||||
matchKind: string;
|
||||
>matchKind : string
|
||||
|
||||
isCaseSensitive: boolean;
|
||||
>isCaseSensitive : boolean
|
||||
|
||||
fileName: string;
|
||||
>fileName : string
|
||||
|
||||
|
||||
@@ -1671,6 +1671,7 @@ declare module "typescript" {
|
||||
kind: string;
|
||||
kindModifiers: string;
|
||||
matchKind: string;
|
||||
isCaseSensitive: boolean;
|
||||
fileName: string;
|
||||
textSpan: TextSpan;
|
||||
containerName: string;
|
||||
|
||||
@@ -5410,6 +5410,9 @@ declare module "typescript" {
|
||||
matchKind: string;
|
||||
>matchKind : string
|
||||
|
||||
isCaseSensitive: boolean;
|
||||
>isCaseSensitive : boolean
|
||||
|
||||
fileName: string;
|
||||
>fileName : string
|
||||
|
||||
|
||||
@@ -1708,6 +1708,7 @@ declare module "typescript" {
|
||||
kind: string;
|
||||
kindModifiers: string;
|
||||
matchKind: string;
|
||||
isCaseSensitive: boolean;
|
||||
fileName: string;
|
||||
textSpan: TextSpan;
|
||||
containerName: string;
|
||||
|
||||
@@ -5583,6 +5583,9 @@ declare module "typescript" {
|
||||
matchKind: string;
|
||||
>matchKind : string
|
||||
|
||||
isCaseSensitive: boolean;
|
||||
>isCaseSensitive : boolean
|
||||
|
||||
fileName: string;
|
||||
>fileName : string
|
||||
|
||||
|
||||
-23
@@ -1,23 +0,0 @@
|
||||
tests/cases/conformance/internalModules/exportDeclarations/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts(8,27): error TS1005: ';' expected.
|
||||
tests/cases/conformance/internalModules/exportDeclarations/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts(8,43): error TS1005: ';' expected.
|
||||
tests/cases/conformance/internalModules/exportDeclarations/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts(9,30): error TS1005: ';' expected.
|
||||
|
||||
|
||||
==== tests/cases/conformance/internalModules/exportDeclarations/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts (3 errors) ====
|
||||
module A {
|
||||
|
||||
class Point {
|
||||
constructor(public x: number, public y: number) { }
|
||||
}
|
||||
|
||||
export var UnitSquare : {
|
||||
top: { left: Point, right: Point },
|
||||
~
|
||||
!!! error TS1005: ';' expected.
|
||||
~
|
||||
!!! error TS1005: ';' expected.
|
||||
bottom: { left: Point, right: Point }
|
||||
~
|
||||
!!! error TS1005: ';' expected.
|
||||
} = null;
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
=== tests/cases/conformance/internalModules/exportDeclarations/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts ===
|
||||
module A {
|
||||
>A : typeof A
|
||||
|
||||
class Point {
|
||||
>Point : Point
|
||||
|
||||
constructor(public x: number, public y: number) { }
|
||||
>x : number
|
||||
>y : number
|
||||
}
|
||||
|
||||
export var UnitSquare : {
|
||||
>UnitSquare : { top: { left: Point; right: Point; }; bottom: { left: Point; right: Point; }; }
|
||||
|
||||
top: { left: Point, right: Point },
|
||||
>top : { left: Point; right: Point; }
|
||||
>left : Point
|
||||
>Point : Point
|
||||
>right : Point
|
||||
>Point : Point
|
||||
|
||||
bottom: { left: Point, right: Point }
|
||||
>bottom : { left: Point; right: Point; }
|
||||
>left : Point
|
||||
>Point : Point
|
||||
>right : Point
|
||||
>Point : Point
|
||||
|
||||
} = null;
|
||||
}
|
||||
@@ -10,12 +10,16 @@ var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
Object.defineProperty(C.prototype, "X", {
|
||||
set: function (v) { },
|
||||
set: function (v) {
|
||||
if (v === void 0) { v = 0; }
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(C, "X", {
|
||||
set: function (v2) { },
|
||||
set: function (v2) {
|
||||
if (v2 === void 0) { v2 = 0; }
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
@@ -57,9 +57,15 @@ b.b(1);
|
||||
|
||||
//// [callSignatureWithOptionalParameterAndInitializer.js]
|
||||
// Optional parameters cannot also have initializer expressions, these are all errors
|
||||
function foo(x) { }
|
||||
var f = function foo(x) { };
|
||||
var f2 = function (x, y) { };
|
||||
function foo(x) {
|
||||
if (x === void 0) { x = 1; }
|
||||
}
|
||||
var f = function foo(x) {
|
||||
if (x === void 0) { x = 1; }
|
||||
};
|
||||
var f2 = function (x, y) {
|
||||
if (y === void 0) { y = 1; }
|
||||
};
|
||||
foo(1);
|
||||
foo();
|
||||
f(1);
|
||||
@@ -69,7 +75,9 @@ f2(1, 2);
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
C.prototype.foo = function (x) { };
|
||||
C.prototype.foo = function (x) {
|
||||
if (x === void 0) { x = 1; }
|
||||
};
|
||||
return C;
|
||||
})();
|
||||
var c;
|
||||
@@ -86,9 +94,15 @@ a(1);
|
||||
a.foo();
|
||||
a.foo(1);
|
||||
var b = {
|
||||
foo: function (x) { },
|
||||
a: function foo(x, y) { },
|
||||
b: function (x) { }
|
||||
foo: function (x) {
|
||||
if (x === void 0) { x = 1; }
|
||||
},
|
||||
a: function foo(x, y) {
|
||||
if (y === void 0) { y = ''; }
|
||||
},
|
||||
b: function (x) {
|
||||
if (x === void 0) { x = ''; }
|
||||
}
|
||||
};
|
||||
b.foo();
|
||||
b.foo(1);
|
||||
|
||||
@@ -59,9 +59,15 @@ b.b(1);
|
||||
|
||||
//// [callSignaturesWithParameterInitializers.js]
|
||||
// Optional parameters allow initializers only in implementation signatures
|
||||
function foo(x) { }
|
||||
var f = function foo(x) { };
|
||||
var f2 = function (x, y) { };
|
||||
function foo(x) {
|
||||
if (x === void 0) { x = 1; }
|
||||
}
|
||||
var f = function foo(x) {
|
||||
if (x === void 0) { x = 1; }
|
||||
};
|
||||
var f2 = function (x, y) {
|
||||
if (y === void 0) { y = 1; }
|
||||
};
|
||||
foo(1);
|
||||
foo();
|
||||
f(1);
|
||||
@@ -71,7 +77,9 @@ f2(1, 2);
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
C.prototype.foo = function (x) { };
|
||||
C.prototype.foo = function (x) {
|
||||
if (x === void 0) { x = 1; }
|
||||
};
|
||||
return C;
|
||||
})();
|
||||
var c;
|
||||
@@ -89,9 +97,15 @@ a(1);
|
||||
a.foo();
|
||||
a.foo(1);
|
||||
var b = {
|
||||
foo: function (x) { },
|
||||
a: function foo(x, y) { },
|
||||
b: function (x) { }
|
||||
foo: function (x) {
|
||||
if (x === void 0) { x = 1; }
|
||||
},
|
||||
a: function foo(x, y) {
|
||||
if (y === void 0) { y = 1; }
|
||||
},
|
||||
b: function (x) {
|
||||
if (x === void 0) { x = 1; }
|
||||
}
|
||||
};
|
||||
b.foo();
|
||||
b.foo(1);
|
||||
|
||||
@@ -28,21 +28,29 @@ b.foo(1);
|
||||
//// [callSignaturesWithParameterInitializers2.js]
|
||||
// Optional parameters allow initializers only in implementation signatures
|
||||
// All the below declarations are errors
|
||||
function foo(x) { }
|
||||
function foo(x) {
|
||||
if (x === void 0) { x = 1; }
|
||||
}
|
||||
foo(1);
|
||||
foo();
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
C.prototype.foo = function (x) { };
|
||||
C.prototype.foo = function (x) {
|
||||
if (x === void 0) { x = 1; }
|
||||
};
|
||||
return C;
|
||||
})();
|
||||
var c;
|
||||
c.foo();
|
||||
c.foo(1);
|
||||
var b = {
|
||||
foo: function (x) { },
|
||||
foo: function (x) { }
|
||||
foo: function (x) {
|
||||
if (x === void 0) { x = 1; }
|
||||
},
|
||||
foo: function (x) {
|
||||
if (x === void 0) { x = 1; }
|
||||
}
|
||||
};
|
||||
b.foo();
|
||||
b.foo(1);
|
||||
|
||||
@@ -61,10 +61,6 @@ var __extends = this.__extends || function (d, b) {
|
||||
d.prototype = new __();
|
||||
};
|
||||
function foo(x, y) {
|
||||
var z = [];
|
||||
for (var _i = 2; _i < arguments.length; _i++) {
|
||||
z[_i - 2] = arguments[_i];
|
||||
}
|
||||
}
|
||||
var a;
|
||||
var z;
|
||||
@@ -93,10 +89,6 @@ var C = (function () {
|
||||
this.foo.apply(this, [x, y].concat(z));
|
||||
}
|
||||
C.prototype.foo = function (x, y) {
|
||||
var z = [];
|
||||
for (var _i = 2; _i < arguments.length; _i++) {
|
||||
z[_i - 2] = arguments[_i];
|
||||
}
|
||||
};
|
||||
return C;
|
||||
})();
|
||||
|
||||
@@ -23,7 +23,9 @@ module M {
|
||||
var M;
|
||||
(function (_M) {
|
||||
_M.x = 3;
|
||||
function fn(M, p) { }
|
||||
function fn(M, p) {
|
||||
if (p === void 0) { p = _M.x; }
|
||||
}
|
||||
})(M || (M = {}));
|
||||
var M;
|
||||
(function (_M_1) {
|
||||
|
||||
@@ -39,7 +39,9 @@ var M;
|
||||
var c = (function () {
|
||||
function c() {
|
||||
}
|
||||
c.prototype.fn = function (M, p) { };
|
||||
c.prototype.fn = function (M, p) {
|
||||
if (p === void 0) { p = _M.x; }
|
||||
};
|
||||
return c;
|
||||
})();
|
||||
})(M || (M = {}));
|
||||
|
||||
@@ -56,10 +56,6 @@ function f3NoError() {
|
||||
var _i = 10; // no error
|
||||
}
|
||||
function f4(_i) {
|
||||
var rest = [];
|
||||
for (var _a = 1; _a < arguments.length; _a++) {
|
||||
rest[_a - 1] = arguments[_a];
|
||||
}
|
||||
}
|
||||
function f4NoError(_i) {
|
||||
}
|
||||
|
||||
@@ -47,10 +47,6 @@ function foo() {
|
||||
var _i = 10; // no error
|
||||
}
|
||||
function f4(_i) {
|
||||
var rest = [];
|
||||
for (var _a = 1; _a < arguments.length; _a++) {
|
||||
rest[_a - 1] = arguments[_a];
|
||||
}
|
||||
}
|
||||
function f4NoError(_i) {
|
||||
}
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
tests/cases/compiler/complicatedPrivacy.ts(24,38): error TS1005: ';' expected.
|
||||
tests/cases/compiler/complicatedPrivacy.ts(11,24): error TS1054: A 'get' accessor cannot have parameters.
|
||||
tests/cases/compiler/complicatedPrivacy.ts(35,5): error TS1170: A computed property name in a type literal must directly refer to a built-in symbol.
|
||||
tests/cases/compiler/complicatedPrivacy.ts(35,6): error TS2304: Cannot find name 'number'.
|
||||
tests/cases/compiler/complicatedPrivacy.ts(73,49): error TS2305: Module 'mglo5' has no exported member 'i6'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/complicatedPrivacy.ts (3 errors) ====
|
||||
==== tests/cases/compiler/complicatedPrivacy.ts (4 errors) ====
|
||||
module m1 {
|
||||
export module m2 {
|
||||
|
||||
@@ -15,6 +16,8 @@ tests/cases/compiler/complicatedPrivacy.ts(73,49): error TS2305: Module 'mglo5'
|
||||
|
||||
export class C2 implements m3.i3 {
|
||||
public get p1(arg) {
|
||||
~~
|
||||
!!! error TS1054: A 'get' accessor cannot have parameters.
|
||||
return new C1();
|
||||
}
|
||||
|
||||
@@ -28,8 +31,6 @@ tests/cases/compiler/complicatedPrivacy.ts(73,49): error TS2305: Module 'mglo5'
|
||||
}
|
||||
|
||||
export function f2(arg1: { x?: C1, y: number }) {
|
||||
~
|
||||
!!! error TS1005: ';' expected.
|
||||
}
|
||||
|
||||
export function f3(): {
|
||||
@@ -41,6 +42,8 @@ tests/cases/compiler/complicatedPrivacy.ts(73,49): error TS2305: Module 'mglo5'
|
||||
export function f4(arg1:
|
||||
{
|
||||
[number]: C1; // Used to be indexer, now it is a computed property
|
||||
~~~~~~~~
|
||||
!!! error TS1170: A computed property name in a type literal must directly refer to a built-in symbol.
|
||||
~~~~~~
|
||||
!!! error TS2304: Cannot find name 'number'.
|
||||
}) {
|
||||
|
||||
@@ -12,5 +12,5 @@ var o: I = {
|
||||
//// [computedPropertyNamesContextualType1_ES6.js]
|
||||
var o = {
|
||||
["" + 0](y) { return y.length; },
|
||||
["" + 1]: y => { return y.length; }
|
||||
["" + 1]: y => y.length
|
||||
};
|
||||
|
||||
@@ -12,5 +12,5 @@ var o: I = {
|
||||
//// [computedPropertyNamesContextualType2_ES6.js]
|
||||
var o = {
|
||||
[+"foo"](y) { return y.length; },
|
||||
[+"bar"]: y => { return y.length; }
|
||||
[+"bar"]: y => y.length
|
||||
};
|
||||
|
||||
@@ -11,5 +11,5 @@ var o: I = {
|
||||
//// [computedPropertyNamesContextualType3_ES6.js]
|
||||
var o = {
|
||||
[+"foo"](y) { return y.length; },
|
||||
[+"bar"]: y => { return y.length; }
|
||||
[+"bar"]: y => y.length
|
||||
};
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -2197,18 +2197,21 @@ sourceFile:contextualTyping.ts
|
||||
2 > ^^^^
|
||||
3 > ^
|
||||
4 > ^
|
||||
5 > ^^^^^
|
||||
5 > ^^^^
|
||||
6 > ^
|
||||
1 >
|
||||
>function
|
||||
2 > c9t5
|
||||
3 > (
|
||||
4 > f: (n: number) => IFoo
|
||||
5 > ) {}
|
||||
5 > ) {
|
||||
6 > }
|
||||
1 >Emitted(87, 10) Source(146, 10) + SourceIndex(0)
|
||||
2 >Emitted(87, 14) Source(146, 14) + SourceIndex(0)
|
||||
3 >Emitted(87, 15) Source(146, 15) + SourceIndex(0)
|
||||
4 >Emitted(87, 16) Source(146, 37) + SourceIndex(0)
|
||||
5 >Emitted(87, 21) Source(146, 41) + SourceIndex(0)
|
||||
5 >Emitted(87, 20) Source(146, 40) + SourceIndex(0)
|
||||
6 >Emitted(87, 21) Source(146, 41) + SourceIndex(0)
|
||||
---
|
||||
>>>;
|
||||
1 >
|
||||
|
||||
@@ -49,16 +49,24 @@ s = f2('');
|
||||
s = f2();
|
||||
n = f2();
|
||||
// Contextually type the default arg with the type annotation
|
||||
var f3 = function (a) { };
|
||||
var f3 = function (a) {
|
||||
if (a === void 0) { a = function (s) { return s; }; }
|
||||
};
|
||||
// Type check using the function's contextual type
|
||||
var f4 = function (a) { };
|
||||
var f4 = function (a) {
|
||||
if (a === void 0) { a = ""; }
|
||||
};
|
||||
// Contextually type the default arg using the function's contextual type
|
||||
var f5 = function (a) { };
|
||||
var f5 = function (a) {
|
||||
if (a === void 0) { a = function (s) { return s; }; }
|
||||
};
|
||||
var U;
|
||||
(function (U) {
|
||||
U.x;
|
||||
})(U || (U = {}));
|
||||
var f6 = function (t) { };
|
||||
var f6 = function (t) {
|
||||
if (t === void 0) { t = T; }
|
||||
};
|
||||
var f7 = function (t) {
|
||||
if (t === void 0) { t = U; }
|
||||
return t;
|
||||
|
||||
@@ -20,12 +20,18 @@ interface I {
|
||||
var f: (a = 3) => number;
|
||||
|
||||
//// [defaultArgsInOverloads.js]
|
||||
function fun(a) { }
|
||||
function fun(a) {
|
||||
if (a === void 0) { a = null; }
|
||||
}
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
C.prototype.fun = function (a) { };
|
||||
C.fun = function (a) { };
|
||||
C.prototype.fun = function (a) {
|
||||
if (a === void 0) { a = null; }
|
||||
};
|
||||
C.fun = function (a) {
|
||||
if (a === void 0) { a = null; }
|
||||
};
|
||||
return C;
|
||||
})();
|
||||
var f;
|
||||
|
||||
@@ -3,4 +3,6 @@ function foo(x: string = '');
|
||||
function foo(x = '') { }
|
||||
|
||||
//// [defaultValueInFunctionOverload1.js]
|
||||
function foo(x) { }
|
||||
function foo(x) {
|
||||
if (x === void 0) { x = ''; }
|
||||
}
|
||||
|
||||
@@ -11,7 +11,9 @@ foo(() => { return false; });
|
||||
var f1 = function () { };
|
||||
var f2 = function (x, y) { };
|
||||
var f3 = function (x, y) { };
|
||||
var f4 = function (x, y, z) { };
|
||||
var f4 = function (x, y, z) {
|
||||
if (z === void 0) { z = 10; }
|
||||
};
|
||||
function foo(func) { }
|
||||
foo(function () { return true; });
|
||||
foo(function () { return false; });
|
||||
|
||||
@@ -14,5 +14,5 @@ var f2 = (x, y) => { };
|
||||
var f3 = (x, y, ...rest) => { };
|
||||
var f4 = (x, y, z = 10) => { };
|
||||
function foo(func) { }
|
||||
foo(() => { return true; });
|
||||
foo(() => true);
|
||||
foo(() => { return false; });
|
||||
|
||||
@@ -5,7 +5,23 @@ function bar(y = 10) { }
|
||||
function bar1(y = 10, ...rest) { }
|
||||
|
||||
//// [emitDefaultParametersFunction.js]
|
||||
function foo(x, y) { }
|
||||
function baz(x, y) { }
|
||||
function bar(y) { }
|
||||
function bar1(y) { }
|
||||
function foo(x, y) {
|
||||
if (y === void 0) { y = 10; }
|
||||
}
|
||||
function baz(x, y) {
|
||||
if (y === void 0) { y = 5; }
|
||||
var rest = [];
|
||||
for (var _i = 2; _i < arguments.length; _i++) {
|
||||
rest[_i - 2] = arguments[_i];
|
||||
}
|
||||
}
|
||||
function bar(y) {
|
||||
if (y === void 0) { y = 10; }
|
||||
}
|
||||
function bar1(y) {
|
||||
if (y === void 0) { y = 10; }
|
||||
var rest = [];
|
||||
for (var _i = 1; _i < arguments.length; _i++) {
|
||||
rest[_i - 1] = arguments[_i];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,10 +10,45 @@ var z = (function (num: number, boo = false, ...rest) { })(10)
|
||||
|
||||
|
||||
//// [emitDefaultParametersFunctionExpression.js]
|
||||
var lambda1 = function (y) { };
|
||||
var lambda2 = function (x, y) { };
|
||||
var lambda3 = function (x, y) { };
|
||||
var lambda4 = function (y) { };
|
||||
var x = function (str) { };
|
||||
var y = (function (num, boo) { })();
|
||||
var z = (function (num, boo) { })(10);
|
||||
var lambda1 = function (y) {
|
||||
if (y === void 0) { y = "hello"; }
|
||||
};
|
||||
var lambda2 = function (x, y) {
|
||||
if (y === void 0) { y = "hello"; }
|
||||
};
|
||||
var lambda3 = function (x, y) {
|
||||
if (y === void 0) { y = "hello"; }
|
||||
var rest = [];
|
||||
for (var _i = 2; _i < arguments.length; _i++) {
|
||||
rest[_i - 2] = arguments[_i];
|
||||
}
|
||||
};
|
||||
var lambda4 = function (y) {
|
||||
if (y === void 0) { y = "hello"; }
|
||||
var rest = [];
|
||||
for (var _i = 1; _i < arguments.length; _i++) {
|
||||
rest[_i - 1] = arguments[_i];
|
||||
}
|
||||
};
|
||||
var x = function (str) {
|
||||
if (str === void 0) { str = "hello"; }
|
||||
var rest = [];
|
||||
for (var _i = 1; _i < arguments.length; _i++) {
|
||||
rest[_i - 1] = arguments[_i];
|
||||
}
|
||||
};
|
||||
var y = (function (num, boo) {
|
||||
if (num === void 0) { num = 10; }
|
||||
if (boo === void 0) { boo = false; }
|
||||
var rest = [];
|
||||
for (var _i = 2; _i < arguments.length; _i++) {
|
||||
rest[_i - 2] = arguments[_i];
|
||||
}
|
||||
})();
|
||||
var z = (function (num, boo) {
|
||||
if (boo === void 0) { boo = false; }
|
||||
var rest = [];
|
||||
for (var _i = 2; _i < arguments.length; _i++) {
|
||||
rest[_i - 2] = arguments[_i];
|
||||
}
|
||||
})(10);
|
||||
|
||||
@@ -9,8 +9,24 @@ var obj2 = {
|
||||
|
||||
//// [emitDefaultParametersFunctionProperty.js]
|
||||
var obj2 = {
|
||||
func1: function (y) { },
|
||||
func2: function (x) { },
|
||||
func3: function (x, z, y) { },
|
||||
func4: function (x, z, y) { },
|
||||
func1: function (y) {
|
||||
if (y === void 0) { y = 10; }
|
||||
var rest = [];
|
||||
for (var _i = 1; _i < arguments.length; _i++) {
|
||||
rest[_i - 1] = arguments[_i];
|
||||
}
|
||||
},
|
||||
func2: function (x) {
|
||||
if (x === void 0) { x = "hello"; }
|
||||
},
|
||||
func3: function (x, z, y) {
|
||||
if (y === void 0) { y = "hello"; }
|
||||
},
|
||||
func4: function (x, z, y) {
|
||||
if (y === void 0) { y = "hello"; }
|
||||
var rest = [];
|
||||
for (var _i = 3; _i < arguments.length; _i++) {
|
||||
rest[_i - 3] = arguments[_i];
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
@@ -22,10 +22,26 @@ var C = (function () {
|
||||
function C(t, z, x, y) {
|
||||
if (y === void 0) { y = "hello"; }
|
||||
}
|
||||
C.prototype.foo = function (x, t) { };
|
||||
C.prototype.foo1 = function (x, t) { };
|
||||
C.prototype.bar = function (t) { };
|
||||
C.prototype.boo = function (t) { };
|
||||
C.prototype.foo = function (x, t) {
|
||||
if (t === void 0) { t = false; }
|
||||
};
|
||||
C.prototype.foo1 = function (x, t) {
|
||||
if (t === void 0) { t = false; }
|
||||
var rest = [];
|
||||
for (var _i = 2; _i < arguments.length; _i++) {
|
||||
rest[_i - 2] = arguments[_i];
|
||||
}
|
||||
};
|
||||
C.prototype.bar = function (t) {
|
||||
if (t === void 0) { t = false; }
|
||||
};
|
||||
C.prototype.boo = function (t) {
|
||||
if (t === void 0) { t = false; }
|
||||
var rest = [];
|
||||
for (var _i = 1; _i < arguments.length; _i++) {
|
||||
rest[_i - 1] = arguments[_i];
|
||||
}
|
||||
};
|
||||
return C;
|
||||
})();
|
||||
var D = (function () {
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
//// [functionWithDefaultParameterWithNoStatements1.ts]
|
||||
function foo(x = 0) { }
|
||||
|
||||
//// [functionWithDefaultParameterWithNoStatements1.js]
|
||||
function foo(x) {
|
||||
if (x === void 0) { x = 0; }
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
=== tests/cases/compiler/functionWithDefaultParameterWithNoStatements1.ts ===
|
||||
function foo(x = 0) { }
|
||||
>foo : (x?: number) => void
|
||||
>x : number
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
//// [functionWithDefaultParameterWithNoStatements10.ts]
|
||||
function foo(a = [0]) { }
|
||||
|
||||
function bar(a = [0]) {
|
||||
}
|
||||
|
||||
//// [functionWithDefaultParameterWithNoStatements10.js]
|
||||
function foo(a) {
|
||||
if (a === void 0) { a = [0]; }
|
||||
}
|
||||
function bar(a) {
|
||||
if (a === void 0) { a = [0]; }
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
=== tests/cases/compiler/functionWithDefaultParameterWithNoStatements10.ts ===
|
||||
function foo(a = [0]) { }
|
||||
>foo : (a?: number[]) => void
|
||||
>a : number[]
|
||||
>[0] : number[]
|
||||
|
||||
function bar(a = [0]) {
|
||||
>bar : (a?: number[]) => void
|
||||
>a : number[]
|
||||
>[0] : number[]
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
//// [functionWithDefaultParameterWithNoStatements11.ts]
|
||||
var v: any[];
|
||||
|
||||
function foo(a = v[0]) { }
|
||||
|
||||
function bar(a = v[0]) {
|
||||
}
|
||||
|
||||
//// [functionWithDefaultParameterWithNoStatements11.js]
|
||||
var v;
|
||||
function foo(a) {
|
||||
if (a === void 0) { a = v[0]; }
|
||||
}
|
||||
function bar(a) {
|
||||
if (a === void 0) { a = v[0]; }
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
=== tests/cases/compiler/functionWithDefaultParameterWithNoStatements11.ts ===
|
||||
var v: any[];
|
||||
>v : any[]
|
||||
|
||||
function foo(a = v[0]) { }
|
||||
>foo : (a?: any) => void
|
||||
>a : any
|
||||
>v[0] : any
|
||||
>v : any[]
|
||||
|
||||
function bar(a = v[0]) {
|
||||
>bar : (a?: any) => void
|
||||
>a : any
|
||||
>v[0] : any
|
||||
>v : any[]
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
//// [functionWithDefaultParameterWithNoStatements12.ts]
|
||||
var v: any[];
|
||||
|
||||
function foo(a = (v)) { }
|
||||
|
||||
function bar(a = (v)) {
|
||||
}
|
||||
|
||||
//// [functionWithDefaultParameterWithNoStatements12.js]
|
||||
var v;
|
||||
function foo(a) {
|
||||
if (a === void 0) { a = (v); }
|
||||
}
|
||||
function bar(a) {
|
||||
if (a === void 0) { a = (v); }
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
=== tests/cases/compiler/functionWithDefaultParameterWithNoStatements12.ts ===
|
||||
var v: any[];
|
||||
>v : any[]
|
||||
|
||||
function foo(a = (v)) { }
|
||||
>foo : (a?: any[]) => void
|
||||
>a : any[]
|
||||
>(v) : any[]
|
||||
>v : any[]
|
||||
|
||||
function bar(a = (v)) {
|
||||
>bar : (a?: any[]) => void
|
||||
>a : any[]
|
||||
>(v) : any[]
|
||||
>v : any[]
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
//// [functionWithDefaultParameterWithNoStatements13.ts]
|
||||
var v: any[];
|
||||
|
||||
function foo(a = [1 + 1]) { }
|
||||
|
||||
function bar(a = [1 + 1]) {
|
||||
}
|
||||
|
||||
//// [functionWithDefaultParameterWithNoStatements13.js]
|
||||
var v;
|
||||
function foo(a) {
|
||||
if (a === void 0) { a = [1 + 1]; }
|
||||
}
|
||||
function bar(a) {
|
||||
if (a === void 0) { a = [1 + 1]; }
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
=== tests/cases/compiler/functionWithDefaultParameterWithNoStatements13.ts ===
|
||||
var v: any[];
|
||||
>v : any[]
|
||||
|
||||
function foo(a = [1 + 1]) { }
|
||||
>foo : (a?: number[]) => void
|
||||
>a : number[]
|
||||
>[1 + 1] : number[]
|
||||
>1 + 1 : number
|
||||
|
||||
function bar(a = [1 + 1]) {
|
||||
>bar : (a?: number[]) => void
|
||||
>a : number[]
|
||||
>[1 + 1] : number[]
|
||||
>1 + 1 : number
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
//// [functionWithDefaultParameterWithNoStatements14.ts]
|
||||
var v: any[];
|
||||
|
||||
function foo(a = v[1 + 1]) { }
|
||||
|
||||
function bar(a = v[1 + 1]) {
|
||||
}
|
||||
|
||||
//// [functionWithDefaultParameterWithNoStatements14.js]
|
||||
var v;
|
||||
function foo(a) {
|
||||
if (a === void 0) { a = v[1 + 1]; }
|
||||
}
|
||||
function bar(a) {
|
||||
if (a === void 0) { a = v[1 + 1]; }
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
=== tests/cases/compiler/functionWithDefaultParameterWithNoStatements14.ts ===
|
||||
var v: any[];
|
||||
>v : any[]
|
||||
|
||||
function foo(a = v[1 + 1]) { }
|
||||
>foo : (a?: any) => void
|
||||
>a : any
|
||||
>v[1 + 1] : any
|
||||
>v : any[]
|
||||
>1 + 1 : number
|
||||
|
||||
function bar(a = v[1 + 1]) {
|
||||
>bar : (a?: any) => void
|
||||
>a : any
|
||||
>v[1 + 1] : any
|
||||
>v : any[]
|
||||
>1 + 1 : number
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
//// [functionWithDefaultParameterWithNoStatements15.ts]
|
||||
var v: any[];
|
||||
|
||||
function foo(a = (1 + 1)) { }
|
||||
|
||||
function bar(a = (1 + 1)) {
|
||||
}
|
||||
|
||||
//// [functionWithDefaultParameterWithNoStatements15.js]
|
||||
var v;
|
||||
function foo(a) {
|
||||
if (a === void 0) { a = (1 + 1); }
|
||||
}
|
||||
function bar(a) {
|
||||
if (a === void 0) { a = (1 + 1); }
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
=== tests/cases/compiler/functionWithDefaultParameterWithNoStatements15.ts ===
|
||||
var v: any[];
|
||||
>v : any[]
|
||||
|
||||
function foo(a = (1 + 1)) { }
|
||||
>foo : (a?: number) => void
|
||||
>a : number
|
||||
>(1 + 1) : number
|
||||
>1 + 1 : number
|
||||
|
||||
function bar(a = (1 + 1)) {
|
||||
>bar : (a?: number) => void
|
||||
>a : number
|
||||
>(1 + 1) : number
|
||||
>1 + 1 : number
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
//// [functionWithDefaultParameterWithNoStatements16.ts]
|
||||
var v: any[];
|
||||
|
||||
function foo(a = bar()) { }
|
||||
|
||||
function bar(a = foo()) {
|
||||
}
|
||||
|
||||
//// [functionWithDefaultParameterWithNoStatements16.js]
|
||||
var v;
|
||||
function foo(a) {
|
||||
if (a === void 0) { a = bar(); }
|
||||
}
|
||||
function bar(a) {
|
||||
if (a === void 0) { a = foo(); }
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
=== tests/cases/compiler/functionWithDefaultParameterWithNoStatements16.ts ===
|
||||
var v: any[];
|
||||
>v : any[]
|
||||
|
||||
function foo(a = bar()) { }
|
||||
>foo : (a?: void) => void
|
||||
>a : void
|
||||
>bar() : void
|
||||
>bar : (a?: void) => void
|
||||
|
||||
function bar(a = foo()) {
|
||||
>bar : (a?: void) => void
|
||||
>a : void
|
||||
>foo() : void
|
||||
>foo : (a?: void) => void
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
//// [functionWithDefaultParameterWithNoStatements2.ts]
|
||||
function foo(x = 0) {
|
||||
}
|
||||
|
||||
//// [functionWithDefaultParameterWithNoStatements2.js]
|
||||
function foo(x) {
|
||||
if (x === void 0) { x = 0; }
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
=== tests/cases/compiler/functionWithDefaultParameterWithNoStatements2.ts ===
|
||||
function foo(x = 0) {
|
||||
>foo : (x?: number) => void
|
||||
>x : number
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
//// [functionWithDefaultParameterWithNoStatements3.ts]
|
||||
function foo(a = "") { }
|
||||
|
||||
function bar(a = "") {
|
||||
}
|
||||
|
||||
//// [functionWithDefaultParameterWithNoStatements3.js]
|
||||
function foo(a) {
|
||||
if (a === void 0) { a = ""; }
|
||||
}
|
||||
function bar(a) {
|
||||
if (a === void 0) { a = ""; }
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
=== tests/cases/compiler/functionWithDefaultParameterWithNoStatements3.ts ===
|
||||
function foo(a = "") { }
|
||||
>foo : (a?: string) => void
|
||||
>a : string
|
||||
|
||||
function bar(a = "") {
|
||||
>bar : (a?: string) => void
|
||||
>a : string
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
//// [functionWithDefaultParameterWithNoStatements4.ts]
|
||||
function foo(a = ``) { }
|
||||
|
||||
function bar(a = ``) {
|
||||
}
|
||||
|
||||
//// [functionWithDefaultParameterWithNoStatements4.js]
|
||||
function foo(a) {
|
||||
if (a === void 0) { a = ""; }
|
||||
}
|
||||
function bar(a) {
|
||||
if (a === void 0) { a = ""; }
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
=== tests/cases/compiler/functionWithDefaultParameterWithNoStatements4.ts ===
|
||||
function foo(a = ``) { }
|
||||
>foo : (a?: string) => void
|
||||
>a : string
|
||||
|
||||
function bar(a = ``) {
|
||||
>bar : (a?: string) => void
|
||||
>a : string
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
//// [functionWithDefaultParameterWithNoStatements5.ts]
|
||||
function foo(a = 0) { }
|
||||
|
||||
function bar(a = 0) {
|
||||
}
|
||||
|
||||
//// [functionWithDefaultParameterWithNoStatements5.js]
|
||||
function foo(a) {
|
||||
if (a === void 0) { a = 0; }
|
||||
}
|
||||
function bar(a) {
|
||||
if (a === void 0) { a = 0; }
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
=== tests/cases/compiler/functionWithDefaultParameterWithNoStatements5.ts ===
|
||||
function foo(a = 0) { }
|
||||
>foo : (a?: number) => void
|
||||
>a : number
|
||||
|
||||
function bar(a = 0) {
|
||||
>bar : (a?: number) => void
|
||||
>a : number
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
//// [functionWithDefaultParameterWithNoStatements6.ts]
|
||||
function foo(a = true) { }
|
||||
|
||||
function bar(a = true) {
|
||||
}
|
||||
|
||||
//// [functionWithDefaultParameterWithNoStatements6.js]
|
||||
function foo(a) {
|
||||
if (a === void 0) { a = true; }
|
||||
}
|
||||
function bar(a) {
|
||||
if (a === void 0) { a = true; }
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
=== tests/cases/compiler/functionWithDefaultParameterWithNoStatements6.ts ===
|
||||
function foo(a = true) { }
|
||||
>foo : (a?: boolean) => void
|
||||
>a : boolean
|
||||
|
||||
function bar(a = true) {
|
||||
>bar : (a?: boolean) => void
|
||||
>a : boolean
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
//// [functionWithDefaultParameterWithNoStatements7.ts]
|
||||
function foo(a = false) { }
|
||||
|
||||
function bar(a = false) {
|
||||
}
|
||||
|
||||
//// [functionWithDefaultParameterWithNoStatements7.js]
|
||||
function foo(a) {
|
||||
if (a === void 0) { a = false; }
|
||||
}
|
||||
function bar(a) {
|
||||
if (a === void 0) { a = false; }
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
=== tests/cases/compiler/functionWithDefaultParameterWithNoStatements7.ts ===
|
||||
function foo(a = false) { }
|
||||
>foo : (a?: boolean) => void
|
||||
>a : boolean
|
||||
|
||||
function bar(a = false) {
|
||||
>bar : (a?: boolean) => void
|
||||
>a : boolean
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
//// [functionWithDefaultParameterWithNoStatements8.ts]
|
||||
function foo(a = undefined) { }
|
||||
|
||||
function bar(a = undefined) {
|
||||
}
|
||||
|
||||
//// [functionWithDefaultParameterWithNoStatements8.js]
|
||||
function foo(a) {
|
||||
if (a === void 0) { a = undefined; }
|
||||
}
|
||||
function bar(a) {
|
||||
if (a === void 0) { a = undefined; }
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
=== tests/cases/compiler/functionWithDefaultParameterWithNoStatements8.ts ===
|
||||
function foo(a = undefined) { }
|
||||
>foo : (a?: any) => void
|
||||
>a : any
|
||||
>undefined : undefined
|
||||
|
||||
function bar(a = undefined) {
|
||||
>bar : (a?: any) => void
|
||||
>a : any
|
||||
>undefined : undefined
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
tests/cases/compiler/functionWithDefaultParameterWithNoStatements9.ts(1,18): error TS2304: Cannot find name 'console'.
|
||||
tests/cases/compiler/functionWithDefaultParameterWithNoStatements9.ts(3,18): error TS2304: Cannot find name 'console'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/functionWithDefaultParameterWithNoStatements9.ts (2 errors) ====
|
||||
function foo(a = console.log) { }
|
||||
~~~~~~~
|
||||
!!! error TS2304: Cannot find name 'console'.
|
||||
|
||||
function bar(a = console.log) {
|
||||
~~~~~~~
|
||||
!!! error TS2304: Cannot find name 'console'.
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
//// [functionWithDefaultParameterWithNoStatements9.ts]
|
||||
function foo(a = console.log) { }
|
||||
|
||||
function bar(a = console.log) {
|
||||
}
|
||||
|
||||
//// [functionWithDefaultParameterWithNoStatements9.js]
|
||||
function foo(a) {
|
||||
if (a === void 0) { a = console.log; }
|
||||
}
|
||||
function bar(a) {
|
||||
if (a === void 0) { a = console.log; }
|
||||
}
|
||||
@@ -1065,18 +1065,42 @@ var x120 = (function () {
|
||||
}
|
||||
return x120;
|
||||
})();
|
||||
function x121(parm) { }
|
||||
function x122(parm) { }
|
||||
function x123(parm) { }
|
||||
function x124(parm) { }
|
||||
function x125(parm) { }
|
||||
function x126(parm) { }
|
||||
function x127(parm) { }
|
||||
function x128(parm) { }
|
||||
function x129(parm) { }
|
||||
function x130(parm) { }
|
||||
function x131(parm) { }
|
||||
function x132(parm) { }
|
||||
function x121(parm) {
|
||||
if (parm === void 0) { parm = function () { return [d1, d2]; }; }
|
||||
}
|
||||
function x122(parm) {
|
||||
if (parm === void 0) { parm = function () { return [d1, d2]; }; }
|
||||
}
|
||||
function x123(parm) {
|
||||
if (parm === void 0) { parm = function named() { return [d1, d2]; }; }
|
||||
}
|
||||
function x124(parm) {
|
||||
if (parm === void 0) { parm = function () { return [d1, d2]; }; }
|
||||
}
|
||||
function x125(parm) {
|
||||
if (parm === void 0) { parm = function () { return [d1, d2]; }; }
|
||||
}
|
||||
function x126(parm) {
|
||||
if (parm === void 0) { parm = function named() { return [d1, d2]; }; }
|
||||
}
|
||||
function x127(parm) {
|
||||
if (parm === void 0) { parm = [d1, d2]; }
|
||||
}
|
||||
function x128(parm) {
|
||||
if (parm === void 0) { parm = [d1, d2]; }
|
||||
}
|
||||
function x129(parm) {
|
||||
if (parm === void 0) { parm = [d1, d2]; }
|
||||
}
|
||||
function x130(parm) {
|
||||
if (parm === void 0) { parm = { n: [d1, d2] }; }
|
||||
}
|
||||
function x131(parm) {
|
||||
if (parm === void 0) { parm = function (n) { var n; return null; }; }
|
||||
}
|
||||
function x132(parm) {
|
||||
if (parm === void 0) { parm = { func: function (n) { return [d1, d2]; } }; }
|
||||
}
|
||||
function x133() { return function () { return [d1, d2]; }; }
|
||||
function x134() { return function () { return [d1, d2]; }; }
|
||||
function x135() { return function named() { return [d1, d2]; }; }
|
||||
|
||||
@@ -19,8 +19,18 @@ function foo2(x) {
|
||||
if (x === void 0) { x = undefined; }
|
||||
return x;
|
||||
} // ok
|
||||
function foo3(x) { } // error
|
||||
function foo4(x, y) { } // error
|
||||
function foo5(x, y) { } // ok
|
||||
function foo6(x, y, z) { } // error
|
||||
function foo7(x, y) { } // should be ok
|
||||
function foo3(x) {
|
||||
if (x === void 0) { x = 1; }
|
||||
} // error
|
||||
function foo4(x, y) {
|
||||
if (y === void 0) { y = x; }
|
||||
} // error
|
||||
function foo5(x, y) {
|
||||
if (y === void 0) { y = x; }
|
||||
} // ok
|
||||
function foo6(x, y, z) {
|
||||
if (z === void 0) { z = y; }
|
||||
} // error
|
||||
function foo7(x, y) {
|
||||
if (y === void 0) { y = x; }
|
||||
} // should be ok
|
||||
|
||||
@@ -21,10 +21,16 @@ function func2(a, b, c) { }
|
||||
; // error at "a,b,c"
|
||||
function func3() { }
|
||||
; // error at "args"
|
||||
function func4(z, w) { }
|
||||
function func4(z, w) {
|
||||
if (z === void 0) { z = null; }
|
||||
if (w === void 0) { w = undefined; }
|
||||
}
|
||||
; // error at "z,w"
|
||||
// these shouldn't be errors
|
||||
function noError1(x, y) { }
|
||||
function noError1(x, y) {
|
||||
if (x === void 0) { x = 3; }
|
||||
if (y === void 0) { y = 2; }
|
||||
}
|
||||
;
|
||||
function noError2(x, y) { }
|
||||
;
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
//// [interfaceWithCommaSeparators.ts]
|
||||
var v: { bar(): void, baz }
|
||||
interface Foo { bar(): void, baz }
|
||||
|
||||
//// [interfaceWithCommaSeparators.js]
|
||||
var v;
|
||||
@@ -0,0 +1,11 @@
|
||||
=== tests/cases/compiler/interfaceWithCommaSeparators.ts ===
|
||||
var v: { bar(): void, baz }
|
||||
>v : { bar(): void; baz: any; }
|
||||
>bar : () => void
|
||||
>baz : any
|
||||
|
||||
interface Foo { bar(): void, baz }
|
||||
>Foo : Foo
|
||||
>bar : () => void
|
||||
>baz : any
|
||||
|
||||
+1
-4
@@ -3,7 +3,6 @@ tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPr
|
||||
tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentError.ts(5,16): error TS1131: Property or signature expected.
|
||||
tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentError.ts(5,22): error TS2403: Subsequent variable declarations must have the same type. Variable 'id' must be of type 'number', but here has type 'any'.
|
||||
tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentError.ts(5,25): error TS1128: Declaration or statement expected.
|
||||
tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentError.ts(6,53): error TS1005: ';' expected.
|
||||
tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentError.ts(6,79): error TS2322: Type '{ name: string; id: number; }' is not assignable to type '{ id: string; name: number; }'.
|
||||
Types of property 'id' are incompatible.
|
||||
Type 'number' is not assignable to type 'string'.
|
||||
@@ -12,7 +11,7 @@ tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPr
|
||||
Type 'number' is not assignable to type 'boolean'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentError.ts (7 errors) ====
|
||||
==== tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentError.ts (6 errors) ====
|
||||
var id: number = 10000;
|
||||
var name: string = "my name";
|
||||
|
||||
@@ -28,8 +27,6 @@ tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPr
|
||||
~
|
||||
!!! error TS1128: Declaration or statement expected.
|
||||
function foo(name: string, id: number): { id: string, name: number } { return { name, id }; } // error
|
||||
~
|
||||
!!! error TS1005: ';' expected.
|
||||
~~~~~~~~~~~~
|
||||
!!! error TS2322: Type '{ name: string; id: number; }' is not assignable to type '{ id: string; name: number; }'.
|
||||
!!! error TS2322: Types of property 'id' are incompatible.
|
||||
|
||||
+2
-11
@@ -1,20 +1,17 @@
|
||||
tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts(4,5): error TS2322: Type '{ name: string; id: number; }' is not assignable to type '{ b: string; id: number; }'.
|
||||
Property 'b' is missing in type '{ name: string; id: number; }'.
|
||||
tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts(5,55): error TS1005: ';' expected.
|
||||
tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts(5,79): error TS2322: Type '{ name: string; id: number; }' is not assignable to type '{ name: number; id: string; }'.
|
||||
Types of property 'name' are incompatible.
|
||||
Type 'string' is not assignable to type 'number'.
|
||||
tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts(6,55): error TS1005: ';' expected.
|
||||
tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts(7,16): error TS1131: Property or signature expected.
|
||||
tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts(7,22): error TS2403: Subsequent variable declarations must have the same type. Variable 'id' must be of type 'number', but here has type 'any'.
|
||||
tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts(7,25): error TS1128: Declaration or statement expected.
|
||||
tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts(8,5): error TS2322: Type '{ name: number; id: string; }' is not assignable to type '{ name: string; id: number; }'.
|
||||
Types of property 'name' are incompatible.
|
||||
Type 'number' is not assignable to type 'string'.
|
||||
tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts(8,28): error TS1005: ';' expected.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts (9 errors) ====
|
||||
==== tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts (6 errors) ====
|
||||
var id: number = 10000;
|
||||
var name: string = "my name";
|
||||
|
||||
@@ -23,15 +20,11 @@ tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPr
|
||||
!!! error TS2322: Type '{ name: string; id: number; }' is not assignable to type '{ b: string; id: number; }'.
|
||||
!!! error TS2322: Property 'b' is missing in type '{ name: string; id: number; }'.
|
||||
function bar(name: string, id: number): { name: number, id: string } { return { name, id }; } // error
|
||||
~
|
||||
!!! error TS1005: ';' expected.
|
||||
~~~~~~~~~~~~
|
||||
!!! error TS2322: Type '{ name: string; id: number; }' is not assignable to type '{ name: number; id: string; }'.
|
||||
!!! error TS2322: Types of property 'name' are incompatible.
|
||||
!!! error TS2322: Type 'string' is not assignable to type 'number'.
|
||||
function foo(name: string, id: number): { name: string, id: number } { return { name, id }; } // error
|
||||
~
|
||||
!!! error TS1005: ';' expected.
|
||||
var person1: { name, id }; // error : Can't use shorthand in the type position
|
||||
~~~~
|
||||
!!! error TS1131: Property or signature expected.
|
||||
@@ -43,6 +36,4 @@ tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPr
|
||||
~~~~~~~
|
||||
!!! error TS2322: Type '{ name: number; id: string; }' is not assignable to type '{ name: string; id: number; }'.
|
||||
!!! error TS2322: Types of property 'name' are incompatible.
|
||||
!!! error TS2322: Type 'number' is not assignable to type 'string'.
|
||||
~
|
||||
!!! error TS1005: ';' expected.
|
||||
!!! error TS2322: Type 'number' is not assignable to type 'string'.
|
||||
@@ -1,12 +1,9 @@
|
||||
tests/cases/conformance/types/objectTypeLiteral/objectTypeLiteralSyntax2.ts(2,16): error TS1005: ';' expected.
|
||||
tests/cases/conformance/types/objectTypeLiteral/objectTypeLiteralSyntax2.ts(12,22): error TS1005: ';' expected.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/objectTypeLiteral/objectTypeLiteralSyntax2.ts (2 errors) ====
|
||||
==== tests/cases/conformance/types/objectTypeLiteral/objectTypeLiteralSyntax2.ts (1 errors) ====
|
||||
var x: {
|
||||
foo: string,
|
||||
~
|
||||
!!! error TS1005: ';' expected.
|
||||
bar: string
|
||||
}
|
||||
|
||||
|
||||
@@ -10,12 +10,21 @@ var a = (x?=0) => { return 1; };
|
||||
var b = (x, y?:number = 2) => { x; };
|
||||
|
||||
//// [optionalArgsWithDefaultValues.js]
|
||||
function foo(x, y, z) { }
|
||||
function foo(x, y, z) {
|
||||
if (y === void 0) { y = false; }
|
||||
if (z === void 0) { z = 0; }
|
||||
}
|
||||
var CCC = (function () {
|
||||
function CCC() {
|
||||
}
|
||||
CCC.prototype.foo = function (x, y, z) { };
|
||||
CCC.foo2 = function (x, y, z) { };
|
||||
CCC.prototype.foo = function (x, y, z) {
|
||||
if (y === void 0) { y = false; }
|
||||
if (z === void 0) { z = 0; }
|
||||
};
|
||||
CCC.foo2 = function (x, y, z) {
|
||||
if (y === void 0) { y = false; }
|
||||
if (z === void 0) { z = 0; }
|
||||
};
|
||||
return CCC;
|
||||
})();
|
||||
var a = function (x) {
|
||||
|
||||
@@ -11,10 +11,6 @@ foo([false, 0, ""]);
|
||||
|
||||
//// [optionalBindingParametersInOverloads1.js]
|
||||
function foo() {
|
||||
var rest = [];
|
||||
for (var _i = 0; _i < arguments.length; _i++) {
|
||||
rest[_i - 0] = arguments[_i];
|
||||
}
|
||||
}
|
||||
foo(["", 0, false]);
|
||||
foo([false, 0, ""]);
|
||||
|
||||
@@ -11,10 +11,6 @@ foo({ x: false, y: 0, z: "" });
|
||||
|
||||
//// [optionalBindingParametersInOverloads2.js]
|
||||
function foo() {
|
||||
var rest = [];
|
||||
for (var _i = 0; _i < arguments.length; _i++) {
|
||||
rest[_i - 0] = arguments[_i];
|
||||
}
|
||||
}
|
||||
foo({ x: "", y: 0, z: false });
|
||||
foo({ x: false, y: 0, z: "" });
|
||||
|
||||
@@ -242,7 +242,10 @@ c1o1.C1M4();
|
||||
i1o1.C1M4();
|
||||
F4();
|
||||
L4();
|
||||
function fnOpt1(id, children, expectedPath, isRoot) { }
|
||||
function fnOpt1(id, children, expectedPath, isRoot) {
|
||||
if (children === void 0) { children = []; }
|
||||
if (expectedPath === void 0) { expectedPath = []; }
|
||||
}
|
||||
function fnOpt2(id, children, expectedPath, isRoot) { }
|
||||
fnOpt1(1, [2, 3], [1], true);
|
||||
fnOpt2(1, [2, 3], [1], true);
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
//// [out-flag.js.map]
|
||||
{"version":3,"file":"out-flag.js","sourceRoot":"","sources":["out-flag.ts"],"names":["MyClass","MyClass.constructor","MyClass.Count","MyClass.SetCount"],"mappings":"AAAA,eAAe;AAGf,AADA,oBAAoB;IACd,OAAO;IAAbA,SAAMA,OAAOA;IAYbC,CAACA;IAVGD,uBAAuBA;IAChBA,uBAAKA,GAAZA;QAEIE,MAAMA,CAACA,EAAEA,CAACA;IACdA,CAACA;IAEMF,0BAAQA,GAAfA,UAAgBA,KAAaA;QAEzBG,EAAEA;IACNA,CAACA;IACLH,cAACA;AAADA,CAACA,AAZD,IAYC"}
|
||||
{"version":3,"file":"out-flag.js","sourceRoot":"","sources":["out-flag.ts"],"names":["MyClass","MyClass.constructor","MyClass.Count"],"mappings":"AAAA,eAAe;AAGf,AADA,oBAAoB;IACd,OAAO;IAAbA,SAAMA,OAAOA;IAYbC,CAACA;IAVGD,uBAAuBA;IAChBA,uBAAKA,GAAZA;QAEIE,MAAMA,CAACA,EAAEA,CAACA;IACdA,CAACA;IAEMF,0BAAQA,GAAfA,UAAgBA,KAAaA;QAEzBA,EAAEA;IACNA,CAACA;IACLA,cAACA;AAADA,CAACA,AAZD,IAYC"}
|
||||
@@ -150,8 +150,8 @@ sourceFile:out-flag.ts
|
||||
> {
|
||||
>
|
||||
2 > //
|
||||
1 >Emitted(11, 9) Source(14, 9) + SourceIndex(0) name (MyClass.SetCount)
|
||||
2 >Emitted(11, 11) Source(14, 11) + SourceIndex(0) name (MyClass.SetCount)
|
||||
1 >Emitted(11, 9) Source(14, 9) + SourceIndex(0) name (MyClass)
|
||||
2 >Emitted(11, 11) Source(14, 11) + SourceIndex(0) name (MyClass)
|
||||
---
|
||||
>>> };
|
||||
1 >^^^^
|
||||
@@ -160,8 +160,8 @@ sourceFile:out-flag.ts
|
||||
1 >
|
||||
>
|
||||
2 > }
|
||||
1 >Emitted(12, 5) Source(15, 5) + SourceIndex(0) name (MyClass.SetCount)
|
||||
2 >Emitted(12, 6) Source(15, 6) + SourceIndex(0) name (MyClass.SetCount)
|
||||
1 >Emitted(12, 5) Source(15, 5) + SourceIndex(0) name (MyClass)
|
||||
2 >Emitted(12, 6) Source(15, 6) + SourceIndex(0) name (MyClass)
|
||||
---
|
||||
>>> return MyClass;
|
||||
1->^^^^
|
||||
|
||||
@@ -73,14 +73,23 @@ function outside() {
|
||||
var b;
|
||||
}
|
||||
}
|
||||
function defaultArgFunction(a, b) { }
|
||||
function defaultArgArrow(a, b) { }
|
||||
function defaultArgFunction(a, b) {
|
||||
if (a === void 0) { a = function () { return b; }; }
|
||||
if (b === void 0) { b = 1; }
|
||||
}
|
||||
function defaultArgArrow(a, b) {
|
||||
if (a === void 0) { a = function () { return function () { return b; }; }; }
|
||||
if (b === void 0) { b = 3; }
|
||||
}
|
||||
var C = (function () {
|
||||
function C(a, b) {
|
||||
if (a === void 0) { a = b; }
|
||||
if (b === void 0) { b = 1; }
|
||||
}
|
||||
C.prototype.method = function (a, b) { };
|
||||
C.prototype.method = function (a, b) {
|
||||
if (a === void 0) { a = b; }
|
||||
if (b === void 0) { b = 1; }
|
||||
};
|
||||
return C;
|
||||
})();
|
||||
// Function expressions
|
||||
|
||||
@@ -25,11 +25,11 @@ var h = tempFun `${ (x => x) } ${ (((x => x))) } ${ undefined }`
|
||||
function tempFun(tempStrs, g, x) {
|
||||
return g(x);
|
||||
}
|
||||
var a = tempFun `${x => { return x; }} ${10}`;
|
||||
var b = tempFun `${(x => { return x; })} ${10}`;
|
||||
var c = tempFun `${((x => { return x; }))} ${10}`;
|
||||
var d = tempFun `${x => { return x; }} ${x => { return x; }} ${10}`;
|
||||
var e = tempFun `${x => { return x; }} ${(x => { return x; })} ${10}`;
|
||||
var f = tempFun `${x => { return x; }} ${((x => { return x; }))} ${10}`;
|
||||
var g = tempFun `${(x => { return x; })} ${(((x => { return x; })))} ${10}`;
|
||||
var h = tempFun `${(x => { return x; })} ${(((x => { return x; })))} ${undefined}`;
|
||||
var a = tempFun `${x => x} ${10}`;
|
||||
var b = tempFun `${(x => x)} ${10}`;
|
||||
var c = tempFun `${((x => x))} ${10}`;
|
||||
var d = tempFun `${x => x} ${x => x} ${10}`;
|
||||
var e = tempFun `${x => x} ${(x => x)} ${10}`;
|
||||
var f = tempFun `${x => x} ${((x => x))} ${10}`;
|
||||
var g = tempFun `${(x => x)} ${(((x => x)))} ${10}`;
|
||||
var h = tempFun `${(x => x)} ${(((x => x)))} ${undefined}`;
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserCommaInTypeMemberList1.ts(1,23): error TS1005: ';' expected.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserCommaInTypeMemberList1.ts (1 errors) ====
|
||||
var v: { workItem: any, width: string };
|
||||
~
|
||||
!!! error TS1005: ';' expected.
|
||||
@@ -0,0 +1,6 @@
|
||||
=== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserCommaInTypeMemberList1.ts ===
|
||||
var v: { workItem: any, width: string };
|
||||
>v : { workItem: any; width: string; }
|
||||
>workItem : any
|
||||
>width : string
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserCommaInTypeMemberList2.ts(1,9): error TS2304: Cannot find name '$'.
|
||||
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserCommaInTypeMemberList2.ts(1,53): error TS1005: ';' expected.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserCommaInTypeMemberList2.ts (2 errors) ====
|
||||
==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserCommaInTypeMemberList2.ts (1 errors) ====
|
||||
var s = $.extend< { workItem: any }, { workItem: any, width: string }>({ workItem: this._workItem }, {});
|
||||
~
|
||||
!!! error TS2304: Cannot find name '$'.
|
||||
~
|
||||
!!! error TS1005: ';' expected.
|
||||
|
||||
@@ -8,7 +8,9 @@ var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
Object.defineProperty(C.prototype, "Foo", {
|
||||
set: function (a) { },
|
||||
set: function (a) {
|
||||
if (a === void 0) { a = 1; }
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
@@ -7,6 +7,12 @@ class C {
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
C.prototype.foo = function () { };
|
||||
C.prototype.foo = function () {
|
||||
if (bar === void 0) { bar = 0; }
|
||||
var bar = [];
|
||||
for (var _i = 0; _i < arguments.length; _i++) {
|
||||
bar[_i - 0] = arguments[_i];
|
||||
}
|
||||
};
|
||||
return C;
|
||||
})();
|
||||
|
||||
@@ -7,6 +7,8 @@ class C {
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
C.prototype.F = function (A) { };
|
||||
C.prototype.F = function (A) {
|
||||
if (A === void 0) { A = 0; }
|
||||
};
|
||||
return C;
|
||||
})();
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
//// [properties.js.map]
|
||||
{"version":3,"file":"properties.js","sourceRoot":"","sources":["properties.ts"],"names":["MyClass","MyClass.constructor","MyClass.Count"],"mappings":"AACA,IAAM,OAAO;IAAbA,SAAMA,OAAOA;IAWbC,CAACA;IATGD,sBAAWA,0BAAKA;aAAhBA;YAEIE,MAAMA,CAACA,EAAEA,CAACA;QACdA,CAACA;aAEDF,UAAiBA,KAAaA;YAE1BE,EAAEA;QACNA,CAACA;;;OALAF;IAMLA,cAACA;AAADA,CAACA,AAXD,IAWC"}
|
||||
{"version":3,"file":"properties.js","sourceRoot":"","sources":["properties.ts"],"names":["MyClass","MyClass.constructor","MyClass.Count"],"mappings":"AACA,IAAM,OAAO;IAAbA,SAAMA,OAAOA;IAWbC,CAACA;IATGD,sBAAWA,0BAAKA;aAAhBA;YAEIE,MAAMA,CAACA,EAAEA,CAACA;QACdA,CAACA;aAEDF,UAAiBA,KAAaA;YAE1BA,EAAEA;QACNA,CAACA;;;OALAA;IAMLA,cAACA;AAADA,CAACA,AAXD,IAWC"}
|
||||
@@ -118,8 +118,8 @@ sourceFile:properties.ts
|
||||
> {
|
||||
>
|
||||
2 > //
|
||||
1 >Emitted(9, 13) Source(11, 9) + SourceIndex(0) name (MyClass.Count)
|
||||
2 >Emitted(9, 15) Source(11, 11) + SourceIndex(0) name (MyClass.Count)
|
||||
1 >Emitted(9, 13) Source(11, 9) + SourceIndex(0) name (MyClass)
|
||||
2 >Emitted(9, 15) Source(11, 11) + SourceIndex(0) name (MyClass)
|
||||
---
|
||||
>>> },
|
||||
1 >^^^^^^^^
|
||||
@@ -128,8 +128,8 @@ sourceFile:properties.ts
|
||||
1 >
|
||||
>
|
||||
2 > }
|
||||
1 >Emitted(10, 9) Source(12, 5) + SourceIndex(0) name (MyClass.Count)
|
||||
2 >Emitted(10, 10) Source(12, 6) + SourceIndex(0) name (MyClass.Count)
|
||||
1 >Emitted(10, 9) Source(12, 5) + SourceIndex(0) name (MyClass)
|
||||
2 >Emitted(10, 10) Source(12, 6) + SourceIndex(0) name (MyClass)
|
||||
---
|
||||
>>> enumerable: true,
|
||||
>>> configurable: true
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
//// [recursiveClassReferenceTest.js.map]
|
||||
{"version":3,"file":"recursiveClassReferenceTest.js","sourceRoot":"","sources":["recursiveClassReferenceTest.ts"],"names":["Sample","Sample.Actions","Sample.Actions.Thing","Sample.Actions.Thing.Find","Sample.Actions.Thing.Find.StartFindAction","Sample.Actions.Thing.Find.StartFindAction.constructor","Sample.Actions.Thing.Find.StartFindAction.getId","Sample.Actions.Thing.Find.StartFindAction.run","Sample.Thing","Sample.Thing.Widgets","Sample.Thing.Widgets.FindWidget","Sample.Thing.Widgets.FindWidget.constructor","Sample.Thing.Widgets.FindWidget.gar","Sample.Thing.Widgets.FindWidget.getDomNode","Sample.Thing.Widgets.FindWidget.destroy","AbstractMode","AbstractMode.constructor","AbstractMode.getInitialState","Sample.Thing.Languages","Sample.Thing.Languages.PlainText","Sample.Thing.Languages.PlainText.State","Sample.Thing.Languages.PlainText.State.constructor","Sample.Thing.Languages.PlainText.State.clone","Sample.Thing.Languages.PlainText.State.equals","Sample.Thing.Languages.PlainText.State.getMode","Sample.Thing.Languages.PlainText.Mode","Sample.Thing.Languages.PlainText.Mode.constructor","Sample.Thing.Languages.PlainText.Mode.getInitialState"],"mappings":"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"}
|
||||
{"version":3,"file":"recursiveClassReferenceTest.js","sourceRoot":"","sources":["recursiveClassReferenceTest.ts"],"names":["Sample","Sample.Actions","Sample.Actions.Thing","Sample.Actions.Thing.Find","Sample.Actions.Thing.Find.StartFindAction","Sample.Actions.Thing.Find.StartFindAction.constructor","Sample.Actions.Thing.Find.StartFindAction.getId","Sample.Actions.Thing.Find.StartFindAction.run","Sample.Thing","Sample.Thing.Widgets","Sample.Thing.Widgets.FindWidget","Sample.Thing.Widgets.FindWidget.constructor","Sample.Thing.Widgets.FindWidget.gar","Sample.Thing.Widgets.FindWidget.getDomNode","AbstractMode","AbstractMode.constructor","AbstractMode.getInitialState","Sample.Thing.Languages","Sample.Thing.Languages.PlainText","Sample.Thing.Languages.PlainText.State","Sample.Thing.Languages.PlainText.State.constructor","Sample.Thing.Languages.PlainText.State.clone","Sample.Thing.Languages.PlainText.State.equals","Sample.Thing.Languages.PlainText.State.getMode","Sample.Thing.Languages.PlainText.Mode","Sample.Thing.Languages.PlainText.Mode.constructor","Sample.Thing.Languages.PlainText.Mode.getInitialState"],"mappings":"AAAA,iEAAiE;AACjE,0EAA0E;;;;;;;AA8B1E,IAAO,MAAM,CAUZ;AAVD,WAAO,MAAM;IAACA,IAAAA,OAAOA,CAUpBA;IAVaA,WAAAA,OAAOA;QAACC,IAAAA,KAAKA,CAU1BA;QAVqBA,WAAAA,QAAKA;YAACC,IAAAA,IAAIA,CAU/BA;YAV2BA,WAAAA,IAAIA,EAACA,CAACA;gBACjCC,IAAaA,eAAeA;oBAA5BC,SAAaA,eAAeA;oBAQ5BC,CAACA;oBANOD,+BAAKA,GAAZA,cAAiBE,MAAMA,CAACA,IAAIA,CAACA,CAACA,CAACA;oBAExBF,6BAAGA,GAAVA,UAAWA,KAA6BA;wBAEvCG,MAAMA,CAACA,IAAIA,CAACA;oBACbA,CAACA;oBACFH,sBAACA;gBAADA,CAACA,AARDD,IAQCA;gBARYA,oBAAeA,GAAfA,eAQZA,CAAAA;YACFA,CAACA,EAV2BD,IAAIA,GAAJA,aAAIA,KAAJA,aAAIA,QAU/BA;QAADA,CAACA,EAVqBD,KAAKA,GAALA,aAAKA,KAALA,aAAKA,QAU1BA;IAADA,CAACA,EAVaD,OAAOA,GAAPA,cAAOA,KAAPA,cAAOA,QAUpBA;AAADA,CAACA,EAVM,MAAM,KAAN,MAAM,QAUZ;AAED,IAAO,MAAM,CAoBZ;AApBD,WAAO,MAAM;IAACA,IAAAA,KAAKA,CAoBlBA;IApBaA,WAAAA,KAAKA;QAACQ,IAAAA,OAAOA,CAoB1BA;QApBmBA,WAAAA,OAAOA,EAACA,CAACA;YAC5BC,IAAaA,UAAUA;gBAKtBC,SALYA,UAAUA,CAKFA,SAAkCA;oBAAlCC,cAASA,GAATA,SAASA,CAAyBA;oBAD9CA,YAAOA,GAAOA,IAAIA,CAACA;oBAGvBA,AADAA,aAAaA;oBACbA,SAASA,CAACA,SAASA,CAACA,WAAWA,EAAEA,IAAIA,CAACA,CAACA;gBAC3CA,CAACA;gBANMD,wBAAGA,GAAVA,UAAWA,MAAyCA,IAAIE,EAAEA,CAACA,CAACA,IAAIA,CAACA,CAACA,CAACA;oBAAAA,MAAMA,CAACA,MAAMA,CAACA,IAAIA,CAACA,CAACA;gBAAAA,CAACA,CAAAA,CAACA;gBAQlFF,+BAAUA,GAAjBA;oBACCG,MAAMA,CAACA,OAAOA,CAACA;gBAChBA,CAACA;gBAEMH,4BAAOA,GAAdA;gBAEAA,CAACA;gBAEFA,iBAACA;YAADA,CAACA,AAlBDD,IAkBCA;YAlBYA,kBAAUA,GAAVA,UAkBZA,CAAAA;QACFA,CAACA,EApBmBD,OAAOA,GAAPA,aAAOA,KAAPA,aAAOA,QAoB1BA;IAADA,CAACA,EApBaR,KAAKA,GAALA,YAAKA,KAALA,YAAKA,QAoBlBA;AAADA,CAACA,EApBM,MAAM,KAAN,MAAM,QAoBZ;AAGD,IAAM,YAAY;IAAlBc,SAAMA,YAAYA;IAAqEC,CAACA;IAA3CD,sCAAeA,GAAtBA,cAAmCE,MAAMA,CAACA,IAAIA,CAACA,CAAAA,CAACA;IAACF,mBAACA;AAADA,CAACA,AAAxF,IAAwF;AASxF,IAAO,MAAM,CAwBZ;AAxBD,WAAO,MAAM;IAACd,IAAAA,KAAKA,CAwBlBA;IAxBaA,WAAAA,KAAKA;QAACQ,IAAAA,SAASA,CAwB5BA;QAxBmBA,WAAAA,SAASA;YAACS,IAAAA,SAASA,CAwBtCA;YAxB6BA,WAAAA,SAASA,EAACA,CAACA;gBAExCC,IAAaA,KAAKA;oBACXC,SADMA,KAAKA,CACSA,IAAWA;wBAAXC,SAAIA,GAAJA,IAAIA,CAAOA;oBAAIA,CAACA;oBACnCD,qBAAKA,GAAZA;wBACCE,MAAMA,CAACA,IAAIA,CAACA;oBACbA,CAACA;oBAEMF,sBAAMA,GAAbA,UAAcA,KAAYA;wBACzBG,MAAMA,CAACA,IAAIA,KAAKA,KAAKA,CAACA;oBACvBA,CAACA;oBAEMH,uBAAOA,GAAdA,cAA0BI,MAAMA,CAACA,IAAIA,CAACA,CAACA,CAACA;oBACzCJ,YAACA;gBAADA,CAACA,AAXDD,IAWCA;gBAXYA,eAAKA,GAALA,KAWZA,CAAAA;gBAEDA,IAAaA,IAAIA;oBAASM,UAAbA,IAAIA,UAAqBA;oBAAtCA,SAAaA,IAAIA;wBAASC,8BAAYA;oBAQtCA,CAACA;oBANAD,aAAaA;oBACNA,8BAAeA,GAAtBA;wBACCE,MAAMA,CAACA,IAAIA,KAAKA,CAACA,IAAIA,CAACA,CAACA;oBACxBA,CAACA;oBAGFF,WAACA;gBAADA,CAACA,AARDN,EAA0BA,YAAYA,EAQrCA;gBARYA,cAAIA,GAAJA,IAQZA,CAAAA;YACFA,CAACA,EAxB6BD,SAASA,GAATA,mBAASA,KAATA,mBAASA,QAwBtCA;QAADA,CAACA,EAxBmBT,SAASA,GAATA,eAASA,KAATA,eAASA,QAwB5BA;IAADA,CAACA,EAxBaR,KAAKA,GAALA,YAAKA,KAALA,YAAKA,QAwBlBA;AAADA,CAACA,EAxBM,MAAM,KAAN,MAAM,QAwBZ"}
|
||||
@@ -975,8 +975,8 @@ sourceFile:recursiveClassReferenceTest.ts
|
||||
>
|
||||
>
|
||||
2 > }
|
||||
1 >Emitted(51, 17) Source(61, 3) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.destroy)
|
||||
2 >Emitted(51, 18) Source(61, 4) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.destroy)
|
||||
1 >Emitted(51, 17) Source(61, 3) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget)
|
||||
2 >Emitted(51, 18) Source(61, 4) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget)
|
||||
---
|
||||
>>> return FindWidget;
|
||||
1->^^^^^^^^^^^^^^^^
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user