@@ -11955,9 +11955,10 @@ module ts {
11955
11955
}
11956
11956
11957
11957
/** Serializes an EntityName (with substitutions) to an appropriate JS constructor value. Used by the __metadata decorator. */
11958
- function serializeEntityName(node: EntityName, getGeneratedNameForNode: (Node: Node) => string, fallbackPath?: string[]): string {
11958
+ function serializeEntityName(node: EntityName, fallbackPath?: string[]): string {
11959
11959
if (node.kind === SyntaxKind.Identifier) {
11960
- // TODO(andersh): Fix this
11960
+ // TODO(ron.buckton): The getExpressionNameSubstitution function has been removed, but calling it
11961
+ // here has no effect anyway as an identifier in a type name is not an expression.
11961
11962
// var substitution = getExpressionNameSubstitution(<Identifier>node, getGeneratedNameForNode);
11962
11963
// var text = substitution || (<Identifier>node).text;
11963
11964
var text = (<Identifier>node).text;
@@ -11969,16 +11970,16 @@ module ts {
11969
11970
}
11970
11971
}
11971
11972
else {
11972
- var left = serializeEntityName((<QualifiedName>node).left, getGeneratedNameForNode, fallbackPath);
11973
- var right = serializeEntityName((<QualifiedName>node).right, getGeneratedNameForNode, fallbackPath);
11973
+ var left = serializeEntityName((<QualifiedName>node).left, fallbackPath);
11974
+ var right = serializeEntityName((<QualifiedName>node).right, fallbackPath);
11974
11975
if (!fallbackPath) {
11975
11976
return left + "." + right;
11976
11977
}
11977
11978
}
11978
11979
}
11979
11980
11980
11981
/** Serializes a TypeReferenceNode to an appropriate JS constructor value. Used by the __metadata decorator. */
11981
- function serializeTypeReferenceNode(node: TypeReferenceNode, getGeneratedNameForNode: (Node: Node) => string ): string | string[] {
11982
+ function serializeTypeReferenceNode(node: TypeReferenceNode): string | string[] {
11982
11983
// serialization of a TypeReferenceNode uses the following rules:
11983
11984
//
11984
11985
// * The serialized type of a TypeReference that is `void` is "void 0".
@@ -12011,11 +12012,11 @@ module ts {
12011
12012
}
12012
12013
else if (type === unknownType) {
12013
12014
var fallbackPath: string[] = [];
12014
- serializeEntityName(node.typeName, getGeneratedNameForNode, fallbackPath);
12015
+ serializeEntityName(node.typeName, fallbackPath);
12015
12016
return fallbackPath;
12016
12017
}
12017
12018
else if (type.symbol && type.symbol.valueDeclaration) {
12018
- return serializeEntityName(node.typeName, getGeneratedNameForNode );
12019
+ return serializeEntityName(node.typeName);
12019
12020
}
12020
12021
else if (typeHasCallOrConstructSignatures(type)) {
12021
12022
return "Function";
@@ -12025,7 +12026,7 @@ module ts {
12025
12026
}
12026
12027
12027
12028
/** Serializes a TypeNode to an appropriate JS constructor value. Used by the __metadata decorator. */
12028
- function serializeTypeNode(node: TypeNode | LiteralExpression, getGeneratedNameForNode: (Node: Node) => string ): string | string[] {
12029
+ function serializeTypeNode(node: TypeNode | LiteralExpression): string | string[] {
12029
12030
// serialization of a TypeNode uses the following rules:
12030
12031
//
12031
12032
// * The serialized type of `void` is "void 0" (undefined).
@@ -12041,7 +12042,7 @@ module ts {
12041
12042
case SyntaxKind.VoidKeyword:
12042
12043
return "void 0";
12043
12044
case SyntaxKind.ParenthesizedType:
12044
- return serializeTypeNode((<ParenthesizedTypeNode>node).type, getGeneratedNameForNode );
12045
+ return serializeTypeNode((<ParenthesizedTypeNode>node).type);
12045
12046
case SyntaxKind.FunctionType:
12046
12047
case SyntaxKind.ConstructorType:
12047
12048
return "Function";
@@ -12056,7 +12057,7 @@ module ts {
12056
12057
case SyntaxKind.NumberKeyword:
12057
12058
return "Number";
12058
12059
case SyntaxKind.TypeReference:
12059
- return serializeTypeReferenceNode(<TypeReferenceNode>node, getGeneratedNameForNode );
12060
+ return serializeTypeReferenceNode(<TypeReferenceNode>node);
12060
12061
case SyntaxKind.TypeQuery:
12061
12062
case SyntaxKind.TypeLiteral:
12062
12063
case SyntaxKind.UnionType:
@@ -12072,7 +12073,7 @@ module ts {
12072
12073
}
12073
12074
12074
12075
/** Serializes the type of a declaration to an appropriate JS constructor value. Used by the __metadata decorator for a class member. */
12075
- function serializeTypeOfNode(node: Node, getGeneratedNameForNode: (Node: Node) => string ): string | string[] {
12076
+ function serializeTypeOfNode(node: Node): string | string[] {
12076
12077
// serialization of the type of a declaration uses the following rules:
12077
12078
//
12078
12079
// * The serialized type of a ClassDeclaration is "Function"
@@ -12085,10 +12086,10 @@ module ts {
12085
12086
// For rules on serializing type annotations, see `serializeTypeNode`.
12086
12087
switch (node.kind) {
12087
12088
case SyntaxKind.ClassDeclaration: return "Function";
12088
- case SyntaxKind.PropertyDeclaration: return serializeTypeNode((<PropertyDeclaration>node).type, getGeneratedNameForNode );
12089
- case SyntaxKind.Parameter: return serializeTypeNode((<ParameterDeclaration>node).type, getGeneratedNameForNode );
12090
- case SyntaxKind.GetAccessor: return serializeTypeNode((<AccessorDeclaration>node).type, getGeneratedNameForNode );
12091
- case SyntaxKind.SetAccessor: return serializeTypeNode(getSetAccessorTypeAnnotationNode(<AccessorDeclaration>node), getGeneratedNameForNode );
12089
+ case SyntaxKind.PropertyDeclaration: return serializeTypeNode((<PropertyDeclaration>node).type);
12090
+ case SyntaxKind.Parameter: return serializeTypeNode((<ParameterDeclaration>node).type);
12091
+ case SyntaxKind.GetAccessor: return serializeTypeNode((<AccessorDeclaration>node).type);
12092
+ case SyntaxKind.SetAccessor: return serializeTypeNode(getSetAccessorTypeAnnotationNode(<AccessorDeclaration>node));
12092
12093
}
12093
12094
if (isFunctionLike(node)) {
12094
12095
return "Function";
@@ -12097,7 +12098,7 @@ module ts {
12097
12098
}
12098
12099
12099
12100
/** Serializes the parameter types of a function or the constructor of a class. Used by the __metadata decorator for a method or set accessor. */
12100
- function serializeParameterTypesOfNode(node: Node, getGeneratedNameForNode: (Node: Node) => string ): (string | string[])[] {
12101
+ function serializeParameterTypesOfNode(node: Node): (string | string[])[] {
12101
12102
// serialization of parameter types uses the following rules:
12102
12103
//
12103
12104
// * If the declaration is a class, the parameters of the first constructor with a body are used.
@@ -12130,10 +12131,10 @@ module ts {
12130
12131
else {
12131
12132
parameterType = undefined;
12132
12133
}
12133
- result[i] = serializeTypeNode(parameterType, getGeneratedNameForNode );
12134
+ result[i] = serializeTypeNode(parameterType);
12134
12135
}
12135
12136
else {
12136
- result[i] = serializeTypeOfNode(parameters[i], getGeneratedNameForNode );
12137
+ result[i] = serializeTypeOfNode(parameters[i]);
12137
12138
}
12138
12139
}
12139
12140
return result;
@@ -12144,9 +12145,9 @@ module ts {
12144
12145
}
12145
12146
12146
12147
/** Serializes the return type of function. Used by the __metadata decorator for a method. */
12147
- function serializeReturnTypeOfNode(node: Node, getGeneratedNameForNode: (Node: Node) => string ): string | string[] {
12148
+ function serializeReturnTypeOfNode(node: Node): string | string[] {
12148
12149
if (node && isFunctionLike(node)) {
12149
- return serializeTypeNode((<FunctionLikeDeclaration>node).type, getGeneratedNameForNode );
12150
+ return serializeTypeNode((<FunctionLikeDeclaration>node).type);
12150
12151
}
12151
12152
return "void 0";
12152
12153
}
0 commit comments