mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-08 12:55:49 -05:00
Revised emit for computed property names, including with decorators (#19430)
* Revised emit for computed property names * Fix downlevel name generation scopes * Accept slightly more conservative baseline * First feedback pass * Reduce number of nonrequired variable declarations and assignments * Remove side-effect-free identifier references * skip partially emitted expressions * Comments, move starsOnNewLine to emitNode * Put expressions on newlines when inlined in class expressions for consistency * Update new ref * Fix typo in comment
This commit is contained in:
@@ -2963,6 +2963,7 @@ namespace ts {
|
||||
|| hasModifier(node, ModifierFlags.TypeScriptModifier)
|
||||
|| node.typeParameters
|
||||
|| node.type
|
||||
|| (node.name && isComputedPropertyName(node.name)) // While computed method names aren't typescript, the TS transform must visit them to emit property declarations correctly
|
||||
|| !node.body) {
|
||||
transformFlags |= TransformFlags.AssertTypeScript;
|
||||
}
|
||||
@@ -2993,6 +2994,7 @@ namespace ts {
|
||||
if (node.decorators
|
||||
|| hasModifier(node, ModifierFlags.TypeScriptModifier)
|
||||
|| node.type
|
||||
|| (node.name && isComputedPropertyName(node.name)) // While computed accessor names aren't typescript, the TS transform must visit them to emit property declarations correctly
|
||||
|| !node.body) {
|
||||
transformFlags |= TransformFlags.AssertTypeScript;
|
||||
}
|
||||
|
||||
@@ -1733,26 +1733,15 @@ namespace ts {
|
||||
increaseIndent();
|
||||
}
|
||||
|
||||
if (getEmitFlags(node) & EmitFlags.ReuseTempVariableScope) {
|
||||
emitSignatureHead(node);
|
||||
if (onEmitNode) {
|
||||
onEmitNode(EmitHint.Unspecified, body, emitBlockCallback);
|
||||
}
|
||||
else {
|
||||
emitBlockFunctionBody(body);
|
||||
}
|
||||
pushNameGenerationScope(node);
|
||||
emitSignatureHead(node);
|
||||
if (onEmitNode) {
|
||||
onEmitNode(EmitHint.Unspecified, body, emitBlockCallback);
|
||||
}
|
||||
else {
|
||||
pushNameGenerationScope();
|
||||
emitSignatureHead(node);
|
||||
if (onEmitNode) {
|
||||
onEmitNode(EmitHint.Unspecified, body, emitBlockCallback);
|
||||
}
|
||||
else {
|
||||
emitBlockFunctionBody(body);
|
||||
}
|
||||
popNameGenerationScope();
|
||||
emitBlockFunctionBody(body);
|
||||
}
|
||||
popNameGenerationScope(node);
|
||||
|
||||
if (indentedFlag) {
|
||||
decreaseIndent();
|
||||
@@ -1871,11 +1860,9 @@ namespace ts {
|
||||
emitTypeParameters(node, node.typeParameters);
|
||||
emitList(node, node.heritageClauses, ListFormat.ClassHeritageClauses);
|
||||
|
||||
pushNameGenerationScope();
|
||||
write(" {");
|
||||
emitList(node, node.members, ListFormat.ClassMembers);
|
||||
write("}");
|
||||
popNameGenerationScope();
|
||||
|
||||
if (indentedFlag) {
|
||||
decreaseIndent();
|
||||
@@ -1909,11 +1896,9 @@ namespace ts {
|
||||
emitModifiers(node, node.modifiers);
|
||||
write("enum ");
|
||||
emit(node.name);
|
||||
pushNameGenerationScope();
|
||||
write(" {");
|
||||
emitList(node, node.members, ListFormat.EnumMembers);
|
||||
write("}");
|
||||
popNameGenerationScope();
|
||||
}
|
||||
|
||||
function emitModuleDeclaration(node: ModuleDeclaration) {
|
||||
@@ -1935,11 +1920,11 @@ namespace ts {
|
||||
}
|
||||
|
||||
function emitModuleBlock(node: ModuleBlock) {
|
||||
pushNameGenerationScope();
|
||||
pushNameGenerationScope(node);
|
||||
write("{");
|
||||
emitBlockStatements(node, /*forceSingleLine*/ isEmptyBlock(node));
|
||||
write("}");
|
||||
popNameGenerationScope();
|
||||
popNameGenerationScope(node);
|
||||
}
|
||||
|
||||
function emitCaseBlock(node: CaseBlock) {
|
||||
@@ -2284,11 +2269,11 @@ namespace ts {
|
||||
|
||||
function emitSourceFileWorker(node: SourceFile) {
|
||||
const statements = node.statements;
|
||||
pushNameGenerationScope();
|
||||
pushNameGenerationScope(node);
|
||||
emitHelpersIndirect(node);
|
||||
const index = findIndex(statements, statement => !isPrologueDirective(statement));
|
||||
emitList(node, statements, ListFormat.MultiLine, index === -1 ? statements.length : index);
|
||||
popNameGenerationScope();
|
||||
popNameGenerationScope(node);
|
||||
}
|
||||
|
||||
// Transformation nodes
|
||||
@@ -2751,7 +2736,7 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
else {
|
||||
return nextNode.startsOnNewLine;
|
||||
return getStartsOnNewLine(nextNode);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2782,7 +2767,7 @@ namespace ts {
|
||||
|
||||
function synthesizedNodeStartsOnNewLine(node: Node, format?: ListFormat) {
|
||||
if (nodeIsSynthesized(node)) {
|
||||
const startsOnNewLine = node.startsOnNewLine;
|
||||
const startsOnNewLine = getStartsOnNewLine(node);
|
||||
if (startsOnNewLine === undefined) {
|
||||
return (format & ListFormat.PreferNewLine) !== 0;
|
||||
}
|
||||
@@ -2799,7 +2784,7 @@ namespace ts {
|
||||
node2 = skipSynthesizedParentheses(node2);
|
||||
|
||||
// Always use a newline for synthesized code if the synthesizer desires it.
|
||||
if (node2.startsOnNewLine) {
|
||||
if (getStartsOnNewLine(node2)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -2858,7 +2843,10 @@ namespace ts {
|
||||
/**
|
||||
* Push a new name generation scope.
|
||||
*/
|
||||
function pushNameGenerationScope() {
|
||||
function pushNameGenerationScope(node: Node | undefined) {
|
||||
if (node && getEmitFlags(node) & EmitFlags.ReuseTempVariableScope) {
|
||||
return;
|
||||
}
|
||||
tempFlagsStack.push(tempFlags);
|
||||
tempFlags = 0;
|
||||
}
|
||||
@@ -2866,7 +2854,10 @@ namespace ts {
|
||||
/**
|
||||
* Pop the current name generation scope.
|
||||
*/
|
||||
function popNameGenerationScope() {
|
||||
function popNameGenerationScope(node: Node | undefined) {
|
||||
if (node && getEmitFlags(node) & EmitFlags.ReuseTempVariableScope) {
|
||||
return;
|
||||
}
|
||||
tempFlags = tempFlagsStack.pop();
|
||||
}
|
||||
|
||||
@@ -2877,8 +2868,17 @@ namespace ts {
|
||||
if (name.autoGenerateKind === GeneratedIdentifierKind.Node) {
|
||||
// Node names generate unique names based on their original node
|
||||
// and are cached based on that node's id.
|
||||
const node = getNodeForGeneratedName(name);
|
||||
return generateNameCached(node);
|
||||
if (name.skipNameGenerationScope) {
|
||||
const savedTempFlags = tempFlags;
|
||||
popNameGenerationScope(/*node*/ undefined);
|
||||
const result = generateNameCached(getNodeForGeneratedName(name));
|
||||
pushNameGenerationScope(/*node*/ undefined);
|
||||
tempFlags = savedTempFlags;
|
||||
return result;
|
||||
}
|
||||
else {
|
||||
return generateNameCached(getNodeForGeneratedName(name));
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Auto, Loop, and Unique names are cached based on their unique
|
||||
|
||||
@@ -13,9 +13,6 @@ namespace ts {
|
||||
if (updated !== original) {
|
||||
setOriginalNode(updated, original);
|
||||
setTextRange(updated, original);
|
||||
if (original.startsOnNewLine) {
|
||||
updated.startsOnNewLine = true;
|
||||
}
|
||||
aggregateTransformFlags(updated);
|
||||
}
|
||||
return updated;
|
||||
@@ -168,11 +165,14 @@ namespace ts {
|
||||
}
|
||||
|
||||
/** Create a unique name generated for a node. */
|
||||
export function getGeneratedNameForNode(node: Node): Identifier {
|
||||
export function getGeneratedNameForNode(node: Node): Identifier;
|
||||
/*@internal*/ export function getGeneratedNameForNode(node: Node, shouldSkipNameGenerationScope?: boolean): Identifier;
|
||||
export function getGeneratedNameForNode(node: Node, shouldSkipNameGenerationScope?: boolean): Identifier {
|
||||
const name = createIdentifier("");
|
||||
name.autoGenerateKind = GeneratedIdentifierKind.Node;
|
||||
name.autoGenerateId = nextAutoGenerateId;
|
||||
name.original = node;
|
||||
name.skipNameGenerationScope = !!shouldSkipNameGenerationScope;
|
||||
nextAutoGenerateId++;
|
||||
return name;
|
||||
}
|
||||
@@ -2683,6 +2683,24 @@ namespace ts {
|
||||
return node;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a custom text range to use when emitting comments.
|
||||
*/
|
||||
/*@internal*/
|
||||
export function getStartsOnNewLine(node: Node) {
|
||||
const emitNode = node.emitNode;
|
||||
return emitNode && emitNode.startsOnNewLine;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a custom text range to use when emitting comments.
|
||||
*/
|
||||
/*@internal*/
|
||||
export function setStartsOnNewLine<T extends Node>(node: T, newLine: boolean) {
|
||||
getOrCreateEmitNode(node).startsOnNewLine = newLine;
|
||||
return node;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a custom text range to use when emitting comments.
|
||||
*/
|
||||
@@ -2841,7 +2859,8 @@ namespace ts {
|
||||
sourceMapRange,
|
||||
tokenSourceMapRanges,
|
||||
constantValue,
|
||||
helpers
|
||||
helpers,
|
||||
startsOnNewLine,
|
||||
} = sourceEmitNode;
|
||||
if (!destEmitNode) destEmitNode = {};
|
||||
// We are using `.slice()` here in case `destEmitNode.leadingComments` is pushed to later.
|
||||
@@ -2853,6 +2872,7 @@ namespace ts {
|
||||
if (tokenSourceMapRanges) destEmitNode.tokenSourceMapRanges = mergeTokenSourceMapRanges(tokenSourceMapRanges, destEmitNode.tokenSourceMapRanges);
|
||||
if (constantValue !== undefined) destEmitNode.constantValue = constantValue;
|
||||
if (helpers) destEmitNode.helpers = addRange(destEmitNode.helpers, helpers);
|
||||
if (startsOnNewLine !== undefined) destEmitNode.startsOnNewLine = startsOnNewLine;
|
||||
return destEmitNode;
|
||||
}
|
||||
|
||||
@@ -3014,7 +3034,7 @@ namespace ts {
|
||||
|
||||
if (children.length > 1) {
|
||||
for (const child of children) {
|
||||
child.startsOnNewLine = true;
|
||||
startOnNewLine(child);
|
||||
argumentsList.push(child);
|
||||
}
|
||||
}
|
||||
@@ -3045,7 +3065,7 @@ namespace ts {
|
||||
if (children && children.length > 0) {
|
||||
if (children.length > 1) {
|
||||
for (const child of children) {
|
||||
child.startsOnNewLine = true;
|
||||
startOnNewLine(child);
|
||||
argumentsList.push(child);
|
||||
}
|
||||
}
|
||||
@@ -3620,8 +3640,8 @@ namespace ts {
|
||||
);
|
||||
setOriginalNode(updated, node);
|
||||
setTextRange(updated, node);
|
||||
if (node.startsOnNewLine) {
|
||||
updated.startsOnNewLine = true;
|
||||
if (getStartsOnNewLine(node)) {
|
||||
setStartsOnNewLine(updated, /*newLine*/ true);
|
||||
}
|
||||
aggregateTransformFlags(updated);
|
||||
return updated;
|
||||
@@ -4250,8 +4270,7 @@ namespace ts {
|
||||
}
|
||||
|
||||
export function startOnNewLine<T extends Node>(node: T): T {
|
||||
node.startsOnNewLine = true;
|
||||
return node;
|
||||
return setStartsOnNewLine(node, /*newLine*/ true);
|
||||
}
|
||||
|
||||
export function getExternalHelpersModuleName(node: SourceFile) {
|
||||
|
||||
@@ -787,9 +787,7 @@ namespace ts {
|
||||
// To preserve the behavior of the old emitter, we explicitly indent
|
||||
// the body of the function here if it was requested in an earlier
|
||||
// transformation.
|
||||
if (getEmitFlags(node) & EmitFlags.Indented) {
|
||||
setEmitFlags(classFunction, EmitFlags.Indented);
|
||||
}
|
||||
setEmitFlags(classFunction, (getEmitFlags(node) & EmitFlags.Indented) | EmitFlags.ReuseTempVariableScope);
|
||||
|
||||
// "inner" and "outer" below are added purely to preserve source map locations from
|
||||
// the old emitter
|
||||
@@ -1327,7 +1325,8 @@ namespace ts {
|
||||
EmitFlags.SingleLine | EmitFlags.NoTrailingSourceMap | EmitFlags.NoTokenSourceMaps
|
||||
)
|
||||
);
|
||||
statement.startsOnNewLine = true;
|
||||
|
||||
startOnNewLine(statement);
|
||||
setTextRange(statement, parameter);
|
||||
setEmitFlags(statement, EmitFlags.NoTokenSourceMaps | EmitFlags.NoTrailingSourceMap | EmitFlags.CustomPrologue);
|
||||
statements.push(statement);
|
||||
@@ -1683,7 +1682,7 @@ namespace ts {
|
||||
]
|
||||
);
|
||||
if (startsOnNewLine) {
|
||||
call.startsOnNewLine = true;
|
||||
startOnNewLine(call);
|
||||
}
|
||||
|
||||
exitSubtree(ancestorFacts, HierarchyFacts.PropagateNewTargetMask, hierarchyFacts & HierarchyFacts.PropagateNewTargetMask ? HierarchyFacts.NewTarget : HierarchyFacts.None);
|
||||
@@ -2602,7 +2601,7 @@ namespace ts {
|
||||
);
|
||||
|
||||
if (node.multiLine) {
|
||||
assignment.startsOnNewLine = true;
|
||||
startOnNewLine(assignment);
|
||||
}
|
||||
|
||||
expressions.push(assignment);
|
||||
@@ -3083,7 +3082,7 @@ namespace ts {
|
||||
);
|
||||
setTextRange(expression, property);
|
||||
if (startsOnNewLine) {
|
||||
expression.startsOnNewLine = true;
|
||||
startOnNewLine(expression);
|
||||
}
|
||||
return expression;
|
||||
}
|
||||
@@ -3105,7 +3104,7 @@ namespace ts {
|
||||
);
|
||||
setTextRange(expression, property);
|
||||
if (startsOnNewLine) {
|
||||
expression.startsOnNewLine = true;
|
||||
startOnNewLine(expression);
|
||||
}
|
||||
return expression;
|
||||
}
|
||||
@@ -3128,7 +3127,7 @@ namespace ts {
|
||||
);
|
||||
setTextRange(expression, method);
|
||||
if (startsOnNewLine) {
|
||||
expression.startsOnNewLine = true;
|
||||
startOnNewLine(expression);
|
||||
}
|
||||
exitSubtree(ancestorFacts, HierarchyFacts.PropagateNewTargetMask, hierarchyFacts & HierarchyFacts.PropagateNewTargetMask ? HierarchyFacts.NewTarget : HierarchyFacts.None);
|
||||
return expression;
|
||||
|
||||
@@ -1077,7 +1077,7 @@ namespace ts {
|
||||
const visited = visitNode(expression, visitor, isExpression);
|
||||
if (visited) {
|
||||
if (multiLine) {
|
||||
visited.startsOnNewLine = true;
|
||||
startOnNewLine(visited);
|
||||
}
|
||||
expressions.push(visited);
|
||||
}
|
||||
@@ -2683,8 +2683,7 @@ namespace ts {
|
||||
if (clauses) {
|
||||
const labelExpression = createPropertyAccess(state, "label");
|
||||
const switchStatement = createSwitch(labelExpression, createCaseBlock(clauses));
|
||||
switchStatement.startsOnNewLine = true;
|
||||
return [switchStatement];
|
||||
return [startOnNewLine(switchStatement)];
|
||||
}
|
||||
|
||||
if (statements) {
|
||||
|
||||
@@ -86,6 +86,12 @@ namespace ts {
|
||||
*/
|
||||
let applicableSubstitutions: TypeScriptSubstitutionFlags;
|
||||
|
||||
/**
|
||||
* Tracks what computed name expressions originating from elided names must be inlined
|
||||
* at the next execution site, in document order
|
||||
*/
|
||||
let pendingExpressions: Expression[] | undefined;
|
||||
|
||||
return transformSourceFile;
|
||||
|
||||
/**
|
||||
@@ -395,9 +401,11 @@ namespace ts {
|
||||
|
||||
case SyntaxKind.TypeAliasDeclaration:
|
||||
// TypeScript type-only declarations are elided.
|
||||
return undefined;
|
||||
|
||||
case SyntaxKind.PropertyDeclaration:
|
||||
// TypeScript property declarations are elided.
|
||||
// TypeScript property declarations are elided. However their names are still visited, and can potentially be retained if they could have sideeffects
|
||||
return visitPropertyDeclaration(node as PropertyDeclaration);
|
||||
|
||||
case SyntaxKind.NamespaceExportDeclaration:
|
||||
// TypeScript namespace export declarations are elided.
|
||||
@@ -584,6 +592,9 @@ namespace ts {
|
||||
* @param node The node to transform.
|
||||
*/
|
||||
function visitClassDeclaration(node: ClassDeclaration): VisitResult<Statement> {
|
||||
const savedPendingExpressions = pendingExpressions;
|
||||
pendingExpressions = undefined;
|
||||
|
||||
const staticProperties = getInitializedProperties(node, /*isStatic*/ true);
|
||||
const facts = getClassFacts(node, staticProperties);
|
||||
|
||||
@@ -598,6 +609,12 @@ namespace ts {
|
||||
|
||||
let statements: Statement[] = [classStatement];
|
||||
|
||||
// Write any pending expressions from elided or moved computed property names
|
||||
if (some(pendingExpressions)) {
|
||||
statements.push(createStatement(inlineExpressions(pendingExpressions)));
|
||||
}
|
||||
pendingExpressions = savedPendingExpressions;
|
||||
|
||||
// Emit static property assignment. Because classDeclaration is lexically evaluated,
|
||||
// it is safe to emit static property assignment after classDeclaration
|
||||
// From ES6 specification:
|
||||
@@ -856,6 +873,9 @@ namespace ts {
|
||||
* @param node The node to transform.
|
||||
*/
|
||||
function visitClassExpression(node: ClassExpression): Expression {
|
||||
const savedPendingExpressions = pendingExpressions;
|
||||
pendingExpressions = undefined;
|
||||
|
||||
const staticProperties = getInitializedProperties(node, /*isStatic*/ true);
|
||||
const heritageClauses = visitNodes(node.heritageClauses, visitor, isHeritageClause);
|
||||
const members = transformClassMembers(node, some(heritageClauses, c => c.token === SyntaxKind.ExtendsKeyword));
|
||||
@@ -871,7 +891,7 @@ namespace ts {
|
||||
setOriginalNode(classExpression, node);
|
||||
setTextRange(classExpression, node);
|
||||
|
||||
if (staticProperties.length > 0) {
|
||||
if (some(staticProperties) || some(pendingExpressions)) {
|
||||
const expressions: Expression[] = [];
|
||||
const temp = createTempVariable(hoistVariableDeclaration);
|
||||
if (resolver.getNodeCheckFlags(node) & NodeCheckFlags.ClassWithConstructorReference) {
|
||||
@@ -884,11 +904,15 @@ namespace ts {
|
||||
// the body of a class with static initializers.
|
||||
setEmitFlags(classExpression, EmitFlags.Indented | getEmitFlags(classExpression));
|
||||
expressions.push(startOnNewLine(createAssignment(temp, classExpression)));
|
||||
// Add any pending expressions leftover from elided or relocated computed property names
|
||||
addRange(expressions, map(pendingExpressions, startOnNewLine));
|
||||
pendingExpressions = savedPendingExpressions;
|
||||
addRange(expressions, generateInitializedPropertyExpressions(staticProperties, temp));
|
||||
expressions.push(startOnNewLine(temp));
|
||||
return inlineExpressions(expressions);
|
||||
}
|
||||
|
||||
pendingExpressions = savedPendingExpressions;
|
||||
return classExpression;
|
||||
}
|
||||
|
||||
@@ -1202,7 +1226,7 @@ namespace ts {
|
||||
const expressions: Expression[] = [];
|
||||
for (const property of properties) {
|
||||
const expression = transformInitializedProperty(property, receiver);
|
||||
expression.startsOnNewLine = true;
|
||||
startOnNewLine(expression);
|
||||
setSourceMapRange(expression, moveRangePastModifiers(property));
|
||||
setCommentRange(expression, property);
|
||||
expressions.push(expression);
|
||||
@@ -1218,7 +1242,10 @@ namespace ts {
|
||||
* @param receiver The object receiving the property assignment.
|
||||
*/
|
||||
function transformInitializedProperty(property: PropertyDeclaration, receiver: LeftHandSideExpression) {
|
||||
const propertyName = visitPropertyNameOfClassElement(property);
|
||||
// We generate a name here in order to reuse the value cached by the relocated computed name expression (which uses the same generated name)
|
||||
const propertyName = isComputedPropertyName(property.name) && !isSimpleInlineableExpression(property.name.expression)
|
||||
? updateComputedPropertyName(property.name, getGeneratedNameForNode(property.name, !hasModifier(property, ModifierFlags.Static)))
|
||||
: property.name;
|
||||
const initializer = visitNode(property.initializer, visitor, isExpression);
|
||||
const memberAccess = createMemberAccessForPropertyName(receiver, propertyName, /*location*/ propertyName);
|
||||
|
||||
@@ -2041,6 +2068,16 @@ namespace ts {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* A simple inlinable expression is an expression which can be copied into multiple locations
|
||||
* without risk of repeating any sideeffects and whose value could not possibly change between
|
||||
* any such locations
|
||||
*/
|
||||
function isSimpleInlineableExpression(expression: Expression) {
|
||||
return !isIdentifier(expression) && isSimpleCopiableExpression(expression) ||
|
||||
isWellKnownSymbolSyntactically(expression);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets an expression that represents a property name. For a computed property, a
|
||||
* name is generated for the node.
|
||||
@@ -2050,7 +2087,7 @@ namespace ts {
|
||||
function getExpressionForPropertyName(member: ClassElement | EnumMember, generateNameForComputedPropertyName: boolean): Expression {
|
||||
const name = member.name;
|
||||
if (isComputedPropertyName(name)) {
|
||||
return generateNameForComputedPropertyName
|
||||
return generateNameForComputedPropertyName && !isSimpleInlineableExpression((<ComputedPropertyName>name).expression)
|
||||
? getGeneratedNameForNode(name)
|
||||
: (<ComputedPropertyName>name).expression;
|
||||
}
|
||||
@@ -2062,6 +2099,26 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* If the name is a computed property, this function transforms it, then either returns an expression which caches the
|
||||
* value of the result or the expression itself if the value is either unused or safe to inline into multiple locations
|
||||
* @param shouldHoist Does the expression need to be reused? (ie, for an initializer or a decorator)
|
||||
* @param omitSimple Should expressions with no observable side-effects be elided? (ie, the expression is not hoisted for a decorator or initializer and is a literal)
|
||||
*/
|
||||
function getPropertyNameExpressionIfNeeded(name: PropertyName, shouldHoist: boolean, omitSimple: boolean): Expression {
|
||||
if (isComputedPropertyName(name)) {
|
||||
const expression = visitNode(name.expression, visitor, isExpression);
|
||||
const innerExpression = skipPartiallyEmittedExpressions(expression);
|
||||
const inlinable = isSimpleInlineableExpression(innerExpression);
|
||||
if (!inlinable && shouldHoist) {
|
||||
const generatedName = getGeneratedNameForNode(name);
|
||||
hoistVariableDeclaration(generatedName);
|
||||
return createAssignment(generatedName, expression);
|
||||
}
|
||||
return (omitSimple && (inlinable || isIdentifier(innerExpression))) ? undefined : expression;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Visits the property name of a class element, for use when emitting property
|
||||
* initializers. For a computed property on a node with decorators, a temporary
|
||||
@@ -2071,15 +2128,14 @@ namespace ts {
|
||||
*/
|
||||
function visitPropertyNameOfClassElement(member: ClassElement): PropertyName {
|
||||
const name = member.name;
|
||||
if (isComputedPropertyName(name)) {
|
||||
let expression = visitNode(name.expression, visitor, isExpression);
|
||||
if (member.decorators) {
|
||||
const generatedName = getGeneratedNameForNode(name);
|
||||
hoistVariableDeclaration(generatedName);
|
||||
expression = createAssignment(generatedName, expression);
|
||||
let expr = getPropertyNameExpressionIfNeeded(name, some(member.decorators), /*omitSimple*/ false);
|
||||
if (expr) { // expr only exists if `name` is a computed property name
|
||||
// Inline any pending expressions from previous elided or relocated computed property name expressions in order to preserve execution order
|
||||
if (some(pendingExpressions)) {
|
||||
expr = inlineExpressions([...pendingExpressions, expr]);
|
||||
pendingExpressions.length = 0;
|
||||
}
|
||||
|
||||
return updateComputedPropertyName(name, expression);
|
||||
return updateComputedPropertyName(name as ComputedPropertyName, expr);
|
||||
}
|
||||
else {
|
||||
return name;
|
||||
@@ -2136,6 +2192,14 @@ namespace ts {
|
||||
return !nodeIsMissing(node.body);
|
||||
}
|
||||
|
||||
function visitPropertyDeclaration(node: PropertyDeclaration): undefined {
|
||||
const expr = getPropertyNameExpressionIfNeeded(node.name, some(node.decorators) || !!node.initializer, /*omitSimple*/ true);
|
||||
if (expr && !isSimpleInlineableExpression(expr)) {
|
||||
(pendingExpressions || (pendingExpressions = [])).push(expr);
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
function visitConstructor(node: ConstructorDeclaration) {
|
||||
if (!shouldEmitFunctionLikeDeclaration(node)) {
|
||||
return undefined;
|
||||
@@ -2156,7 +2220,7 @@ namespace ts {
|
||||
* This function will be called when one of the following conditions are met:
|
||||
* - The node is an overload
|
||||
* - The node is marked as abstract, public, private, protected, or readonly
|
||||
* - The node has both a decorator and a computed property name
|
||||
* - The node has a computed property name
|
||||
*
|
||||
* @param node The method node.
|
||||
*/
|
||||
@@ -2200,7 +2264,7 @@ namespace ts {
|
||||
*
|
||||
* This function will be called when one of the following conditions are met:
|
||||
* - The node is marked as abstract, public, private, or protected
|
||||
* - The node has both a decorator and a computed property name
|
||||
* - The node has a computed property name
|
||||
*
|
||||
* @param node The get accessor node.
|
||||
*/
|
||||
@@ -2231,7 +2295,7 @@ namespace ts {
|
||||
*
|
||||
* This function will be called when one of the following conditions are met:
|
||||
* - The node is marked as abstract, public, private, or protected
|
||||
* - The node has both a decorator and a computed property name
|
||||
* - The node has a computed property name
|
||||
*
|
||||
* @param node The set accessor node.
|
||||
*/
|
||||
|
||||
@@ -520,7 +520,6 @@ namespace ts {
|
||||
/* @internal */ id?: number; // Unique id (used to look up NodeLinks)
|
||||
parent?: Node; // Parent node (initialized by binding)
|
||||
/* @internal */ original?: Node; // The original node if this is an updated node.
|
||||
/* @internal */ startsOnNewLine?: boolean; // Whether a synthesized node should start on a new line (used by transforms).
|
||||
/* @internal */ symbol?: Symbol; // Symbol declared by node (initialized by binding)
|
||||
/* @internal */ locals?: SymbolTable; // Locals associated with node (initialized by binding)
|
||||
/* @internal */ nextContainer?: Node; // Next container in declaration order (initialized by binding)
|
||||
@@ -630,6 +629,7 @@ namespace ts {
|
||||
isInJSDocNamespace?: boolean; // if the node is a member in a JSDoc namespace
|
||||
/*@internal*/ typeArguments?: NodeArray<TypeNode>; // Only defined on synthesized nodes. Though not syntactically valid, used in emitting diagnostics.
|
||||
/*@internal*/ jsdocDotPos?: number; // Identifier occurs in JSDoc-style generic: Id.<T>
|
||||
/*@internal*/ skipNameGenerationScope?: boolean; // Should skip a name generation scope when generating the name for this identifier
|
||||
}
|
||||
|
||||
// Transient identifier node (marked by id === -1)
|
||||
@@ -4330,6 +4330,7 @@ namespace ts {
|
||||
constantValue?: string | number; // The constant value of an expression
|
||||
externalHelpersModuleName?: Identifier; // The local name for an imported helpers module
|
||||
helpers?: EmitHelper[]; // Emit helpers for the node
|
||||
startsOnNewLine?: boolean; // If the node should begin on a new line
|
||||
}
|
||||
|
||||
export const enum EmitFlags {
|
||||
|
||||
@@ -19,11 +19,14 @@ function foo(y, x) {
|
||||
var _a;
|
||||
}
|
||||
function foo2(y, x) {
|
||||
if (y === void 0) { y = /** @class */ (function () {
|
||||
function class_2() {
|
||||
this[x] = x;
|
||||
}
|
||||
return class_2;
|
||||
}()); }
|
||||
if (y === void 0) { y = (_a = /** @class */ (function () {
|
||||
function class_2() {
|
||||
this[_b] = x;
|
||||
}
|
||||
return class_2;
|
||||
}()),
|
||||
_b = x,
|
||||
_a); }
|
||||
if (x === void 0) { x = 1; }
|
||||
var _b, _a;
|
||||
}
|
||||
|
||||
@@ -22,10 +22,12 @@ var n;
|
||||
var a;
|
||||
var C = /** @class */ (function () {
|
||||
function C() {
|
||||
this[n] = n;
|
||||
this[s + n] = 2;
|
||||
this[_a] = n;
|
||||
this[_b] = 2;
|
||||
this["hello bye"] = 0;
|
||||
}
|
||||
C["hello " + a + " bye"] = 0;
|
||||
_a = n, s + s, _b = s + n, +s, _c = "hello " + a + " bye";
|
||||
C[_c] = 0;
|
||||
return C;
|
||||
var _a, _b, _c;
|
||||
}());
|
||||
|
||||
@@ -22,9 +22,11 @@ var n;
|
||||
var a;
|
||||
class C {
|
||||
constructor() {
|
||||
this[n] = n;
|
||||
this[s + n] = 2;
|
||||
this[_a] = n;
|
||||
this[_b] = 2;
|
||||
this[`hello bye`] = 0;
|
||||
}
|
||||
}
|
||||
C[`hello ${a} bye`] = 0;
|
||||
_a = n, s + s, _b = s + n, +s, _c = `hello ${a} bye`;
|
||||
C[_c] = 0;
|
||||
var _a, _b, _c;
|
||||
|
||||
@@ -14,13 +14,12 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
class C {
|
||||
[_a = "1"]() { }
|
||||
[_b = "b"]() { }
|
||||
["1"]() { }
|
||||
["b"]() { }
|
||||
}
|
||||
__decorate([
|
||||
dec
|
||||
], C.prototype, _a, null);
|
||||
], C.prototype, "1", null);
|
||||
__decorate([
|
||||
dec
|
||||
], C.prototype, _b, null);
|
||||
var _a, _b;
|
||||
], C.prototype, "b", null);
|
||||
|
||||
@@ -13,9 +13,8 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
class C {
|
||||
[_a = "method"]() { }
|
||||
["method"]() { }
|
||||
}
|
||||
__decorate([
|
||||
dec
|
||||
], C.prototype, _a, null);
|
||||
var _a;
|
||||
], C.prototype, "method", null);
|
||||
|
||||
@@ -13,9 +13,8 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
class C {
|
||||
[_a = "method"]() { }
|
||||
["method"]() { }
|
||||
}
|
||||
__decorate([
|
||||
dec()
|
||||
], C.prototype, _a, null);
|
||||
var _a;
|
||||
], C.prototype, "method", null);
|
||||
|
||||
@@ -13,9 +13,8 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
class C {
|
||||
[_a = "method"]() { }
|
||||
["method"]() { }
|
||||
}
|
||||
__decorate([
|
||||
dec
|
||||
], C.prototype, _a, null);
|
||||
var _a;
|
||||
], C.prototype, "method", null);
|
||||
|
||||
@@ -13,9 +13,8 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
class C {
|
||||
[_a = "method"]() { }
|
||||
["method"]() { }
|
||||
}
|
||||
__decorate([
|
||||
dec
|
||||
], C.prototype, _a, null);
|
||||
var _a;
|
||||
], C.prototype, "method", null);
|
||||
|
||||
@@ -0,0 +1,435 @@
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(18,5): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(19,8): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(20,8): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(21,5): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(22,8): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(23,8): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(27,5): error TS1206: Decorators are not valid here.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(28,5): error TS1206: Decorators are not valid here.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(29,5): error TS1206: Decorators are not valid here.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(30,5): error TS1206: Decorators are not valid here.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(35,5): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(36,5): error TS1206: Decorators are not valid here.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(37,5): error TS1206: Decorators are not valid here.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(38,5): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(39,5): error TS1206: Decorators are not valid here.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(40,5): error TS1206: Decorators are not valid here.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(52,5): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(53,8): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(54,8): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(55,5): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(56,8): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(57,8): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(62,5): error TS1206: Decorators are not valid here.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(63,5): error TS1206: Decorators are not valid here.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(64,5): error TS1206: Decorators are not valid here.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(65,5): error TS1206: Decorators are not valid here.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(70,5): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(71,5): error TS1206: Decorators are not valid here.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(72,5): error TS1206: Decorators are not valid here.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(73,5): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(74,5): error TS1206: Decorators are not valid here.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(75,5): error TS1206: Decorators are not valid here.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(88,5): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(89,8): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(90,8): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(92,5): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(93,8): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(94,8): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(98,5): error TS1206: Decorators are not valid here.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(99,5): error TS1206: Decorators are not valid here.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(100,5): error TS1206: Decorators are not valid here.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(101,5): error TS1206: Decorators are not valid here.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(106,5): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(107,5): error TS1206: Decorators are not valid here.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(108,5): error TS1206: Decorators are not valid here.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(110,5): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(111,5): error TS1206: Decorators are not valid here.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(112,5): error TS1206: Decorators are not valid here.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(124,5): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(125,8): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(126,8): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(128,5): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(129,8): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(131,8): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(135,5): error TS1206: Decorators are not valid here.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(136,5): error TS1206: Decorators are not valid here.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(137,5): error TS1206: Decorators are not valid here.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(138,5): error TS1206: Decorators are not valid here.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(143,5): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(144,5): error TS1206: Decorators are not valid here.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(145,5): error TS1206: Decorators are not valid here.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(147,5): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(148,5): error TS1206: Decorators are not valid here.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(150,5): error TS1206: Decorators are not valid here.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(162,5): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(163,8): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(164,8): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(166,5): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(167,8): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(169,8): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(173,5): error TS1206: Decorators are not valid here.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(174,5): error TS1206: Decorators are not valid here.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(175,5): error TS1206: Decorators are not valid here.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(176,5): error TS1206: Decorators are not valid here.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(181,5): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(182,5): error TS1206: Decorators are not valid here.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(183,5): error TS1206: Decorators are not valid here.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(184,5): error TS1206: Decorators are not valid here.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(185,5): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(186,5): error TS1206: Decorators are not valid here.
|
||||
tests/cases/compiler/decoratorsOnComputedProperties.ts(188,5): error TS1206: Decorators are not valid here.
|
||||
|
||||
|
||||
==== tests/cases/compiler/decoratorsOnComputedProperties.ts (81 errors) ====
|
||||
function x(o: object, k: PropertyKey) { }
|
||||
let i = 0;
|
||||
function foo(): string { return ++i + ""; }
|
||||
|
||||
const fieldNameA: string = "fieldName1";
|
||||
const fieldNameB: string = "fieldName2";
|
||||
const fieldNameC: string = "fieldName3";
|
||||
|
||||
class A {
|
||||
@x ["property"]: any;
|
||||
@x [Symbol.toStringTag]: any;
|
||||
@x ["property2"]: any = 2;
|
||||
@x [Symbol.iterator]: any = null;
|
||||
["property3"]: any;
|
||||
[Symbol.isConcatSpreadable]: any;
|
||||
["property4"]: any = 2;
|
||||
[Symbol.match]: any = null;
|
||||
[foo()]: any;
|
||||
~~~~~~~
|
||||
!!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
@x [foo()]: any;
|
||||
~~~~~~~
|
||||
!!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
@x [foo()]: any = null;
|
||||
~~~~~~~
|
||||
!!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
[fieldNameA]: any;
|
||||
~~~~~~~~~~~~
|
||||
!!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
@x [fieldNameB]: any;
|
||||
~~~~~~~~~~~~
|
||||
!!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
@x [fieldNameC]: any = null;
|
||||
~~~~~~~~~~~~
|
||||
!!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
}
|
||||
|
||||
void class B {
|
||||
@x ["property"]: any;
|
||||
~
|
||||
!!! error TS1206: Decorators are not valid here.
|
||||
@x [Symbol.toStringTag]: any;
|
||||
~
|
||||
!!! error TS1206: Decorators are not valid here.
|
||||
@x ["property2"]: any = 2;
|
||||
~
|
||||
!!! error TS1206: Decorators are not valid here.
|
||||
@x [Symbol.iterator]: any = null;
|
||||
~
|
||||
!!! error TS1206: Decorators are not valid here.
|
||||
["property3"]: any;
|
||||
[Symbol.isConcatSpreadable]: any;
|
||||
["property4"]: any = 2;
|
||||
[Symbol.match]: any = null;
|
||||
[foo()]: any;
|
||||
~~~~~~~
|
||||
!!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
@x [foo()]: any;
|
||||
~
|
||||
!!! error TS1206: Decorators are not valid here.
|
||||
@x [foo()]: any = null;
|
||||
~
|
||||
!!! error TS1206: Decorators are not valid here.
|
||||
[fieldNameA]: any;
|
||||
~~~~~~~~~~~~
|
||||
!!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
@x [fieldNameB]: any;
|
||||
~
|
||||
!!! error TS1206: Decorators are not valid here.
|
||||
@x [fieldNameC]: any = null;
|
||||
~
|
||||
!!! error TS1206: Decorators are not valid here.
|
||||
};
|
||||
|
||||
class C {
|
||||
@x ["property"]: any;
|
||||
@x [Symbol.toStringTag]: any;
|
||||
@x ["property2"]: any = 2;
|
||||
@x [Symbol.iterator]: any = null;
|
||||
["property3"]: any;
|
||||
[Symbol.isConcatSpreadable]: any;
|
||||
["property4"]: any = 2;
|
||||
[Symbol.match]: any = null;
|
||||
[foo()]: any;
|
||||
~~~~~~~
|
||||
!!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
@x [foo()]: any;
|
||||
~~~~~~~
|
||||
!!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
@x [foo()]: any = null;
|
||||
~~~~~~~
|
||||
!!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
[fieldNameA]: any;
|
||||
~~~~~~~~~~~~
|
||||
!!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
@x [fieldNameB]: any;
|
||||
~~~~~~~~~~~~
|
||||
!!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
@x [fieldNameC]: any = null;
|
||||
~~~~~~~~~~~~
|
||||
!!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
["some" + "method"]() {}
|
||||
}
|
||||
|
||||
void class D {
|
||||
@x ["property"]: any;
|
||||
~
|
||||
!!! error TS1206: Decorators are not valid here.
|
||||
@x [Symbol.toStringTag]: any;
|
||||
~
|
||||
!!! error TS1206: Decorators are not valid here.
|
||||
@x ["property2"]: any = 2;
|
||||
~
|
||||
!!! error TS1206: Decorators are not valid here.
|
||||
@x [Symbol.iterator]: any = null;
|
||||
~
|
||||
!!! error TS1206: Decorators are not valid here.
|
||||
["property3"]: any;
|
||||
[Symbol.isConcatSpreadable]: any;
|
||||
["property4"]: any = 2;
|
||||
[Symbol.match]: any = null;
|
||||
[foo()]: any;
|
||||
~~~~~~~
|
||||
!!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
@x [foo()]: any;
|
||||
~
|
||||
!!! error TS1206: Decorators are not valid here.
|
||||
@x [foo()]: any = null;
|
||||
~
|
||||
!!! error TS1206: Decorators are not valid here.
|
||||
[fieldNameA]: any;
|
||||
~~~~~~~~~~~~
|
||||
!!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
@x [fieldNameB]: any;
|
||||
~
|
||||
!!! error TS1206: Decorators are not valid here.
|
||||
@x [fieldNameC]: any = null;
|
||||
~
|
||||
!!! error TS1206: Decorators are not valid here.
|
||||
["some" + "method"]() {}
|
||||
};
|
||||
|
||||
class E {
|
||||
@x ["property"]: any;
|
||||
@x [Symbol.toStringTag]: any;
|
||||
@x ["property2"]: any = 2;
|
||||
@x [Symbol.iterator]: any = null;
|
||||
["property3"]: any;
|
||||
[Symbol.isConcatSpreadable]: any;
|
||||
["property4"]: any = 2;
|
||||
[Symbol.match]: any = null;
|
||||
[foo()]: any;
|
||||
~~~~~~~
|
||||
!!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
@x [foo()]: any;
|
||||
~~~~~~~
|
||||
!!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
@x [foo()]: any = null;
|
||||
~~~~~~~
|
||||
!!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
["some" + "method"]() {}
|
||||
[fieldNameA]: any;
|
||||
~~~~~~~~~~~~
|
||||
!!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
@x [fieldNameB]: any;
|
||||
~~~~~~~~~~~~
|
||||
!!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
@x [fieldNameC]: any = null;
|
||||
~~~~~~~~~~~~
|
||||
!!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
}
|
||||
|
||||
void class F {
|
||||
@x ["property"]: any;
|
||||
~
|
||||
!!! error TS1206: Decorators are not valid here.
|
||||
@x [Symbol.toStringTag]: any;
|
||||
~
|
||||
!!! error TS1206: Decorators are not valid here.
|
||||
@x ["property2"]: any = 2;
|
||||
~
|
||||
!!! error TS1206: Decorators are not valid here.
|
||||
@x [Symbol.iterator]: any = null;
|
||||
~
|
||||
!!! error TS1206: Decorators are not valid here.
|
||||
["property3"]: any;
|
||||
[Symbol.isConcatSpreadable]: any;
|
||||
["property4"]: any = 2;
|
||||
[Symbol.match]: any = null;
|
||||
[foo()]: any;
|
||||
~~~~~~~
|
||||
!!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
@x [foo()]: any;
|
||||
~
|
||||
!!! error TS1206: Decorators are not valid here.
|
||||
@x [foo()]: any = null;
|
||||
~
|
||||
!!! error TS1206: Decorators are not valid here.
|
||||
["some" + "method"]() {}
|
||||
[fieldNameA]: any;
|
||||
~~~~~~~~~~~~
|
||||
!!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
@x [fieldNameB]: any;
|
||||
~
|
||||
!!! error TS1206: Decorators are not valid here.
|
||||
@x [fieldNameC]: any = null;
|
||||
~
|
||||
!!! error TS1206: Decorators are not valid here.
|
||||
};
|
||||
|
||||
class G {
|
||||
@x ["property"]: any;
|
||||
@x [Symbol.toStringTag]: any;
|
||||
@x ["property2"]: any = 2;
|
||||
@x [Symbol.iterator]: any = null;
|
||||
["property3"]: any;
|
||||
[Symbol.isConcatSpreadable]: any;
|
||||
["property4"]: any = 2;
|
||||
[Symbol.match]: any = null;
|
||||
[foo()]: any;
|
||||
~~~~~~~
|
||||
!!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
@x [foo()]: any;
|
||||
~~~~~~~
|
||||
!!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
@x [foo()]: any = null;
|
||||
~~~~~~~
|
||||
!!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
["some" + "method"]() {}
|
||||
[fieldNameA]: any;
|
||||
~~~~~~~~~~~~
|
||||
!!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
@x [fieldNameB]: any;
|
||||
~~~~~~~~~~~~
|
||||
!!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
["some" + "method2"]() {}
|
||||
@x [fieldNameC]: any = null;
|
||||
~~~~~~~~~~~~
|
||||
!!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
}
|
||||
|
||||
void class H {
|
||||
@x ["property"]: any;
|
||||
~
|
||||
!!! error TS1206: Decorators are not valid here.
|
||||
@x [Symbol.toStringTag]: any;
|
||||
~
|
||||
!!! error TS1206: Decorators are not valid here.
|
||||
@x ["property2"]: any = 2;
|
||||
~
|
||||
!!! error TS1206: Decorators are not valid here.
|
||||
@x [Symbol.iterator]: any = null;
|
||||
~
|
||||
!!! error TS1206: Decorators are not valid here.
|
||||
["property3"]: any;
|
||||
[Symbol.isConcatSpreadable]: any;
|
||||
["property4"]: any = 2;
|
||||
[Symbol.match]: any = null;
|
||||
[foo()]: any;
|
||||
~~~~~~~
|
||||
!!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
@x [foo()]: any;
|
||||
~
|
||||
!!! error TS1206: Decorators are not valid here.
|
||||
@x [foo()]: any = null;
|
||||
~
|
||||
!!! error TS1206: Decorators are not valid here.
|
||||
["some" + "method"]() {}
|
||||
[fieldNameA]: any;
|
||||
~~~~~~~~~~~~
|
||||
!!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
@x [fieldNameB]: any;
|
||||
~
|
||||
!!! error TS1206: Decorators are not valid here.
|
||||
["some" + "method2"]() {}
|
||||
@x [fieldNameC]: any = null;
|
||||
~
|
||||
!!! error TS1206: Decorators are not valid here.
|
||||
};
|
||||
|
||||
class I {
|
||||
@x ["property"]: any;
|
||||
@x [Symbol.toStringTag]: any;
|
||||
@x ["property2"]: any = 2;
|
||||
@x [Symbol.iterator]: any = null;
|
||||
["property3"]: any;
|
||||
[Symbol.isConcatSpreadable]: any;
|
||||
["property4"]: any = 2;
|
||||
[Symbol.match]: any = null;
|
||||
[foo()]: any;
|
||||
~~~~~~~
|
||||
!!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
@x [foo()]: any;
|
||||
~~~~~~~
|
||||
!!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
@x [foo()]: any = null;
|
||||
~~~~~~~
|
||||
!!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
@x ["some" + "method"]() {}
|
||||
[fieldNameA]: any;
|
||||
~~~~~~~~~~~~
|
||||
!!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
@x [fieldNameB]: any;
|
||||
~~~~~~~~~~~~
|
||||
!!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
["some" + "method2"]() {}
|
||||
@x [fieldNameC]: any = null;
|
||||
~~~~~~~~~~~~
|
||||
!!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
}
|
||||
|
||||
void class J {
|
||||
@x ["property"]: any;
|
||||
~
|
||||
!!! error TS1206: Decorators are not valid here.
|
||||
@x [Symbol.toStringTag]: any;
|
||||
~
|
||||
!!! error TS1206: Decorators are not valid here.
|
||||
@x ["property2"]: any = 2;
|
||||
~
|
||||
!!! error TS1206: Decorators are not valid here.
|
||||
@x [Symbol.iterator]: any = null;
|
||||
~
|
||||
!!! error TS1206: Decorators are not valid here.
|
||||
["property3"]: any;
|
||||
[Symbol.isConcatSpreadable]: any;
|
||||
["property4"]: any = 2;
|
||||
[Symbol.match]: any = null;
|
||||
[foo()]: any;
|
||||
~~~~~~~
|
||||
!!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
@x [foo()]: any;
|
||||
~
|
||||
!!! error TS1206: Decorators are not valid here.
|
||||
@x [foo()]: any = null;
|
||||
~
|
||||
!!! error TS1206: Decorators are not valid here.
|
||||
@x ["some" + "method"]() {}
|
||||
~
|
||||
!!! error TS1206: Decorators are not valid here.
|
||||
[fieldNameA]: any;
|
||||
~~~~~~~~~~~~
|
||||
!!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
|
||||
@x [fieldNameB]: any;
|
||||
~
|
||||
!!! error TS1206: Decorators are not valid here.
|
||||
["some" + "method2"]() {}
|
||||
@x [fieldNameC]: any = null;
|
||||
~
|
||||
!!! error TS1206: Decorators are not valid here.
|
||||
};
|
||||
457
tests/baselines/reference/decoratorsOnComputedProperties.js
Normal file
457
tests/baselines/reference/decoratorsOnComputedProperties.js
Normal file
@@ -0,0 +1,457 @@
|
||||
//// [decoratorsOnComputedProperties.ts]
|
||||
function x(o: object, k: PropertyKey) { }
|
||||
let i = 0;
|
||||
function foo(): string { return ++i + ""; }
|
||||
|
||||
const fieldNameA: string = "fieldName1";
|
||||
const fieldNameB: string = "fieldName2";
|
||||
const fieldNameC: string = "fieldName3";
|
||||
|
||||
class A {
|
||||
@x ["property"]: any;
|
||||
@x [Symbol.toStringTag]: any;
|
||||
@x ["property2"]: any = 2;
|
||||
@x [Symbol.iterator]: any = null;
|
||||
["property3"]: any;
|
||||
[Symbol.isConcatSpreadable]: any;
|
||||
["property4"]: any = 2;
|
||||
[Symbol.match]: any = null;
|
||||
[foo()]: any;
|
||||
@x [foo()]: any;
|
||||
@x [foo()]: any = null;
|
||||
[fieldNameA]: any;
|
||||
@x [fieldNameB]: any;
|
||||
@x [fieldNameC]: any = null;
|
||||
}
|
||||
|
||||
void class B {
|
||||
@x ["property"]: any;
|
||||
@x [Symbol.toStringTag]: any;
|
||||
@x ["property2"]: any = 2;
|
||||
@x [Symbol.iterator]: any = null;
|
||||
["property3"]: any;
|
||||
[Symbol.isConcatSpreadable]: any;
|
||||
["property4"]: any = 2;
|
||||
[Symbol.match]: any = null;
|
||||
[foo()]: any;
|
||||
@x [foo()]: any;
|
||||
@x [foo()]: any = null;
|
||||
[fieldNameA]: any;
|
||||
@x [fieldNameB]: any;
|
||||
@x [fieldNameC]: any = null;
|
||||
};
|
||||
|
||||
class C {
|
||||
@x ["property"]: any;
|
||||
@x [Symbol.toStringTag]: any;
|
||||
@x ["property2"]: any = 2;
|
||||
@x [Symbol.iterator]: any = null;
|
||||
["property3"]: any;
|
||||
[Symbol.isConcatSpreadable]: any;
|
||||
["property4"]: any = 2;
|
||||
[Symbol.match]: any = null;
|
||||
[foo()]: any;
|
||||
@x [foo()]: any;
|
||||
@x [foo()]: any = null;
|
||||
[fieldNameA]: any;
|
||||
@x [fieldNameB]: any;
|
||||
@x [fieldNameC]: any = null;
|
||||
["some" + "method"]() {}
|
||||
}
|
||||
|
||||
void class D {
|
||||
@x ["property"]: any;
|
||||
@x [Symbol.toStringTag]: any;
|
||||
@x ["property2"]: any = 2;
|
||||
@x [Symbol.iterator]: any = null;
|
||||
["property3"]: any;
|
||||
[Symbol.isConcatSpreadable]: any;
|
||||
["property4"]: any = 2;
|
||||
[Symbol.match]: any = null;
|
||||
[foo()]: any;
|
||||
@x [foo()]: any;
|
||||
@x [foo()]: any = null;
|
||||
[fieldNameA]: any;
|
||||
@x [fieldNameB]: any;
|
||||
@x [fieldNameC]: any = null;
|
||||
["some" + "method"]() {}
|
||||
};
|
||||
|
||||
class E {
|
||||
@x ["property"]: any;
|
||||
@x [Symbol.toStringTag]: any;
|
||||
@x ["property2"]: any = 2;
|
||||
@x [Symbol.iterator]: any = null;
|
||||
["property3"]: any;
|
||||
[Symbol.isConcatSpreadable]: any;
|
||||
["property4"]: any = 2;
|
||||
[Symbol.match]: any = null;
|
||||
[foo()]: any;
|
||||
@x [foo()]: any;
|
||||
@x [foo()]: any = null;
|
||||
["some" + "method"]() {}
|
||||
[fieldNameA]: any;
|
||||
@x [fieldNameB]: any;
|
||||
@x [fieldNameC]: any = null;
|
||||
}
|
||||
|
||||
void class F {
|
||||
@x ["property"]: any;
|
||||
@x [Symbol.toStringTag]: any;
|
||||
@x ["property2"]: any = 2;
|
||||
@x [Symbol.iterator]: any = null;
|
||||
["property3"]: any;
|
||||
[Symbol.isConcatSpreadable]: any;
|
||||
["property4"]: any = 2;
|
||||
[Symbol.match]: any = null;
|
||||
[foo()]: any;
|
||||
@x [foo()]: any;
|
||||
@x [foo()]: any = null;
|
||||
["some" + "method"]() {}
|
||||
[fieldNameA]: any;
|
||||
@x [fieldNameB]: any;
|
||||
@x [fieldNameC]: any = null;
|
||||
};
|
||||
|
||||
class G {
|
||||
@x ["property"]: any;
|
||||
@x [Symbol.toStringTag]: any;
|
||||
@x ["property2"]: any = 2;
|
||||
@x [Symbol.iterator]: any = null;
|
||||
["property3"]: any;
|
||||
[Symbol.isConcatSpreadable]: any;
|
||||
["property4"]: any = 2;
|
||||
[Symbol.match]: any = null;
|
||||
[foo()]: any;
|
||||
@x [foo()]: any;
|
||||
@x [foo()]: any = null;
|
||||
["some" + "method"]() {}
|
||||
[fieldNameA]: any;
|
||||
@x [fieldNameB]: any;
|
||||
["some" + "method2"]() {}
|
||||
@x [fieldNameC]: any = null;
|
||||
}
|
||||
|
||||
void class H {
|
||||
@x ["property"]: any;
|
||||
@x [Symbol.toStringTag]: any;
|
||||
@x ["property2"]: any = 2;
|
||||
@x [Symbol.iterator]: any = null;
|
||||
["property3"]: any;
|
||||
[Symbol.isConcatSpreadable]: any;
|
||||
["property4"]: any = 2;
|
||||
[Symbol.match]: any = null;
|
||||
[foo()]: any;
|
||||
@x [foo()]: any;
|
||||
@x [foo()]: any = null;
|
||||
["some" + "method"]() {}
|
||||
[fieldNameA]: any;
|
||||
@x [fieldNameB]: any;
|
||||
["some" + "method2"]() {}
|
||||
@x [fieldNameC]: any = null;
|
||||
};
|
||||
|
||||
class I {
|
||||
@x ["property"]: any;
|
||||
@x [Symbol.toStringTag]: any;
|
||||
@x ["property2"]: any = 2;
|
||||
@x [Symbol.iterator]: any = null;
|
||||
["property3"]: any;
|
||||
[Symbol.isConcatSpreadable]: any;
|
||||
["property4"]: any = 2;
|
||||
[Symbol.match]: any = null;
|
||||
[foo()]: any;
|
||||
@x [foo()]: any;
|
||||
@x [foo()]: any = null;
|
||||
@x ["some" + "method"]() {}
|
||||
[fieldNameA]: any;
|
||||
@x [fieldNameB]: any;
|
||||
["some" + "method2"]() {}
|
||||
@x [fieldNameC]: any = null;
|
||||
}
|
||||
|
||||
void class J {
|
||||
@x ["property"]: any;
|
||||
@x [Symbol.toStringTag]: any;
|
||||
@x ["property2"]: any = 2;
|
||||
@x [Symbol.iterator]: any = null;
|
||||
["property3"]: any;
|
||||
[Symbol.isConcatSpreadable]: any;
|
||||
["property4"]: any = 2;
|
||||
[Symbol.match]: any = null;
|
||||
[foo()]: any;
|
||||
@x [foo()]: any;
|
||||
@x [foo()]: any = null;
|
||||
@x ["some" + "method"]() {}
|
||||
[fieldNameA]: any;
|
||||
@x [fieldNameB]: any;
|
||||
["some" + "method2"]() {}
|
||||
@x [fieldNameC]: any = null;
|
||||
};
|
||||
|
||||
//// [decoratorsOnComputedProperties.js]
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
function x(o, k) { }
|
||||
let i = 0;
|
||||
function foo() { return ++i + ""; }
|
||||
const fieldNameA = "fieldName1";
|
||||
const fieldNameB = "fieldName2";
|
||||
const fieldNameC = "fieldName3";
|
||||
class A {
|
||||
constructor() {
|
||||
this["property2"] = 2;
|
||||
this[Symbol.iterator] = null;
|
||||
this["property4"] = 2;
|
||||
this[Symbol.match] = null;
|
||||
this[_a] = null;
|
||||
this[_b] = null;
|
||||
}
|
||||
}
|
||||
foo(), _c = foo(), _a = foo(), _d = fieldNameB, _b = fieldNameC;
|
||||
__decorate([
|
||||
x
|
||||
], A.prototype, "property", void 0);
|
||||
__decorate([
|
||||
x
|
||||
], A.prototype, Symbol.toStringTag, void 0);
|
||||
__decorate([
|
||||
x
|
||||
], A.prototype, "property2", void 0);
|
||||
__decorate([
|
||||
x
|
||||
], A.prototype, Symbol.iterator, void 0);
|
||||
__decorate([
|
||||
x
|
||||
], A.prototype, _c, void 0);
|
||||
__decorate([
|
||||
x
|
||||
], A.prototype, _a, void 0);
|
||||
__decorate([
|
||||
x
|
||||
], A.prototype, _d, void 0);
|
||||
__decorate([
|
||||
x
|
||||
], A.prototype, _b, void 0);
|
||||
void (_e = class B {
|
||||
constructor() {
|
||||
this["property2"] = 2;
|
||||
this[Symbol.iterator] = null;
|
||||
this["property4"] = 2;
|
||||
this[Symbol.match] = null;
|
||||
this[_f] = null;
|
||||
this[_g] = null;
|
||||
}
|
||||
},
|
||||
foo(),
|
||||
_h = foo(),
|
||||
_f = foo(),
|
||||
_j = fieldNameB,
|
||||
_g = fieldNameC,
|
||||
_e);
|
||||
class C {
|
||||
constructor() {
|
||||
this["property2"] = 2;
|
||||
this[Symbol.iterator] = null;
|
||||
this["property4"] = 2;
|
||||
this[Symbol.match] = null;
|
||||
this[_k] = null;
|
||||
this[_l] = null;
|
||||
}
|
||||
[foo(), _m = foo(), _k = foo(), _o = fieldNameB, _l = fieldNameC, "some" + "method"]() { }
|
||||
}
|
||||
__decorate([
|
||||
x
|
||||
], C.prototype, "property", void 0);
|
||||
__decorate([
|
||||
x
|
||||
], C.prototype, Symbol.toStringTag, void 0);
|
||||
__decorate([
|
||||
x
|
||||
], C.prototype, "property2", void 0);
|
||||
__decorate([
|
||||
x
|
||||
], C.prototype, Symbol.iterator, void 0);
|
||||
__decorate([
|
||||
x
|
||||
], C.prototype, _m, void 0);
|
||||
__decorate([
|
||||
x
|
||||
], C.prototype, _k, void 0);
|
||||
__decorate([
|
||||
x
|
||||
], C.prototype, _o, void 0);
|
||||
__decorate([
|
||||
x
|
||||
], C.prototype, _l, void 0);
|
||||
void class D {
|
||||
constructor() {
|
||||
this["property2"] = 2;
|
||||
this[Symbol.iterator] = null;
|
||||
this["property4"] = 2;
|
||||
this[Symbol.match] = null;
|
||||
this[_p] = null;
|
||||
this[_q] = null;
|
||||
}
|
||||
[foo(), _r = foo(), _p = foo(), _s = fieldNameB, _q = fieldNameC, "some" + "method"]() { }
|
||||
};
|
||||
class E {
|
||||
constructor() {
|
||||
this["property2"] = 2;
|
||||
this[Symbol.iterator] = null;
|
||||
this["property4"] = 2;
|
||||
this[Symbol.match] = null;
|
||||
this[_t] = null;
|
||||
this[_u] = null;
|
||||
}
|
||||
[foo(), _v = foo(), _t = foo(), "some" + "method"]() { }
|
||||
}
|
||||
_w = fieldNameB, _u = fieldNameC;
|
||||
__decorate([
|
||||
x
|
||||
], E.prototype, "property", void 0);
|
||||
__decorate([
|
||||
x
|
||||
], E.prototype, Symbol.toStringTag, void 0);
|
||||
__decorate([
|
||||
x
|
||||
], E.prototype, "property2", void 0);
|
||||
__decorate([
|
||||
x
|
||||
], E.prototype, Symbol.iterator, void 0);
|
||||
__decorate([
|
||||
x
|
||||
], E.prototype, _v, void 0);
|
||||
__decorate([
|
||||
x
|
||||
], E.prototype, _t, void 0);
|
||||
__decorate([
|
||||
x
|
||||
], E.prototype, _w, void 0);
|
||||
__decorate([
|
||||
x
|
||||
], E.prototype, _u, void 0);
|
||||
void (_x = class F {
|
||||
constructor() {
|
||||
this["property2"] = 2;
|
||||
this[Symbol.iterator] = null;
|
||||
this["property4"] = 2;
|
||||
this[Symbol.match] = null;
|
||||
this[_y] = null;
|
||||
this[_z] = null;
|
||||
}
|
||||
[foo(), _0 = foo(), _y = foo(), "some" + "method"]() { }
|
||||
},
|
||||
_1 = fieldNameB,
|
||||
_z = fieldNameC,
|
||||
_x);
|
||||
class G {
|
||||
constructor() {
|
||||
this["property2"] = 2;
|
||||
this[Symbol.iterator] = null;
|
||||
this["property4"] = 2;
|
||||
this[Symbol.match] = null;
|
||||
this[_2] = null;
|
||||
this[_3] = null;
|
||||
}
|
||||
[foo(), _4 = foo(), _2 = foo(), "some" + "method"]() { }
|
||||
[_5 = fieldNameB, "some" + "method2"]() { }
|
||||
}
|
||||
_3 = fieldNameC;
|
||||
__decorate([
|
||||
x
|
||||
], G.prototype, "property", void 0);
|
||||
__decorate([
|
||||
x
|
||||
], G.prototype, Symbol.toStringTag, void 0);
|
||||
__decorate([
|
||||
x
|
||||
], G.prototype, "property2", void 0);
|
||||
__decorate([
|
||||
x
|
||||
], G.prototype, Symbol.iterator, void 0);
|
||||
__decorate([
|
||||
x
|
||||
], G.prototype, _4, void 0);
|
||||
__decorate([
|
||||
x
|
||||
], G.prototype, _2, void 0);
|
||||
__decorate([
|
||||
x
|
||||
], G.prototype, _5, void 0);
|
||||
__decorate([
|
||||
x
|
||||
], G.prototype, _3, void 0);
|
||||
void (_6 = class H {
|
||||
constructor() {
|
||||
this["property2"] = 2;
|
||||
this[Symbol.iterator] = null;
|
||||
this["property4"] = 2;
|
||||
this[Symbol.match] = null;
|
||||
this[_7] = null;
|
||||
this[_8] = null;
|
||||
}
|
||||
[foo(), _9 = foo(), _7 = foo(), "some" + "method"]() { }
|
||||
[_10 = fieldNameB, "some" + "method2"]() { }
|
||||
},
|
||||
_8 = fieldNameC,
|
||||
_6);
|
||||
class I {
|
||||
constructor() {
|
||||
this["property2"] = 2;
|
||||
this[Symbol.iterator] = null;
|
||||
this["property4"] = 2;
|
||||
this[Symbol.match] = null;
|
||||
this[_11] = null;
|
||||
this[_12] = null;
|
||||
}
|
||||
[foo(), _13 = foo(), _11 = foo(), _14 = "some" + "method"]() { }
|
||||
[_15 = fieldNameB, "some" + "method2"]() { }
|
||||
}
|
||||
_12 = fieldNameC;
|
||||
__decorate([
|
||||
x
|
||||
], I.prototype, "property", void 0);
|
||||
__decorate([
|
||||
x
|
||||
], I.prototype, Symbol.toStringTag, void 0);
|
||||
__decorate([
|
||||
x
|
||||
], I.prototype, "property2", void 0);
|
||||
__decorate([
|
||||
x
|
||||
], I.prototype, Symbol.iterator, void 0);
|
||||
__decorate([
|
||||
x
|
||||
], I.prototype, _13, void 0);
|
||||
__decorate([
|
||||
x
|
||||
], I.prototype, _11, void 0);
|
||||
__decorate([
|
||||
x
|
||||
], I.prototype, _14, null);
|
||||
__decorate([
|
||||
x
|
||||
], I.prototype, _15, void 0);
|
||||
__decorate([
|
||||
x
|
||||
], I.prototype, _12, void 0);
|
||||
void (_16 = class J {
|
||||
constructor() {
|
||||
this["property2"] = 2;
|
||||
this[Symbol.iterator] = null;
|
||||
this["property4"] = 2;
|
||||
this[Symbol.match] = null;
|
||||
this[_17] = null;
|
||||
this[_18] = null;
|
||||
}
|
||||
[foo(), _19 = foo(), _17 = foo(), _20 = "some" + "method"]() { }
|
||||
[_21 = fieldNameB, "some" + "method2"]() { }
|
||||
},
|
||||
_18 = fieldNameC,
|
||||
_16);
|
||||
var _c, _a, _d, _b, _h, _f, _j, _g, _e, _m, _k, _o, _l, _r, _p, _s, _q, _v, _t, _w, _u, _0, _y, _1, _z, _x, _4, _2, _5, _3, _9, _7, _10, _8, _6, _13, _11, _14, _15, _12, _19, _17, _20, _21, _18, _16;
|
||||
664
tests/baselines/reference/decoratorsOnComputedProperties.symbols
Normal file
664
tests/baselines/reference/decoratorsOnComputedProperties.symbols
Normal file
@@ -0,0 +1,664 @@
|
||||
=== tests/cases/compiler/decoratorsOnComputedProperties.ts ===
|
||||
function x(o: object, k: PropertyKey) { }
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>o : Symbol(o, Decl(decoratorsOnComputedProperties.ts, 0, 11))
|
||||
>k : Symbol(k, Decl(decoratorsOnComputedProperties.ts, 0, 21))
|
||||
>PropertyKey : Symbol(PropertyKey, Decl(lib.es2015.core.d.ts, --, --))
|
||||
|
||||
let i = 0;
|
||||
>i : Symbol(i, Decl(decoratorsOnComputedProperties.ts, 1, 3))
|
||||
|
||||
function foo(): string { return ++i + ""; }
|
||||
>foo : Symbol(foo, Decl(decoratorsOnComputedProperties.ts, 1, 10))
|
||||
>i : Symbol(i, Decl(decoratorsOnComputedProperties.ts, 1, 3))
|
||||
|
||||
const fieldNameA: string = "fieldName1";
|
||||
>fieldNameA : Symbol(fieldNameA, Decl(decoratorsOnComputedProperties.ts, 4, 5))
|
||||
|
||||
const fieldNameB: string = "fieldName2";
|
||||
>fieldNameB : Symbol(fieldNameB, Decl(decoratorsOnComputedProperties.ts, 5, 5))
|
||||
|
||||
const fieldNameC: string = "fieldName3";
|
||||
>fieldNameC : Symbol(fieldNameC, Decl(decoratorsOnComputedProperties.ts, 6, 5))
|
||||
|
||||
class A {
|
||||
>A : Symbol(A, Decl(decoratorsOnComputedProperties.ts, 6, 40))
|
||||
|
||||
@x ["property"]: any;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>"property" : Symbol(A[["property"]], Decl(decoratorsOnComputedProperties.ts, 8, 9))
|
||||
|
||||
@x [Symbol.toStringTag]: any;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
|
||||
>Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --))
|
||||
>toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
|
||||
|
||||
@x ["property2"]: any = 2;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>"property2" : Symbol(A[["property2"]], Decl(decoratorsOnComputedProperties.ts, 10, 33))
|
||||
|
||||
@x [Symbol.iterator]: any = null;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --))
|
||||
>Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --))
|
||||
>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --))
|
||||
|
||||
["property3"]: any;
|
||||
>"property3" : Symbol(A[["property3"]], Decl(decoratorsOnComputedProperties.ts, 12, 37))
|
||||
|
||||
[Symbol.isConcatSpreadable]: any;
|
||||
>Symbol.isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
|
||||
>Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --))
|
||||
>isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
|
||||
|
||||
["property4"]: any = 2;
|
||||
>"property4" : Symbol(A[["property4"]], Decl(decoratorsOnComputedProperties.ts, 14, 37))
|
||||
|
||||
[Symbol.match]: any = null;
|
||||
>Symbol.match : Symbol(SymbolConstructor.match, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
|
||||
>Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --))
|
||||
>match : Symbol(SymbolConstructor.match, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
|
||||
|
||||
[foo()]: any;
|
||||
>foo : Symbol(foo, Decl(decoratorsOnComputedProperties.ts, 1, 10))
|
||||
|
||||
@x [foo()]: any;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>foo : Symbol(foo, Decl(decoratorsOnComputedProperties.ts, 1, 10))
|
||||
|
||||
@x [foo()]: any = null;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>foo : Symbol(foo, Decl(decoratorsOnComputedProperties.ts, 1, 10))
|
||||
|
||||
[fieldNameA]: any;
|
||||
>fieldNameA : Symbol(fieldNameA, Decl(decoratorsOnComputedProperties.ts, 4, 5))
|
||||
|
||||
@x [fieldNameB]: any;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>fieldNameB : Symbol(fieldNameB, Decl(decoratorsOnComputedProperties.ts, 5, 5))
|
||||
|
||||
@x [fieldNameC]: any = null;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>fieldNameC : Symbol(fieldNameC, Decl(decoratorsOnComputedProperties.ts, 6, 5))
|
||||
}
|
||||
|
||||
void class B {
|
||||
>B : Symbol(B, Decl(decoratorsOnComputedProperties.ts, 25, 4))
|
||||
|
||||
@x ["property"]: any;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>"property" : Symbol(B[["property"]], Decl(decoratorsOnComputedProperties.ts, 25, 14))
|
||||
|
||||
@x [Symbol.toStringTag]: any;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
|
||||
>Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --))
|
||||
>toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
|
||||
|
||||
@x ["property2"]: any = 2;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>"property2" : Symbol(B[["property2"]], Decl(decoratorsOnComputedProperties.ts, 27, 33))
|
||||
|
||||
@x [Symbol.iterator]: any = null;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --))
|
||||
>Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --))
|
||||
>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --))
|
||||
|
||||
["property3"]: any;
|
||||
>"property3" : Symbol(B[["property3"]], Decl(decoratorsOnComputedProperties.ts, 29, 37))
|
||||
|
||||
[Symbol.isConcatSpreadable]: any;
|
||||
>Symbol.isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
|
||||
>Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --))
|
||||
>isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
|
||||
|
||||
["property4"]: any = 2;
|
||||
>"property4" : Symbol(B[["property4"]], Decl(decoratorsOnComputedProperties.ts, 31, 37))
|
||||
|
||||
[Symbol.match]: any = null;
|
||||
>Symbol.match : Symbol(SymbolConstructor.match, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
|
||||
>Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --))
|
||||
>match : Symbol(SymbolConstructor.match, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
|
||||
|
||||
[foo()]: any;
|
||||
>foo : Symbol(foo, Decl(decoratorsOnComputedProperties.ts, 1, 10))
|
||||
|
||||
@x [foo()]: any;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>foo : Symbol(foo, Decl(decoratorsOnComputedProperties.ts, 1, 10))
|
||||
|
||||
@x [foo()]: any = null;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>foo : Symbol(foo, Decl(decoratorsOnComputedProperties.ts, 1, 10))
|
||||
|
||||
[fieldNameA]: any;
|
||||
>fieldNameA : Symbol(fieldNameA, Decl(decoratorsOnComputedProperties.ts, 4, 5))
|
||||
|
||||
@x [fieldNameB]: any;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>fieldNameB : Symbol(fieldNameB, Decl(decoratorsOnComputedProperties.ts, 5, 5))
|
||||
|
||||
@x [fieldNameC]: any = null;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>fieldNameC : Symbol(fieldNameC, Decl(decoratorsOnComputedProperties.ts, 6, 5))
|
||||
|
||||
};
|
||||
|
||||
class C {
|
||||
>C : Symbol(C, Decl(decoratorsOnComputedProperties.ts, 40, 2))
|
||||
|
||||
@x ["property"]: any;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>"property" : Symbol(C[["property"]], Decl(decoratorsOnComputedProperties.ts, 42, 9))
|
||||
|
||||
@x [Symbol.toStringTag]: any;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
|
||||
>Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --))
|
||||
>toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
|
||||
|
||||
@x ["property2"]: any = 2;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>"property2" : Symbol(C[["property2"]], Decl(decoratorsOnComputedProperties.ts, 44, 33))
|
||||
|
||||
@x [Symbol.iterator]: any = null;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --))
|
||||
>Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --))
|
||||
>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --))
|
||||
|
||||
["property3"]: any;
|
||||
>"property3" : Symbol(C[["property3"]], Decl(decoratorsOnComputedProperties.ts, 46, 37))
|
||||
|
||||
[Symbol.isConcatSpreadable]: any;
|
||||
>Symbol.isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
|
||||
>Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --))
|
||||
>isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
|
||||
|
||||
["property4"]: any = 2;
|
||||
>"property4" : Symbol(C[["property4"]], Decl(decoratorsOnComputedProperties.ts, 48, 37))
|
||||
|
||||
[Symbol.match]: any = null;
|
||||
>Symbol.match : Symbol(SymbolConstructor.match, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
|
||||
>Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --))
|
||||
>match : Symbol(SymbolConstructor.match, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
|
||||
|
||||
[foo()]: any;
|
||||
>foo : Symbol(foo, Decl(decoratorsOnComputedProperties.ts, 1, 10))
|
||||
|
||||
@x [foo()]: any;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>foo : Symbol(foo, Decl(decoratorsOnComputedProperties.ts, 1, 10))
|
||||
|
||||
@x [foo()]: any = null;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>foo : Symbol(foo, Decl(decoratorsOnComputedProperties.ts, 1, 10))
|
||||
|
||||
[fieldNameA]: any;
|
||||
>fieldNameA : Symbol(fieldNameA, Decl(decoratorsOnComputedProperties.ts, 4, 5))
|
||||
|
||||
@x [fieldNameB]: any;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>fieldNameB : Symbol(fieldNameB, Decl(decoratorsOnComputedProperties.ts, 5, 5))
|
||||
|
||||
@x [fieldNameC]: any = null;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>fieldNameC : Symbol(fieldNameC, Decl(decoratorsOnComputedProperties.ts, 6, 5))
|
||||
|
||||
["some" + "method"]() {}
|
||||
}
|
||||
|
||||
void class D {
|
||||
>D : Symbol(D, Decl(decoratorsOnComputedProperties.ts, 60, 4))
|
||||
|
||||
@x ["property"]: any;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>"property" : Symbol(D[["property"]], Decl(decoratorsOnComputedProperties.ts, 60, 14))
|
||||
|
||||
@x [Symbol.toStringTag]: any;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
|
||||
>Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --))
|
||||
>toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
|
||||
|
||||
@x ["property2"]: any = 2;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>"property2" : Symbol(D[["property2"]], Decl(decoratorsOnComputedProperties.ts, 62, 33))
|
||||
|
||||
@x [Symbol.iterator]: any = null;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --))
|
||||
>Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --))
|
||||
>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --))
|
||||
|
||||
["property3"]: any;
|
||||
>"property3" : Symbol(D[["property3"]], Decl(decoratorsOnComputedProperties.ts, 64, 37))
|
||||
|
||||
[Symbol.isConcatSpreadable]: any;
|
||||
>Symbol.isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
|
||||
>Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --))
|
||||
>isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
|
||||
|
||||
["property4"]: any = 2;
|
||||
>"property4" : Symbol(D[["property4"]], Decl(decoratorsOnComputedProperties.ts, 66, 37))
|
||||
|
||||
[Symbol.match]: any = null;
|
||||
>Symbol.match : Symbol(SymbolConstructor.match, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
|
||||
>Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --))
|
||||
>match : Symbol(SymbolConstructor.match, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
|
||||
|
||||
[foo()]: any;
|
||||
>foo : Symbol(foo, Decl(decoratorsOnComputedProperties.ts, 1, 10))
|
||||
|
||||
@x [foo()]: any;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>foo : Symbol(foo, Decl(decoratorsOnComputedProperties.ts, 1, 10))
|
||||
|
||||
@x [foo()]: any = null;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>foo : Symbol(foo, Decl(decoratorsOnComputedProperties.ts, 1, 10))
|
||||
|
||||
[fieldNameA]: any;
|
||||
>fieldNameA : Symbol(fieldNameA, Decl(decoratorsOnComputedProperties.ts, 4, 5))
|
||||
|
||||
@x [fieldNameB]: any;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>fieldNameB : Symbol(fieldNameB, Decl(decoratorsOnComputedProperties.ts, 5, 5))
|
||||
|
||||
@x [fieldNameC]: any = null;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>fieldNameC : Symbol(fieldNameC, Decl(decoratorsOnComputedProperties.ts, 6, 5))
|
||||
|
||||
["some" + "method"]() {}
|
||||
};
|
||||
|
||||
class E {
|
||||
>E : Symbol(E, Decl(decoratorsOnComputedProperties.ts, 76, 2))
|
||||
|
||||
@x ["property"]: any;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>"property" : Symbol(E[["property"]], Decl(decoratorsOnComputedProperties.ts, 78, 9))
|
||||
|
||||
@x [Symbol.toStringTag]: any;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
|
||||
>Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --))
|
||||
>toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
|
||||
|
||||
@x ["property2"]: any = 2;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>"property2" : Symbol(E[["property2"]], Decl(decoratorsOnComputedProperties.ts, 80, 33))
|
||||
|
||||
@x [Symbol.iterator]: any = null;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --))
|
||||
>Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --))
|
||||
>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --))
|
||||
|
||||
["property3"]: any;
|
||||
>"property3" : Symbol(E[["property3"]], Decl(decoratorsOnComputedProperties.ts, 82, 37))
|
||||
|
||||
[Symbol.isConcatSpreadable]: any;
|
||||
>Symbol.isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
|
||||
>Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --))
|
||||
>isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
|
||||
|
||||
["property4"]: any = 2;
|
||||
>"property4" : Symbol(E[["property4"]], Decl(decoratorsOnComputedProperties.ts, 84, 37))
|
||||
|
||||
[Symbol.match]: any = null;
|
||||
>Symbol.match : Symbol(SymbolConstructor.match, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
|
||||
>Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --))
|
||||
>match : Symbol(SymbolConstructor.match, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
|
||||
|
||||
[foo()]: any;
|
||||
>foo : Symbol(foo, Decl(decoratorsOnComputedProperties.ts, 1, 10))
|
||||
|
||||
@x [foo()]: any;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>foo : Symbol(foo, Decl(decoratorsOnComputedProperties.ts, 1, 10))
|
||||
|
||||
@x [foo()]: any = null;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>foo : Symbol(foo, Decl(decoratorsOnComputedProperties.ts, 1, 10))
|
||||
|
||||
["some" + "method"]() {}
|
||||
[fieldNameA]: any;
|
||||
>fieldNameA : Symbol(fieldNameA, Decl(decoratorsOnComputedProperties.ts, 4, 5))
|
||||
|
||||
@x [fieldNameB]: any;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>fieldNameB : Symbol(fieldNameB, Decl(decoratorsOnComputedProperties.ts, 5, 5))
|
||||
|
||||
@x [fieldNameC]: any = null;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>fieldNameC : Symbol(fieldNameC, Decl(decoratorsOnComputedProperties.ts, 6, 5))
|
||||
}
|
||||
|
||||
void class F {
|
||||
>F : Symbol(F, Decl(decoratorsOnComputedProperties.ts, 96, 4))
|
||||
|
||||
@x ["property"]: any;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>"property" : Symbol(F[["property"]], Decl(decoratorsOnComputedProperties.ts, 96, 14))
|
||||
|
||||
@x [Symbol.toStringTag]: any;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
|
||||
>Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --))
|
||||
>toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
|
||||
|
||||
@x ["property2"]: any = 2;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>"property2" : Symbol(F[["property2"]], Decl(decoratorsOnComputedProperties.ts, 98, 33))
|
||||
|
||||
@x [Symbol.iterator]: any = null;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --))
|
||||
>Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --))
|
||||
>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --))
|
||||
|
||||
["property3"]: any;
|
||||
>"property3" : Symbol(F[["property3"]], Decl(decoratorsOnComputedProperties.ts, 100, 37))
|
||||
|
||||
[Symbol.isConcatSpreadable]: any;
|
||||
>Symbol.isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
|
||||
>Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --))
|
||||
>isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
|
||||
|
||||
["property4"]: any = 2;
|
||||
>"property4" : Symbol(F[["property4"]], Decl(decoratorsOnComputedProperties.ts, 102, 37))
|
||||
|
||||
[Symbol.match]: any = null;
|
||||
>Symbol.match : Symbol(SymbolConstructor.match, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
|
||||
>Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --))
|
||||
>match : Symbol(SymbolConstructor.match, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
|
||||
|
||||
[foo()]: any;
|
||||
>foo : Symbol(foo, Decl(decoratorsOnComputedProperties.ts, 1, 10))
|
||||
|
||||
@x [foo()]: any;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>foo : Symbol(foo, Decl(decoratorsOnComputedProperties.ts, 1, 10))
|
||||
|
||||
@x [foo()]: any = null;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>foo : Symbol(foo, Decl(decoratorsOnComputedProperties.ts, 1, 10))
|
||||
|
||||
["some" + "method"]() {}
|
||||
[fieldNameA]: any;
|
||||
>fieldNameA : Symbol(fieldNameA, Decl(decoratorsOnComputedProperties.ts, 4, 5))
|
||||
|
||||
@x [fieldNameB]: any;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>fieldNameB : Symbol(fieldNameB, Decl(decoratorsOnComputedProperties.ts, 5, 5))
|
||||
|
||||
@x [fieldNameC]: any = null;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>fieldNameC : Symbol(fieldNameC, Decl(decoratorsOnComputedProperties.ts, 6, 5))
|
||||
|
||||
};
|
||||
|
||||
class G {
|
||||
>G : Symbol(G, Decl(decoratorsOnComputedProperties.ts, 112, 2))
|
||||
|
||||
@x ["property"]: any;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>"property" : Symbol(G[["property"]], Decl(decoratorsOnComputedProperties.ts, 114, 9))
|
||||
|
||||
@x [Symbol.toStringTag]: any;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
|
||||
>Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --))
|
||||
>toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
|
||||
|
||||
@x ["property2"]: any = 2;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>"property2" : Symbol(G[["property2"]], Decl(decoratorsOnComputedProperties.ts, 116, 33))
|
||||
|
||||
@x [Symbol.iterator]: any = null;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --))
|
||||
>Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --))
|
||||
>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --))
|
||||
|
||||
["property3"]: any;
|
||||
>"property3" : Symbol(G[["property3"]], Decl(decoratorsOnComputedProperties.ts, 118, 37))
|
||||
|
||||
[Symbol.isConcatSpreadable]: any;
|
||||
>Symbol.isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
|
||||
>Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --))
|
||||
>isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
|
||||
|
||||
["property4"]: any = 2;
|
||||
>"property4" : Symbol(G[["property4"]], Decl(decoratorsOnComputedProperties.ts, 120, 37))
|
||||
|
||||
[Symbol.match]: any = null;
|
||||
>Symbol.match : Symbol(SymbolConstructor.match, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
|
||||
>Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --))
|
||||
>match : Symbol(SymbolConstructor.match, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
|
||||
|
||||
[foo()]: any;
|
||||
>foo : Symbol(foo, Decl(decoratorsOnComputedProperties.ts, 1, 10))
|
||||
|
||||
@x [foo()]: any;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>foo : Symbol(foo, Decl(decoratorsOnComputedProperties.ts, 1, 10))
|
||||
|
||||
@x [foo()]: any = null;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>foo : Symbol(foo, Decl(decoratorsOnComputedProperties.ts, 1, 10))
|
||||
|
||||
["some" + "method"]() {}
|
||||
[fieldNameA]: any;
|
||||
>fieldNameA : Symbol(fieldNameA, Decl(decoratorsOnComputedProperties.ts, 4, 5))
|
||||
|
||||
@x [fieldNameB]: any;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>fieldNameB : Symbol(fieldNameB, Decl(decoratorsOnComputedProperties.ts, 5, 5))
|
||||
|
||||
["some" + "method2"]() {}
|
||||
@x [fieldNameC]: any = null;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>fieldNameC : Symbol(fieldNameC, Decl(decoratorsOnComputedProperties.ts, 6, 5))
|
||||
}
|
||||
|
||||
void class H {
|
||||
>H : Symbol(H, Decl(decoratorsOnComputedProperties.ts, 133, 4))
|
||||
|
||||
@x ["property"]: any;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>"property" : Symbol(H[["property"]], Decl(decoratorsOnComputedProperties.ts, 133, 14))
|
||||
|
||||
@x [Symbol.toStringTag]: any;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
|
||||
>Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --))
|
||||
>toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
|
||||
|
||||
@x ["property2"]: any = 2;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>"property2" : Symbol(H[["property2"]], Decl(decoratorsOnComputedProperties.ts, 135, 33))
|
||||
|
||||
@x [Symbol.iterator]: any = null;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --))
|
||||
>Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --))
|
||||
>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --))
|
||||
|
||||
["property3"]: any;
|
||||
>"property3" : Symbol(H[["property3"]], Decl(decoratorsOnComputedProperties.ts, 137, 37))
|
||||
|
||||
[Symbol.isConcatSpreadable]: any;
|
||||
>Symbol.isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
|
||||
>Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --))
|
||||
>isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
|
||||
|
||||
["property4"]: any = 2;
|
||||
>"property4" : Symbol(H[["property4"]], Decl(decoratorsOnComputedProperties.ts, 139, 37))
|
||||
|
||||
[Symbol.match]: any = null;
|
||||
>Symbol.match : Symbol(SymbolConstructor.match, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
|
||||
>Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --))
|
||||
>match : Symbol(SymbolConstructor.match, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
|
||||
|
||||
[foo()]: any;
|
||||
>foo : Symbol(foo, Decl(decoratorsOnComputedProperties.ts, 1, 10))
|
||||
|
||||
@x [foo()]: any;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>foo : Symbol(foo, Decl(decoratorsOnComputedProperties.ts, 1, 10))
|
||||
|
||||
@x [foo()]: any = null;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>foo : Symbol(foo, Decl(decoratorsOnComputedProperties.ts, 1, 10))
|
||||
|
||||
["some" + "method"]() {}
|
||||
[fieldNameA]: any;
|
||||
>fieldNameA : Symbol(fieldNameA, Decl(decoratorsOnComputedProperties.ts, 4, 5))
|
||||
|
||||
@x [fieldNameB]: any;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>fieldNameB : Symbol(fieldNameB, Decl(decoratorsOnComputedProperties.ts, 5, 5))
|
||||
|
||||
["some" + "method2"]() {}
|
||||
@x [fieldNameC]: any = null;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>fieldNameC : Symbol(fieldNameC, Decl(decoratorsOnComputedProperties.ts, 6, 5))
|
||||
|
||||
};
|
||||
|
||||
class I {
|
||||
>I : Symbol(I, Decl(decoratorsOnComputedProperties.ts, 150, 2))
|
||||
|
||||
@x ["property"]: any;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>"property" : Symbol(I[["property"]], Decl(decoratorsOnComputedProperties.ts, 152, 9))
|
||||
|
||||
@x [Symbol.toStringTag]: any;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
|
||||
>Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --))
|
||||
>toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
|
||||
|
||||
@x ["property2"]: any = 2;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>"property2" : Symbol(I[["property2"]], Decl(decoratorsOnComputedProperties.ts, 154, 33))
|
||||
|
||||
@x [Symbol.iterator]: any = null;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --))
|
||||
>Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --))
|
||||
>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --))
|
||||
|
||||
["property3"]: any;
|
||||
>"property3" : Symbol(I[["property3"]], Decl(decoratorsOnComputedProperties.ts, 156, 37))
|
||||
|
||||
[Symbol.isConcatSpreadable]: any;
|
||||
>Symbol.isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
|
||||
>Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --))
|
||||
>isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
|
||||
|
||||
["property4"]: any = 2;
|
||||
>"property4" : Symbol(I[["property4"]], Decl(decoratorsOnComputedProperties.ts, 158, 37))
|
||||
|
||||
[Symbol.match]: any = null;
|
||||
>Symbol.match : Symbol(SymbolConstructor.match, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
|
||||
>Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --))
|
||||
>match : Symbol(SymbolConstructor.match, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
|
||||
|
||||
[foo()]: any;
|
||||
>foo : Symbol(foo, Decl(decoratorsOnComputedProperties.ts, 1, 10))
|
||||
|
||||
@x [foo()]: any;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>foo : Symbol(foo, Decl(decoratorsOnComputedProperties.ts, 1, 10))
|
||||
|
||||
@x [foo()]: any = null;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>foo : Symbol(foo, Decl(decoratorsOnComputedProperties.ts, 1, 10))
|
||||
|
||||
@x ["some" + "method"]() {}
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
|
||||
[fieldNameA]: any;
|
||||
>fieldNameA : Symbol(fieldNameA, Decl(decoratorsOnComputedProperties.ts, 4, 5))
|
||||
|
||||
@x [fieldNameB]: any;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>fieldNameB : Symbol(fieldNameB, Decl(decoratorsOnComputedProperties.ts, 5, 5))
|
||||
|
||||
["some" + "method2"]() {}
|
||||
@x [fieldNameC]: any = null;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>fieldNameC : Symbol(fieldNameC, Decl(decoratorsOnComputedProperties.ts, 6, 5))
|
||||
}
|
||||
|
||||
void class J {
|
||||
>J : Symbol(J, Decl(decoratorsOnComputedProperties.ts, 171, 4))
|
||||
|
||||
@x ["property"]: any;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>"property" : Symbol(J[["property"]], Decl(decoratorsOnComputedProperties.ts, 171, 14))
|
||||
|
||||
@x [Symbol.toStringTag]: any;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
|
||||
>Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --))
|
||||
>toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
|
||||
|
||||
@x ["property2"]: any = 2;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>"property2" : Symbol(J[["property2"]], Decl(decoratorsOnComputedProperties.ts, 173, 33))
|
||||
|
||||
@x [Symbol.iterator]: any = null;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --))
|
||||
>Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --))
|
||||
>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --))
|
||||
|
||||
["property3"]: any;
|
||||
>"property3" : Symbol(J[["property3"]], Decl(decoratorsOnComputedProperties.ts, 175, 37))
|
||||
|
||||
[Symbol.isConcatSpreadable]: any;
|
||||
>Symbol.isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
|
||||
>Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --))
|
||||
>isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
|
||||
|
||||
["property4"]: any = 2;
|
||||
>"property4" : Symbol(J[["property4"]], Decl(decoratorsOnComputedProperties.ts, 177, 37))
|
||||
|
||||
[Symbol.match]: any = null;
|
||||
>Symbol.match : Symbol(SymbolConstructor.match, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
|
||||
>Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --))
|
||||
>match : Symbol(SymbolConstructor.match, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
|
||||
|
||||
[foo()]: any;
|
||||
>foo : Symbol(foo, Decl(decoratorsOnComputedProperties.ts, 1, 10))
|
||||
|
||||
@x [foo()]: any;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>foo : Symbol(foo, Decl(decoratorsOnComputedProperties.ts, 1, 10))
|
||||
|
||||
@x [foo()]: any = null;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>foo : Symbol(foo, Decl(decoratorsOnComputedProperties.ts, 1, 10))
|
||||
|
||||
@x ["some" + "method"]() {}
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
|
||||
[fieldNameA]: any;
|
||||
>fieldNameA : Symbol(fieldNameA, Decl(decoratorsOnComputedProperties.ts, 4, 5))
|
||||
|
||||
@x [fieldNameB]: any;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>fieldNameB : Symbol(fieldNameB, Decl(decoratorsOnComputedProperties.ts, 5, 5))
|
||||
|
||||
["some" + "method2"]() {}
|
||||
@x [fieldNameC]: any = null;
|
||||
>x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0))
|
||||
>fieldNameC : Symbol(fieldNameC, Decl(decoratorsOnComputedProperties.ts, 6, 5))
|
||||
|
||||
};
|
||||
816
tests/baselines/reference/decoratorsOnComputedProperties.types
Normal file
816
tests/baselines/reference/decoratorsOnComputedProperties.types
Normal file
@@ -0,0 +1,816 @@
|
||||
=== tests/cases/compiler/decoratorsOnComputedProperties.ts ===
|
||||
function x(o: object, k: PropertyKey) { }
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>o : object
|
||||
>k : PropertyKey
|
||||
>PropertyKey : PropertyKey
|
||||
|
||||
let i = 0;
|
||||
>i : number
|
||||
>0 : 0
|
||||
|
||||
function foo(): string { return ++i + ""; }
|
||||
>foo : () => string
|
||||
>++i + "" : string
|
||||
>++i : number
|
||||
>i : number
|
||||
>"" : ""
|
||||
|
||||
const fieldNameA: string = "fieldName1";
|
||||
>fieldNameA : string
|
||||
>"fieldName1" : "fieldName1"
|
||||
|
||||
const fieldNameB: string = "fieldName2";
|
||||
>fieldNameB : string
|
||||
>"fieldName2" : "fieldName2"
|
||||
|
||||
const fieldNameC: string = "fieldName3";
|
||||
>fieldNameC : string
|
||||
>"fieldName3" : "fieldName3"
|
||||
|
||||
class A {
|
||||
>A : A
|
||||
|
||||
@x ["property"]: any;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>"property" : "property"
|
||||
|
||||
@x [Symbol.toStringTag]: any;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>Symbol.toStringTag : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>toStringTag : symbol
|
||||
|
||||
@x ["property2"]: any = 2;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>"property2" : "property2"
|
||||
>2 : 2
|
||||
|
||||
@x [Symbol.iterator]: any = null;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>Symbol.iterator : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>iterator : symbol
|
||||
>null : null
|
||||
|
||||
["property3"]: any;
|
||||
>"property3" : "property3"
|
||||
|
||||
[Symbol.isConcatSpreadable]: any;
|
||||
>Symbol.isConcatSpreadable : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>isConcatSpreadable : symbol
|
||||
|
||||
["property4"]: any = 2;
|
||||
>"property4" : "property4"
|
||||
>2 : 2
|
||||
|
||||
[Symbol.match]: any = null;
|
||||
>Symbol.match : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>match : symbol
|
||||
>null : null
|
||||
|
||||
[foo()]: any;
|
||||
>foo() : string
|
||||
>foo : () => string
|
||||
|
||||
@x [foo()]: any;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>foo() : string
|
||||
>foo : () => string
|
||||
|
||||
@x [foo()]: any = null;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>foo() : string
|
||||
>foo : () => string
|
||||
>null : null
|
||||
|
||||
[fieldNameA]: any;
|
||||
>fieldNameA : string
|
||||
|
||||
@x [fieldNameB]: any;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>fieldNameB : string
|
||||
|
||||
@x [fieldNameC]: any = null;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>fieldNameC : string
|
||||
>null : null
|
||||
}
|
||||
|
||||
void class B {
|
||||
>void class B { @x ["property"]: any; @x [Symbol.toStringTag]: any; @x ["property2"]: any = 2; @x [Symbol.iterator]: any = null; ["property3"]: any; [Symbol.isConcatSpreadable]: any; ["property4"]: any = 2; [Symbol.match]: any = null; [foo()]: any; @x [foo()]: any; @x [foo()]: any = null; [fieldNameA]: any; @x [fieldNameB]: any; @x [fieldNameC]: any = null;} : undefined
|
||||
>class B { @x ["property"]: any; @x [Symbol.toStringTag]: any; @x ["property2"]: any = 2; @x [Symbol.iterator]: any = null; ["property3"]: any; [Symbol.isConcatSpreadable]: any; ["property4"]: any = 2; [Symbol.match]: any = null; [foo()]: any; @x [foo()]: any; @x [foo()]: any = null; [fieldNameA]: any; @x [fieldNameB]: any; @x [fieldNameC]: any = null;} : typeof B
|
||||
>B : typeof B
|
||||
|
||||
@x ["property"]: any;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>"property" : "property"
|
||||
|
||||
@x [Symbol.toStringTag]: any;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>Symbol.toStringTag : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>toStringTag : symbol
|
||||
|
||||
@x ["property2"]: any = 2;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>"property2" : "property2"
|
||||
>2 : 2
|
||||
|
||||
@x [Symbol.iterator]: any = null;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>Symbol.iterator : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>iterator : symbol
|
||||
>null : null
|
||||
|
||||
["property3"]: any;
|
||||
>"property3" : "property3"
|
||||
|
||||
[Symbol.isConcatSpreadable]: any;
|
||||
>Symbol.isConcatSpreadable : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>isConcatSpreadable : symbol
|
||||
|
||||
["property4"]: any = 2;
|
||||
>"property4" : "property4"
|
||||
>2 : 2
|
||||
|
||||
[Symbol.match]: any = null;
|
||||
>Symbol.match : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>match : symbol
|
||||
>null : null
|
||||
|
||||
[foo()]: any;
|
||||
>foo() : string
|
||||
>foo : () => string
|
||||
|
||||
@x [foo()]: any;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>foo() : string
|
||||
>foo : () => string
|
||||
|
||||
@x [foo()]: any = null;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>foo() : string
|
||||
>foo : () => string
|
||||
>null : null
|
||||
|
||||
[fieldNameA]: any;
|
||||
>fieldNameA : string
|
||||
|
||||
@x [fieldNameB]: any;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>fieldNameB : string
|
||||
|
||||
@x [fieldNameC]: any = null;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>fieldNameC : string
|
||||
>null : null
|
||||
|
||||
};
|
||||
|
||||
class C {
|
||||
>C : C
|
||||
|
||||
@x ["property"]: any;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>"property" : "property"
|
||||
|
||||
@x [Symbol.toStringTag]: any;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>Symbol.toStringTag : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>toStringTag : symbol
|
||||
|
||||
@x ["property2"]: any = 2;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>"property2" : "property2"
|
||||
>2 : 2
|
||||
|
||||
@x [Symbol.iterator]: any = null;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>Symbol.iterator : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>iterator : symbol
|
||||
>null : null
|
||||
|
||||
["property3"]: any;
|
||||
>"property3" : "property3"
|
||||
|
||||
[Symbol.isConcatSpreadable]: any;
|
||||
>Symbol.isConcatSpreadable : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>isConcatSpreadable : symbol
|
||||
|
||||
["property4"]: any = 2;
|
||||
>"property4" : "property4"
|
||||
>2 : 2
|
||||
|
||||
[Symbol.match]: any = null;
|
||||
>Symbol.match : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>match : symbol
|
||||
>null : null
|
||||
|
||||
[foo()]: any;
|
||||
>foo() : string
|
||||
>foo : () => string
|
||||
|
||||
@x [foo()]: any;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>foo() : string
|
||||
>foo : () => string
|
||||
|
||||
@x [foo()]: any = null;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>foo() : string
|
||||
>foo : () => string
|
||||
>null : null
|
||||
|
||||
[fieldNameA]: any;
|
||||
>fieldNameA : string
|
||||
|
||||
@x [fieldNameB]: any;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>fieldNameB : string
|
||||
|
||||
@x [fieldNameC]: any = null;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>fieldNameC : string
|
||||
>null : null
|
||||
|
||||
["some" + "method"]() {}
|
||||
>"some" + "method" : string
|
||||
>"some" : "some"
|
||||
>"method" : "method"
|
||||
}
|
||||
|
||||
void class D {
|
||||
>void class D { @x ["property"]: any; @x [Symbol.toStringTag]: any; @x ["property2"]: any = 2; @x [Symbol.iterator]: any = null; ["property3"]: any; [Symbol.isConcatSpreadable]: any; ["property4"]: any = 2; [Symbol.match]: any = null; [foo()]: any; @x [foo()]: any; @x [foo()]: any = null; [fieldNameA]: any; @x [fieldNameB]: any; @x [fieldNameC]: any = null; ["some" + "method"]() {}} : undefined
|
||||
>class D { @x ["property"]: any; @x [Symbol.toStringTag]: any; @x ["property2"]: any = 2; @x [Symbol.iterator]: any = null; ["property3"]: any; [Symbol.isConcatSpreadable]: any; ["property4"]: any = 2; [Symbol.match]: any = null; [foo()]: any; @x [foo()]: any; @x [foo()]: any = null; [fieldNameA]: any; @x [fieldNameB]: any; @x [fieldNameC]: any = null; ["some" + "method"]() {}} : typeof D
|
||||
>D : typeof D
|
||||
|
||||
@x ["property"]: any;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>"property" : "property"
|
||||
|
||||
@x [Symbol.toStringTag]: any;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>Symbol.toStringTag : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>toStringTag : symbol
|
||||
|
||||
@x ["property2"]: any = 2;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>"property2" : "property2"
|
||||
>2 : 2
|
||||
|
||||
@x [Symbol.iterator]: any = null;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>Symbol.iterator : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>iterator : symbol
|
||||
>null : null
|
||||
|
||||
["property3"]: any;
|
||||
>"property3" : "property3"
|
||||
|
||||
[Symbol.isConcatSpreadable]: any;
|
||||
>Symbol.isConcatSpreadable : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>isConcatSpreadable : symbol
|
||||
|
||||
["property4"]: any = 2;
|
||||
>"property4" : "property4"
|
||||
>2 : 2
|
||||
|
||||
[Symbol.match]: any = null;
|
||||
>Symbol.match : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>match : symbol
|
||||
>null : null
|
||||
|
||||
[foo()]: any;
|
||||
>foo() : string
|
||||
>foo : () => string
|
||||
|
||||
@x [foo()]: any;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>foo() : string
|
||||
>foo : () => string
|
||||
|
||||
@x [foo()]: any = null;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>foo() : string
|
||||
>foo : () => string
|
||||
>null : null
|
||||
|
||||
[fieldNameA]: any;
|
||||
>fieldNameA : string
|
||||
|
||||
@x [fieldNameB]: any;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>fieldNameB : string
|
||||
|
||||
@x [fieldNameC]: any = null;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>fieldNameC : string
|
||||
>null : null
|
||||
|
||||
["some" + "method"]() {}
|
||||
>"some" + "method" : string
|
||||
>"some" : "some"
|
||||
>"method" : "method"
|
||||
|
||||
};
|
||||
|
||||
class E {
|
||||
>E : E
|
||||
|
||||
@x ["property"]: any;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>"property" : "property"
|
||||
|
||||
@x [Symbol.toStringTag]: any;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>Symbol.toStringTag : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>toStringTag : symbol
|
||||
|
||||
@x ["property2"]: any = 2;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>"property2" : "property2"
|
||||
>2 : 2
|
||||
|
||||
@x [Symbol.iterator]: any = null;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>Symbol.iterator : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>iterator : symbol
|
||||
>null : null
|
||||
|
||||
["property3"]: any;
|
||||
>"property3" : "property3"
|
||||
|
||||
[Symbol.isConcatSpreadable]: any;
|
||||
>Symbol.isConcatSpreadable : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>isConcatSpreadable : symbol
|
||||
|
||||
["property4"]: any = 2;
|
||||
>"property4" : "property4"
|
||||
>2 : 2
|
||||
|
||||
[Symbol.match]: any = null;
|
||||
>Symbol.match : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>match : symbol
|
||||
>null : null
|
||||
|
||||
[foo()]: any;
|
||||
>foo() : string
|
||||
>foo : () => string
|
||||
|
||||
@x [foo()]: any;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>foo() : string
|
||||
>foo : () => string
|
||||
|
||||
@x [foo()]: any = null;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>foo() : string
|
||||
>foo : () => string
|
||||
>null : null
|
||||
|
||||
["some" + "method"]() {}
|
||||
>"some" + "method" : string
|
||||
>"some" : "some"
|
||||
>"method" : "method"
|
||||
|
||||
[fieldNameA]: any;
|
||||
>fieldNameA : string
|
||||
|
||||
@x [fieldNameB]: any;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>fieldNameB : string
|
||||
|
||||
@x [fieldNameC]: any = null;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>fieldNameC : string
|
||||
>null : null
|
||||
}
|
||||
|
||||
void class F {
|
||||
>void class F { @x ["property"]: any; @x [Symbol.toStringTag]: any; @x ["property2"]: any = 2; @x [Symbol.iterator]: any = null; ["property3"]: any; [Symbol.isConcatSpreadable]: any; ["property4"]: any = 2; [Symbol.match]: any = null; [foo()]: any; @x [foo()]: any; @x [foo()]: any = null; ["some" + "method"]() {} [fieldNameA]: any; @x [fieldNameB]: any; @x [fieldNameC]: any = null;} : undefined
|
||||
>class F { @x ["property"]: any; @x [Symbol.toStringTag]: any; @x ["property2"]: any = 2; @x [Symbol.iterator]: any = null; ["property3"]: any; [Symbol.isConcatSpreadable]: any; ["property4"]: any = 2; [Symbol.match]: any = null; [foo()]: any; @x [foo()]: any; @x [foo()]: any = null; ["some" + "method"]() {} [fieldNameA]: any; @x [fieldNameB]: any; @x [fieldNameC]: any = null;} : typeof F
|
||||
>F : typeof F
|
||||
|
||||
@x ["property"]: any;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>"property" : "property"
|
||||
|
||||
@x [Symbol.toStringTag]: any;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>Symbol.toStringTag : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>toStringTag : symbol
|
||||
|
||||
@x ["property2"]: any = 2;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>"property2" : "property2"
|
||||
>2 : 2
|
||||
|
||||
@x [Symbol.iterator]: any = null;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>Symbol.iterator : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>iterator : symbol
|
||||
>null : null
|
||||
|
||||
["property3"]: any;
|
||||
>"property3" : "property3"
|
||||
|
||||
[Symbol.isConcatSpreadable]: any;
|
||||
>Symbol.isConcatSpreadable : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>isConcatSpreadable : symbol
|
||||
|
||||
["property4"]: any = 2;
|
||||
>"property4" : "property4"
|
||||
>2 : 2
|
||||
|
||||
[Symbol.match]: any = null;
|
||||
>Symbol.match : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>match : symbol
|
||||
>null : null
|
||||
|
||||
[foo()]: any;
|
||||
>foo() : string
|
||||
>foo : () => string
|
||||
|
||||
@x [foo()]: any;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>foo() : string
|
||||
>foo : () => string
|
||||
|
||||
@x [foo()]: any = null;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>foo() : string
|
||||
>foo : () => string
|
||||
>null : null
|
||||
|
||||
["some" + "method"]() {}
|
||||
>"some" + "method" : string
|
||||
>"some" : "some"
|
||||
>"method" : "method"
|
||||
|
||||
[fieldNameA]: any;
|
||||
>fieldNameA : string
|
||||
|
||||
@x [fieldNameB]: any;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>fieldNameB : string
|
||||
|
||||
@x [fieldNameC]: any = null;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>fieldNameC : string
|
||||
>null : null
|
||||
|
||||
};
|
||||
|
||||
class G {
|
||||
>G : G
|
||||
|
||||
@x ["property"]: any;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>"property" : "property"
|
||||
|
||||
@x [Symbol.toStringTag]: any;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>Symbol.toStringTag : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>toStringTag : symbol
|
||||
|
||||
@x ["property2"]: any = 2;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>"property2" : "property2"
|
||||
>2 : 2
|
||||
|
||||
@x [Symbol.iterator]: any = null;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>Symbol.iterator : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>iterator : symbol
|
||||
>null : null
|
||||
|
||||
["property3"]: any;
|
||||
>"property3" : "property3"
|
||||
|
||||
[Symbol.isConcatSpreadable]: any;
|
||||
>Symbol.isConcatSpreadable : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>isConcatSpreadable : symbol
|
||||
|
||||
["property4"]: any = 2;
|
||||
>"property4" : "property4"
|
||||
>2 : 2
|
||||
|
||||
[Symbol.match]: any = null;
|
||||
>Symbol.match : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>match : symbol
|
||||
>null : null
|
||||
|
||||
[foo()]: any;
|
||||
>foo() : string
|
||||
>foo : () => string
|
||||
|
||||
@x [foo()]: any;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>foo() : string
|
||||
>foo : () => string
|
||||
|
||||
@x [foo()]: any = null;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>foo() : string
|
||||
>foo : () => string
|
||||
>null : null
|
||||
|
||||
["some" + "method"]() {}
|
||||
>"some" + "method" : string
|
||||
>"some" : "some"
|
||||
>"method" : "method"
|
||||
|
||||
[fieldNameA]: any;
|
||||
>fieldNameA : string
|
||||
|
||||
@x [fieldNameB]: any;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>fieldNameB : string
|
||||
|
||||
["some" + "method2"]() {}
|
||||
>"some" + "method2" : string
|
||||
>"some" : "some"
|
||||
>"method2" : "method2"
|
||||
|
||||
@x [fieldNameC]: any = null;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>fieldNameC : string
|
||||
>null : null
|
||||
}
|
||||
|
||||
void class H {
|
||||
>void class H { @x ["property"]: any; @x [Symbol.toStringTag]: any; @x ["property2"]: any = 2; @x [Symbol.iterator]: any = null; ["property3"]: any; [Symbol.isConcatSpreadable]: any; ["property4"]: any = 2; [Symbol.match]: any = null; [foo()]: any; @x [foo()]: any; @x [foo()]: any = null; ["some" + "method"]() {} [fieldNameA]: any; @x [fieldNameB]: any; ["some" + "method2"]() {} @x [fieldNameC]: any = null;} : undefined
|
||||
>class H { @x ["property"]: any; @x [Symbol.toStringTag]: any; @x ["property2"]: any = 2; @x [Symbol.iterator]: any = null; ["property3"]: any; [Symbol.isConcatSpreadable]: any; ["property4"]: any = 2; [Symbol.match]: any = null; [foo()]: any; @x [foo()]: any; @x [foo()]: any = null; ["some" + "method"]() {} [fieldNameA]: any; @x [fieldNameB]: any; ["some" + "method2"]() {} @x [fieldNameC]: any = null;} : typeof H
|
||||
>H : typeof H
|
||||
|
||||
@x ["property"]: any;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>"property" : "property"
|
||||
|
||||
@x [Symbol.toStringTag]: any;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>Symbol.toStringTag : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>toStringTag : symbol
|
||||
|
||||
@x ["property2"]: any = 2;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>"property2" : "property2"
|
||||
>2 : 2
|
||||
|
||||
@x [Symbol.iterator]: any = null;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>Symbol.iterator : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>iterator : symbol
|
||||
>null : null
|
||||
|
||||
["property3"]: any;
|
||||
>"property3" : "property3"
|
||||
|
||||
[Symbol.isConcatSpreadable]: any;
|
||||
>Symbol.isConcatSpreadable : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>isConcatSpreadable : symbol
|
||||
|
||||
["property4"]: any = 2;
|
||||
>"property4" : "property4"
|
||||
>2 : 2
|
||||
|
||||
[Symbol.match]: any = null;
|
||||
>Symbol.match : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>match : symbol
|
||||
>null : null
|
||||
|
||||
[foo()]: any;
|
||||
>foo() : string
|
||||
>foo : () => string
|
||||
|
||||
@x [foo()]: any;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>foo() : string
|
||||
>foo : () => string
|
||||
|
||||
@x [foo()]: any = null;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>foo() : string
|
||||
>foo : () => string
|
||||
>null : null
|
||||
|
||||
["some" + "method"]() {}
|
||||
>"some" + "method" : string
|
||||
>"some" : "some"
|
||||
>"method" : "method"
|
||||
|
||||
[fieldNameA]: any;
|
||||
>fieldNameA : string
|
||||
|
||||
@x [fieldNameB]: any;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>fieldNameB : string
|
||||
|
||||
["some" + "method2"]() {}
|
||||
>"some" + "method2" : string
|
||||
>"some" : "some"
|
||||
>"method2" : "method2"
|
||||
|
||||
@x [fieldNameC]: any = null;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>fieldNameC : string
|
||||
>null : null
|
||||
|
||||
};
|
||||
|
||||
class I {
|
||||
>I : I
|
||||
|
||||
@x ["property"]: any;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>"property" : "property"
|
||||
|
||||
@x [Symbol.toStringTag]: any;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>Symbol.toStringTag : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>toStringTag : symbol
|
||||
|
||||
@x ["property2"]: any = 2;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>"property2" : "property2"
|
||||
>2 : 2
|
||||
|
||||
@x [Symbol.iterator]: any = null;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>Symbol.iterator : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>iterator : symbol
|
||||
>null : null
|
||||
|
||||
["property3"]: any;
|
||||
>"property3" : "property3"
|
||||
|
||||
[Symbol.isConcatSpreadable]: any;
|
||||
>Symbol.isConcatSpreadable : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>isConcatSpreadable : symbol
|
||||
|
||||
["property4"]: any = 2;
|
||||
>"property4" : "property4"
|
||||
>2 : 2
|
||||
|
||||
[Symbol.match]: any = null;
|
||||
>Symbol.match : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>match : symbol
|
||||
>null : null
|
||||
|
||||
[foo()]: any;
|
||||
>foo() : string
|
||||
>foo : () => string
|
||||
|
||||
@x [foo()]: any;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>foo() : string
|
||||
>foo : () => string
|
||||
|
||||
@x [foo()]: any = null;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>foo() : string
|
||||
>foo : () => string
|
||||
>null : null
|
||||
|
||||
@x ["some" + "method"]() {}
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>"some" + "method" : string
|
||||
>"some" : "some"
|
||||
>"method" : "method"
|
||||
|
||||
[fieldNameA]: any;
|
||||
>fieldNameA : string
|
||||
|
||||
@x [fieldNameB]: any;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>fieldNameB : string
|
||||
|
||||
["some" + "method2"]() {}
|
||||
>"some" + "method2" : string
|
||||
>"some" : "some"
|
||||
>"method2" : "method2"
|
||||
|
||||
@x [fieldNameC]: any = null;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>fieldNameC : string
|
||||
>null : null
|
||||
}
|
||||
|
||||
void class J {
|
||||
>void class J { @x ["property"]: any; @x [Symbol.toStringTag]: any; @x ["property2"]: any = 2; @x [Symbol.iterator]: any = null; ["property3"]: any; [Symbol.isConcatSpreadable]: any; ["property4"]: any = 2; [Symbol.match]: any = null; [foo()]: any; @x [foo()]: any; @x [foo()]: any = null; @x ["some" + "method"]() {} [fieldNameA]: any; @x [fieldNameB]: any; ["some" + "method2"]() {} @x [fieldNameC]: any = null;} : undefined
|
||||
>class J { @x ["property"]: any; @x [Symbol.toStringTag]: any; @x ["property2"]: any = 2; @x [Symbol.iterator]: any = null; ["property3"]: any; [Symbol.isConcatSpreadable]: any; ["property4"]: any = 2; [Symbol.match]: any = null; [foo()]: any; @x [foo()]: any; @x [foo()]: any = null; @x ["some" + "method"]() {} [fieldNameA]: any; @x [fieldNameB]: any; ["some" + "method2"]() {} @x [fieldNameC]: any = null;} : typeof J
|
||||
>J : typeof J
|
||||
|
||||
@x ["property"]: any;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>"property" : "property"
|
||||
|
||||
@x [Symbol.toStringTag]: any;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>Symbol.toStringTag : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>toStringTag : symbol
|
||||
|
||||
@x ["property2"]: any = 2;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>"property2" : "property2"
|
||||
>2 : 2
|
||||
|
||||
@x [Symbol.iterator]: any = null;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>Symbol.iterator : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>iterator : symbol
|
||||
>null : null
|
||||
|
||||
["property3"]: any;
|
||||
>"property3" : "property3"
|
||||
|
||||
[Symbol.isConcatSpreadable]: any;
|
||||
>Symbol.isConcatSpreadable : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>isConcatSpreadable : symbol
|
||||
|
||||
["property4"]: any = 2;
|
||||
>"property4" : "property4"
|
||||
>2 : 2
|
||||
|
||||
[Symbol.match]: any = null;
|
||||
>Symbol.match : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>match : symbol
|
||||
>null : null
|
||||
|
||||
[foo()]: any;
|
||||
>foo() : string
|
||||
>foo : () => string
|
||||
|
||||
@x [foo()]: any;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>foo() : string
|
||||
>foo : () => string
|
||||
|
||||
@x [foo()]: any = null;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>foo() : string
|
||||
>foo : () => string
|
||||
>null : null
|
||||
|
||||
@x ["some" + "method"]() {}
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>"some" + "method" : string
|
||||
>"some" : "some"
|
||||
>"method" : "method"
|
||||
|
||||
[fieldNameA]: any;
|
||||
>fieldNameA : string
|
||||
|
||||
@x [fieldNameB]: any;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>fieldNameB : string
|
||||
|
||||
["some" + "method2"]() {}
|
||||
>"some" + "method2" : string
|
||||
>"some" : "some"
|
||||
>"method2" : "method2"
|
||||
|
||||
@x [fieldNameC]: any = null;
|
||||
>x : (o: object, k: PropertyKey) => void
|
||||
>fieldNameC : string
|
||||
>null : null
|
||||
|
||||
};
|
||||
@@ -69,11 +69,11 @@ function f1() {
|
||||
var g = _newTarget;
|
||||
var h = function () { return _newTarget; };
|
||||
}
|
||||
var f2 = function _a() {
|
||||
var _newTarget = this && this instanceof _a ? this.constructor : void 0;
|
||||
var f2 = function _b() {
|
||||
var _newTarget = this && this instanceof _b ? this.constructor : void 0;
|
||||
var i = _newTarget;
|
||||
var j = function () { return _newTarget; };
|
||||
};
|
||||
var O = {
|
||||
k: function _b() { var _newTarget = this && this instanceof _b ? this.constructor : void 0; return _newTarget; }
|
||||
k: function _c() { var _newTarget = this && this instanceof _c ? this.constructor : void 0; return _newTarget; }
|
||||
};
|
||||
|
||||
@@ -6,6 +6,8 @@ class C {
|
||||
//// [parserComputedPropertyName10.js]
|
||||
class C {
|
||||
constructor() {
|
||||
this[e] = 1;
|
||||
this[_a] = 1;
|
||||
}
|
||||
}
|
||||
_a = e;
|
||||
var _a;
|
||||
|
||||
@@ -9,6 +9,8 @@ class C {
|
||||
class C {
|
||||
constructor() {
|
||||
// No ASI
|
||||
this[e] = 0[e2] = 1;
|
||||
this[_a] = 0[e2] = 1;
|
||||
}
|
||||
}
|
||||
_a = e;
|
||||
var _a;
|
||||
|
||||
@@ -9,6 +9,8 @@ class C {
|
||||
class C {
|
||||
constructor() {
|
||||
// No ASI
|
||||
this[e] = 0[e2];
|
||||
this[_a] = 0[e2];
|
||||
}
|
||||
}
|
||||
_a = e;
|
||||
var _a;
|
||||
|
||||
@@ -7,6 +7,8 @@ class C {
|
||||
//// [parserComputedPropertyName28.js]
|
||||
class C {
|
||||
constructor() {
|
||||
this[e] = 0;
|
||||
this[_a] = 0;
|
||||
}
|
||||
}
|
||||
_a = e;
|
||||
var _a;
|
||||
|
||||
@@ -9,6 +9,8 @@ class C {
|
||||
class C {
|
||||
constructor() {
|
||||
// yes ASI
|
||||
this[e] = id++;
|
||||
this[_a] = id++;
|
||||
}
|
||||
}
|
||||
_a = e;
|
||||
var _a;
|
||||
|
||||
@@ -9,7 +9,9 @@ class C {
|
||||
class C {
|
||||
constructor() {
|
||||
// No ASI
|
||||
this[e] = 0[e2]();
|
||||
this[_a] = 0[e2]();
|
||||
}
|
||||
}
|
||||
_a = e;
|
||||
{ }
|
||||
var _a;
|
||||
|
||||
@@ -6,7 +6,9 @@ class C {
|
||||
//// [parserES5ComputedPropertyName10.js]
|
||||
var C = /** @class */ (function () {
|
||||
function C() {
|
||||
this[e] = 1;
|
||||
this[_a] = 1;
|
||||
}
|
||||
return C;
|
||||
}());
|
||||
_a = e;
|
||||
var _a;
|
||||
|
||||
@@ -11,10 +11,11 @@ class C {
|
||||
//// [symbolProperty7.js]
|
||||
class C {
|
||||
constructor() {
|
||||
this[Symbol()] = 0;
|
||||
this[_a] = 0;
|
||||
}
|
||||
[Symbol()]() { }
|
||||
[_a = Symbol(), Symbol(), Symbol()]() { }
|
||||
get [Symbol()]() {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
var _a;
|
||||
|
||||
191
tests/cases/compiler/decoratorsOnComputedProperties.ts
Normal file
191
tests/cases/compiler/decoratorsOnComputedProperties.ts
Normal file
@@ -0,0 +1,191 @@
|
||||
// @target: es6
|
||||
// @experimentalDecorators: true
|
||||
function x(o: object, k: PropertyKey) { }
|
||||
let i = 0;
|
||||
function foo(): string { return ++i + ""; }
|
||||
|
||||
const fieldNameA: string = "fieldName1";
|
||||
const fieldNameB: string = "fieldName2";
|
||||
const fieldNameC: string = "fieldName3";
|
||||
|
||||
class A {
|
||||
@x ["property"]: any;
|
||||
@x [Symbol.toStringTag]: any;
|
||||
@x ["property2"]: any = 2;
|
||||
@x [Symbol.iterator]: any = null;
|
||||
["property3"]: any;
|
||||
[Symbol.isConcatSpreadable]: any;
|
||||
["property4"]: any = 2;
|
||||
[Symbol.match]: any = null;
|
||||
[foo()]: any;
|
||||
@x [foo()]: any;
|
||||
@x [foo()]: any = null;
|
||||
[fieldNameA]: any;
|
||||
@x [fieldNameB]: any;
|
||||
@x [fieldNameC]: any = null;
|
||||
}
|
||||
|
||||
void class B {
|
||||
@x ["property"]: any;
|
||||
@x [Symbol.toStringTag]: any;
|
||||
@x ["property2"]: any = 2;
|
||||
@x [Symbol.iterator]: any = null;
|
||||
["property3"]: any;
|
||||
[Symbol.isConcatSpreadable]: any;
|
||||
["property4"]: any = 2;
|
||||
[Symbol.match]: any = null;
|
||||
[foo()]: any;
|
||||
@x [foo()]: any;
|
||||
@x [foo()]: any = null;
|
||||
[fieldNameA]: any;
|
||||
@x [fieldNameB]: any;
|
||||
@x [fieldNameC]: any = null;
|
||||
};
|
||||
|
||||
class C {
|
||||
@x ["property"]: any;
|
||||
@x [Symbol.toStringTag]: any;
|
||||
@x ["property2"]: any = 2;
|
||||
@x [Symbol.iterator]: any = null;
|
||||
["property3"]: any;
|
||||
[Symbol.isConcatSpreadable]: any;
|
||||
["property4"]: any = 2;
|
||||
[Symbol.match]: any = null;
|
||||
[foo()]: any;
|
||||
@x [foo()]: any;
|
||||
@x [foo()]: any = null;
|
||||
[fieldNameA]: any;
|
||||
@x [fieldNameB]: any;
|
||||
@x [fieldNameC]: any = null;
|
||||
["some" + "method"]() {}
|
||||
}
|
||||
|
||||
void class D {
|
||||
@x ["property"]: any;
|
||||
@x [Symbol.toStringTag]: any;
|
||||
@x ["property2"]: any = 2;
|
||||
@x [Symbol.iterator]: any = null;
|
||||
["property3"]: any;
|
||||
[Symbol.isConcatSpreadable]: any;
|
||||
["property4"]: any = 2;
|
||||
[Symbol.match]: any = null;
|
||||
[foo()]: any;
|
||||
@x [foo()]: any;
|
||||
@x [foo()]: any = null;
|
||||
[fieldNameA]: any;
|
||||
@x [fieldNameB]: any;
|
||||
@x [fieldNameC]: any = null;
|
||||
["some" + "method"]() {}
|
||||
};
|
||||
|
||||
class E {
|
||||
@x ["property"]: any;
|
||||
@x [Symbol.toStringTag]: any;
|
||||
@x ["property2"]: any = 2;
|
||||
@x [Symbol.iterator]: any = null;
|
||||
["property3"]: any;
|
||||
[Symbol.isConcatSpreadable]: any;
|
||||
["property4"]: any = 2;
|
||||
[Symbol.match]: any = null;
|
||||
[foo()]: any;
|
||||
@x [foo()]: any;
|
||||
@x [foo()]: any = null;
|
||||
["some" + "method"]() {}
|
||||
[fieldNameA]: any;
|
||||
@x [fieldNameB]: any;
|
||||
@x [fieldNameC]: any = null;
|
||||
}
|
||||
|
||||
void class F {
|
||||
@x ["property"]: any;
|
||||
@x [Symbol.toStringTag]: any;
|
||||
@x ["property2"]: any = 2;
|
||||
@x [Symbol.iterator]: any = null;
|
||||
["property3"]: any;
|
||||
[Symbol.isConcatSpreadable]: any;
|
||||
["property4"]: any = 2;
|
||||
[Symbol.match]: any = null;
|
||||
[foo()]: any;
|
||||
@x [foo()]: any;
|
||||
@x [foo()]: any = null;
|
||||
["some" + "method"]() {}
|
||||
[fieldNameA]: any;
|
||||
@x [fieldNameB]: any;
|
||||
@x [fieldNameC]: any = null;
|
||||
};
|
||||
|
||||
class G {
|
||||
@x ["property"]: any;
|
||||
@x [Symbol.toStringTag]: any;
|
||||
@x ["property2"]: any = 2;
|
||||
@x [Symbol.iterator]: any = null;
|
||||
["property3"]: any;
|
||||
[Symbol.isConcatSpreadable]: any;
|
||||
["property4"]: any = 2;
|
||||
[Symbol.match]: any = null;
|
||||
[foo()]: any;
|
||||
@x [foo()]: any;
|
||||
@x [foo()]: any = null;
|
||||
["some" + "method"]() {}
|
||||
[fieldNameA]: any;
|
||||
@x [fieldNameB]: any;
|
||||
["some" + "method2"]() {}
|
||||
@x [fieldNameC]: any = null;
|
||||
}
|
||||
|
||||
void class H {
|
||||
@x ["property"]: any;
|
||||
@x [Symbol.toStringTag]: any;
|
||||
@x ["property2"]: any = 2;
|
||||
@x [Symbol.iterator]: any = null;
|
||||
["property3"]: any;
|
||||
[Symbol.isConcatSpreadable]: any;
|
||||
["property4"]: any = 2;
|
||||
[Symbol.match]: any = null;
|
||||
[foo()]: any;
|
||||
@x [foo()]: any;
|
||||
@x [foo()]: any = null;
|
||||
["some" + "method"]() {}
|
||||
[fieldNameA]: any;
|
||||
@x [fieldNameB]: any;
|
||||
["some" + "method2"]() {}
|
||||
@x [fieldNameC]: any = null;
|
||||
};
|
||||
|
||||
class I {
|
||||
@x ["property"]: any;
|
||||
@x [Symbol.toStringTag]: any;
|
||||
@x ["property2"]: any = 2;
|
||||
@x [Symbol.iterator]: any = null;
|
||||
["property3"]: any;
|
||||
[Symbol.isConcatSpreadable]: any;
|
||||
["property4"]: any = 2;
|
||||
[Symbol.match]: any = null;
|
||||
[foo()]: any;
|
||||
@x [foo()]: any;
|
||||
@x [foo()]: any = null;
|
||||
@x ["some" + "method"]() {}
|
||||
[fieldNameA]: any;
|
||||
@x [fieldNameB]: any;
|
||||
["some" + "method2"]() {}
|
||||
@x [fieldNameC]: any = null;
|
||||
}
|
||||
|
||||
void class J {
|
||||
@x ["property"]: any;
|
||||
@x [Symbol.toStringTag]: any;
|
||||
@x ["property2"]: any = 2;
|
||||
@x [Symbol.iterator]: any = null;
|
||||
["property3"]: any;
|
||||
[Symbol.isConcatSpreadable]: any;
|
||||
["property4"]: any = 2;
|
||||
[Symbol.match]: any = null;
|
||||
[foo()]: any;
|
||||
@x [foo()]: any;
|
||||
@x [foo()]: any = null;
|
||||
@x ["some" + "method"]() {}
|
||||
[fieldNameA]: any;
|
||||
@x [fieldNameB]: any;
|
||||
["some" + "method2"]() {}
|
||||
@x [fieldNameC]: any = null;
|
||||
};
|
||||
Reference in New Issue
Block a user