mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Adjusts source maps and comment emit for decorators
This commit is contained in:
@@ -2154,12 +2154,11 @@ namespace ts {
|
||||
transformFlags = TransformFlags.AssertES6;
|
||||
|
||||
// A MethodDeclaration is TypeScript syntax if it is either async, abstract, overloaded,
|
||||
// generic, or has both a computed property name and a decorator.
|
||||
// generic, or has a decorator.
|
||||
if ((<MethodDeclaration>node).body === undefined
|
||||
|| (<MethodDeclaration>node).typeParameters !== undefined
|
||||
|| hasModifier(node, ModifierFlags.Async | ModifierFlags.Abstract)
|
||||
|| (subtreeFlags & TransformFlags.ContainsDecorators
|
||||
&& subtreeFlags & TransformFlags.ContainsComputedPropertyName)) {
|
||||
|| subtreeFlags & TransformFlags.ContainsDecorators) {
|
||||
transformFlags |= TransformFlags.AssertTypeScript;
|
||||
}
|
||||
|
||||
@@ -2171,11 +2170,10 @@ namespace ts {
|
||||
excludeFlags = TransformFlags.MethodOrAccessorExcludes;
|
||||
|
||||
// A GetAccessor or SetAccessor is TypeScript syntax if it is either abstract,
|
||||
// or has both a computed property name and a decorator.
|
||||
// or has a decorator.
|
||||
if ((<AccessorDeclaration>node).body === undefined
|
||||
|| hasModifier(node, ModifierFlags.Abstract)
|
||||
|| (subtreeFlags & TransformFlags.ContainsDecorators
|
||||
&& subtreeFlags & TransformFlags.ContainsComputedPropertyName)) {
|
||||
|| subtreeFlags & TransformFlags.ContainsDecorators) {
|
||||
transformFlags = TransformFlags.AssertTypeScript;
|
||||
}
|
||||
|
||||
@@ -2269,7 +2267,8 @@ namespace ts {
|
||||
}
|
||||
|
||||
// If the parameter's name is 'this', then it is TypeScript syntax.
|
||||
if (node.name && (node.name as Identifier).originalKeywordKind === SyntaxKind.ThisKeyword) {
|
||||
if (subtreeFlags & TransformFlags.ContainsDecorators
|
||||
|| (node.name && isIdentifier(node.name) && (node.name as Identifier).originalKeywordKind === SyntaxKind.ThisKeyword)) {
|
||||
transformFlags |= TransformFlags.AssertTypeScript;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,10 +5,10 @@ namespace ts {
|
||||
export interface CommentWriter {
|
||||
reset(): void;
|
||||
setSourceFile(sourceFile: SourceFile): void;
|
||||
getLeadingComments(range: Node, shouldSkipCommentsForNodeCallback?: (node: Node) => boolean): CommentRange[];
|
||||
getLeadingComments(range: Node, shouldSkipCommentsForNodeCallback?: (node: Node) => boolean, getCustomCommentRangeForNodeCallback?: (node: Node) => TextRange): CommentRange[];
|
||||
getLeadingComments(range: TextRange): CommentRange[];
|
||||
getLeadingCommentsOfPosition(pos: number): CommentRange[];
|
||||
getTrailingComments(range: Node, shouldSkipCommentsForNodeCallback?: (node: Node) => boolean): CommentRange[];
|
||||
getTrailingComments(range: Node, shouldSkipCommentsForNodeCallback?: (node: Node) => boolean, getCustomCommentRangeForNodeCallback?: (node: Node) => TextRange): CommentRange[];
|
||||
getTrailingComments(range: TextRange): CommentRange[];
|
||||
getTrailingCommentsOfPosition(pos: number): CommentRange[];
|
||||
emitLeadingComments(range: TextRange, comments: CommentRange[]): void;
|
||||
@@ -43,9 +43,9 @@ namespace ts {
|
||||
return {
|
||||
reset,
|
||||
setSourceFile,
|
||||
getLeadingComments(range: TextRange, shouldSkipCommentsForNodeCallback?: (node: Node) => boolean): CommentRange[] { return undefined; },
|
||||
getLeadingComments(range: TextRange, shouldSkipCommentsForNodeCallback?: (node: Node) => boolean, getCustomCommentRangeForNodeCallback?: (node: Node) => TextRange): CommentRange[] { return undefined; },
|
||||
getLeadingCommentsOfPosition(pos: number): CommentRange[] { return undefined; },
|
||||
getTrailingComments(range: TextRange, shouldSkipCommentsForNodeCallback?: (node: Node) => boolean): CommentRange[] { return undefined; },
|
||||
getTrailingComments(range: TextRange, shouldSkipCommentsForNodeCallback?: (node: Node) => boolean, getCustomCommentRangeForNodeCallback?: (node: Node) => TextRange): CommentRange[] { return undefined; },
|
||||
getTrailingCommentsOfPosition(pos: number): CommentRange[] { return undefined; },
|
||||
emitLeadingComments(range: TextRange, comments: CommentRange[]): void { },
|
||||
emitTrailingComments(range: TextRange, comments: CommentRange[]): void { },
|
||||
@@ -77,9 +77,9 @@ namespace ts {
|
||||
emitTrailingDetachedComments
|
||||
};
|
||||
|
||||
function getLeadingComments(range: Node, shouldSkipCommentsForNodeCallback?: (node: Node) => boolean): CommentRange[];
|
||||
function getLeadingComments(range: Node, shouldSkipCommentsForNodeCallback?: (node: Node) => boolean, getCustomCommentRangeForNodeCallback?: (node: Node) => TextRange): CommentRange[];
|
||||
function getLeadingComments(range: TextRange): CommentRange[];
|
||||
function getLeadingComments(range: TextRange | Node, shouldSkipCommentsForNodeCallback?: (node: Node) => boolean) {
|
||||
function getLeadingComments(range: TextRange | Node, shouldSkipCommentsForNodeCallback?: (node: Node) => boolean, getCustomCommentRangeForNodeCallback?: (node: Node) => TextRange) {
|
||||
if (shouldSkipCommentsForNodeCallback && shouldSkipCommentsForNodeCallback(<Node>range)) {
|
||||
// If the node will not be emitted in JS, remove all the comments (normal,
|
||||
// pinned and `///`) associated with the node, unless it is a triple slash
|
||||
@@ -100,6 +100,10 @@ namespace ts {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
if (getCustomCommentRangeForNodeCallback) {
|
||||
range = getCustomCommentRangeForNodeCallback(<Node>range) || range;
|
||||
}
|
||||
|
||||
return getLeadingCommentsOfPosition(range.pos);
|
||||
}
|
||||
|
||||
@@ -119,13 +123,17 @@ namespace ts {
|
||||
return false;
|
||||
}
|
||||
|
||||
function getTrailingComments(range: Node, shouldSkipCommentsForNodeCallback?: (node: Node) => boolean): CommentRange[];
|
||||
function getTrailingComments(range: Node, shouldSkipCommentsForNodeCallback?: (node: Node) => boolean, getCustomCommentRangeForNodeCallback?: (node: Node) => TextRange): CommentRange[];
|
||||
function getTrailingComments(range: TextRange): CommentRange[];
|
||||
function getTrailingComments(range: TextRange | Node, shouldSkipCommentsForNodeCallback?: (node: Node) => boolean) {
|
||||
function getTrailingComments(range: TextRange | Node, shouldSkipCommentsForNodeCallback?: (node: Node) => boolean, getCustomCommentRangeForNodeCallback?: (node: Node) => TextRange) {
|
||||
if (shouldSkipCommentsForNodeCallback && shouldSkipCommentsForNodeCallback(<Node>range)) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
if (getCustomCommentRangeForNodeCallback) {
|
||||
range = getCustomCommentRangeForNodeCallback(<Node>range) || range;
|
||||
}
|
||||
|
||||
return getTrailingCommentsOfPosition(range.end);
|
||||
}
|
||||
|
||||
|
||||
+12
-4
@@ -867,13 +867,14 @@ namespace ts {
|
||||
);
|
||||
}
|
||||
|
||||
export function createParamHelper(expression: Expression, parameterOffset: number) {
|
||||
export function createParamHelper(expression: Expression, parameterOffset: number, location?: TextRange) {
|
||||
return createCall(
|
||||
createIdentifier("__param"),
|
||||
[
|
||||
createLiteral(parameterOffset),
|
||||
expression
|
||||
]
|
||||
],
|
||||
location
|
||||
);
|
||||
}
|
||||
|
||||
@@ -887,7 +888,7 @@ namespace ts {
|
||||
);
|
||||
}
|
||||
|
||||
export function createDecorateHelper(decoratorExpressions: Expression[], target: Expression, memberName?: Expression, descriptor?: Expression) {
|
||||
export function createDecorateHelper(decoratorExpressions: Expression[], target: Expression, memberName?: Expression, descriptor?: Expression, location?: TextRange) {
|
||||
const argumentsArray: Expression[] = [];
|
||||
argumentsArray.push(createArrayLiteral(decoratorExpressions, /*location*/ undefined, /*multiLine*/ true));
|
||||
argumentsArray.push(target);
|
||||
@@ -898,7 +899,7 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
return createCall(createIdentifier("__decorate"), argumentsArray);
|
||||
return createCall(createIdentifier("__decorate"), argumentsArray, location);
|
||||
}
|
||||
|
||||
export function createAwaiterHelper(hasLexicalArguments: boolean, promiseConstructor: EntityName | Expression, body: Block) {
|
||||
@@ -947,6 +948,7 @@ namespace ts {
|
||||
|
||||
export interface PropertyDescriptorExtendedOption {
|
||||
location?: TextRange;
|
||||
original?: Node;
|
||||
emitFlags?: NodeEmitFlags;
|
||||
newLine?: boolean;
|
||||
}
|
||||
@@ -986,11 +988,13 @@ namespace ts {
|
||||
if (value !== undefined) {
|
||||
let options: PropertyDescriptorExtendedOption;
|
||||
let location: TextRange;
|
||||
let original: Node;
|
||||
let emitFlags: NodeEmitFlags;
|
||||
if (descriptorExtendedOptions !== undefined) {
|
||||
options = getProperty(descriptorExtendedOptions, name);
|
||||
if (options !== undefined) {
|
||||
location = options.location;
|
||||
original = options.original;
|
||||
emitFlags = options.emitFlags;
|
||||
if (options.newLine !== undefined) {
|
||||
preferNewLine = options.newLine;
|
||||
@@ -1009,6 +1013,10 @@ namespace ts {
|
||||
context.setNodeEmitFlags(property, emitFlags);
|
||||
}
|
||||
|
||||
if (original) {
|
||||
property.original = original;
|
||||
}
|
||||
|
||||
if (preferNewLine) {
|
||||
startOnNewLine(property);
|
||||
}
|
||||
|
||||
@@ -172,6 +172,7 @@ const _super = (function (geti, seti) {
|
||||
let context: TransformationContext;
|
||||
let getNodeEmitFlags: (node: Node) => NodeEmitFlags;
|
||||
let setNodeEmitFlags: (node: Node, flags: NodeEmitFlags) => void;
|
||||
let getNodeCustomCommentRange: (node: Node) => TextRange;
|
||||
let isSubstitutionEnabled: (node: Node) => boolean;
|
||||
let isEmitNotificationEnabled: (node: Node) => boolean;
|
||||
let onSubstituteNode: (node: Node, isExpression: boolean) => Node;
|
||||
@@ -232,6 +233,7 @@ const _super = (function (geti, seti) {
|
||||
|
||||
getNodeEmitFlags = undefined;
|
||||
setNodeEmitFlags = undefined;
|
||||
getNodeCustomCommentRange = undefined;
|
||||
isSubstitutionEnabled = undefined;
|
||||
isEmitNotificationEnabled = undefined;
|
||||
onSubstituteNode = undefined;
|
||||
@@ -251,6 +253,7 @@ const _super = (function (geti, seti) {
|
||||
context = _context;
|
||||
getNodeEmitFlags = context.getNodeEmitFlags;
|
||||
setNodeEmitFlags = context.setNodeEmitFlags;
|
||||
getNodeCustomCommentRange = context.getNodeCustomCommentRange;
|
||||
isSubstitutionEnabled = context.isSubstitutionEnabled;
|
||||
isEmitNotificationEnabled = context.isEmitNotificationEnabled;
|
||||
onSubstituteNode = context.onSubstituteNode;
|
||||
@@ -334,8 +337,8 @@ const _super = (function (geti, seti) {
|
||||
|
||||
function emitNodeWithWorker(node: Node, emitWorker: (node: Node) => void) {
|
||||
if (node) {
|
||||
const leadingComments = getLeadingComments(node, shouldSkipLeadingCommentsForNode);
|
||||
const trailingComments = getTrailingComments(node, shouldSkipTrailingCommentsForNode);
|
||||
const leadingComments = getLeadingComments(node, shouldSkipLeadingCommentsForNode, getNodeCustomCommentRange);
|
||||
const trailingComments = getTrailingComments(node, shouldSkipTrailingCommentsForNode, getNodeCustomCommentRange);
|
||||
emitLeadingComments(node, leadingComments);
|
||||
emitStart(node, shouldSkipLeadingSourceMapForNode, shouldSkipSourceMapForChildren);
|
||||
emitWorker(node);
|
||||
|
||||
@@ -55,6 +55,7 @@ namespace ts {
|
||||
*/
|
||||
export function transformFiles(resolver: EmitResolver, host: EmitHost, sourceFiles: SourceFile[], transformers: Transformer[]) {
|
||||
const nodeEmitFlags: NodeEmitFlags[] = [];
|
||||
const nodeCustomCommentRange: TextRange[] = [];
|
||||
const lexicalEnvironmentVariableDeclarationsStack: VariableDeclaration[][] = [];
|
||||
const lexicalEnvironmentFunctionDeclarationsStack: FunctionDeclaration[][] = [];
|
||||
const enabledSyntaxKindFeatures = new Array<SyntaxKindFeatureFlags>(SyntaxKind.Count);
|
||||
@@ -72,6 +73,8 @@ namespace ts {
|
||||
getEmitHost: () => host,
|
||||
getNodeEmitFlags,
|
||||
setNodeEmitFlags,
|
||||
getNodeCustomCommentRange,
|
||||
setNodeCustomCommentRange,
|
||||
hoistVariableDeclaration,
|
||||
hoistFunctionDeclaration,
|
||||
startLexicalEnvironment,
|
||||
@@ -156,8 +159,8 @@ namespace ts {
|
||||
*/
|
||||
function getNodeEmitFlags(node: Node) {
|
||||
while (node) {
|
||||
const nodeId = getNodeId(node);
|
||||
if (nodeEmitFlags[nodeId] !== undefined) {
|
||||
const nodeId = node.id;
|
||||
if (nodeId && nodeEmitFlags[nodeId] !== undefined) {
|
||||
return nodeEmitFlags[nodeId];
|
||||
}
|
||||
|
||||
@@ -175,6 +178,29 @@ namespace ts {
|
||||
return node;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a custom text range to use when emitting comments.
|
||||
*/
|
||||
function getNodeCustomCommentRange(node: Node) {
|
||||
while (node) {
|
||||
const nodeId = node.id;
|
||||
if (nodeId && nodeCustomCommentRange[nodeId] !== undefined) {
|
||||
return nodeCustomCommentRange[nodeId];
|
||||
}
|
||||
|
||||
node = node.original;
|
||||
}
|
||||
|
||||
return undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a custom text range to use when emitting comments.
|
||||
*/
|
||||
function setNodeCustomCommentRange(node: Node, range: TextRange) {
|
||||
nodeCustomCommentRange[getNodeId(node)] = range;
|
||||
}
|
||||
|
||||
/**
|
||||
* Records a hoisted variable declaration for the provided name within a lexical environment.
|
||||
*/
|
||||
|
||||
@@ -1137,6 +1137,8 @@ namespace ts {
|
||||
/*location*/ member
|
||||
);
|
||||
|
||||
setOriginalNode(statement, member);
|
||||
|
||||
// The location for the statement is used to emit comments only.
|
||||
// No source map should be emitted for this statement to align with the
|
||||
// old emitter.
|
||||
@@ -1203,8 +1205,8 @@ namespace ts {
|
||||
/*preferNewLine*/ true,
|
||||
/*location*/ undefined,
|
||||
/*descriptorLocations*/ {
|
||||
get: { location: getAccessor, emitFlags: NodeEmitFlags.NoSourceMap },
|
||||
set: { location: setAccessor, emitFlags: NodeEmitFlags.NoSourceMap }
|
||||
get: { location: getAccessor, emitFlags: NodeEmitFlags.NoSourceMap, original: getAccessor },
|
||||
set: { location: setAccessor, emitFlags: NodeEmitFlags.NoSourceMap, original: getAccessor }
|
||||
},
|
||||
context
|
||||
),
|
||||
|
||||
@@ -596,6 +596,8 @@ namespace ts {
|
||||
// ---------------------------------------------------------------------
|
||||
//
|
||||
|
||||
const location = getUndecoratedRange(node);
|
||||
|
||||
// ... = class ${name} ${heritageClauses} {
|
||||
// ${members}
|
||||
// }
|
||||
@@ -604,7 +606,7 @@ namespace ts {
|
||||
name,
|
||||
visitNodes(node.heritageClauses, visitor, isHeritageClause),
|
||||
transformClassMembers(node, hasExtendsClause),
|
||||
/*location*/ node
|
||||
/*location*/ location
|
||||
),
|
||||
node
|
||||
);
|
||||
@@ -637,7 +639,7 @@ namespace ts {
|
||||
classExpression = createAssignment(
|
||||
decoratedClassAlias,
|
||||
classExpression,
|
||||
/*location*/ node);
|
||||
/*location*/ location);
|
||||
}
|
||||
|
||||
// When emitting as a *default* export, we'll add a subsequent `export default` statement,
|
||||
@@ -655,10 +657,11 @@ namespace ts {
|
||||
bindingModifiers,
|
||||
createLetDeclarationList([
|
||||
createVariableDeclaration(
|
||||
name,
|
||||
getDeclarationName(node, /*allowComments*/ true),
|
||||
classExpression
|
||||
)
|
||||
])
|
||||
]),
|
||||
/*location*/ location
|
||||
),
|
||||
/*original*/ node
|
||||
)
|
||||
@@ -1304,12 +1307,16 @@ namespace ts {
|
||||
: createNull()
|
||||
: undefined;
|
||||
|
||||
return createDecorateHelper(
|
||||
const helper = createDecorateHelper(
|
||||
decoratorExpressions,
|
||||
prefix,
|
||||
memberName,
|
||||
descriptor
|
||||
descriptor,
|
||||
getUndecoratedRange(member)
|
||||
);
|
||||
|
||||
setNodeEmitFlags(helper, NodeEmitFlags.NoComments);
|
||||
return helper;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1355,7 +1362,9 @@ namespace ts {
|
||||
)
|
||||
);
|
||||
|
||||
return createAssignment(getDeclarationName(node), expression);
|
||||
const result = createAssignment(getDeclarationName(node), expression, getUndecoratedRange(node));
|
||||
setNodeEmitFlags(result, NodeEmitFlags.NoComments);
|
||||
return result;
|
||||
}
|
||||
// Emit the call to __decorate. Given the class:
|
||||
//
|
||||
@@ -1368,13 +1377,17 @@ namespace ts {
|
||||
// C = __decorate([dec], C);
|
||||
//
|
||||
else {
|
||||
return createAssignment(
|
||||
const result = createAssignment(
|
||||
getDeclarationName(node),
|
||||
createDecorateHelper(
|
||||
decoratorExpressions,
|
||||
getDeclarationName(node)
|
||||
)
|
||||
),
|
||||
getUndecoratedRange(node)
|
||||
);
|
||||
|
||||
setNodeEmitFlags(result, NodeEmitFlags.NoComments);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1398,7 +1411,9 @@ namespace ts {
|
||||
if (decorators) {
|
||||
expressions = [];
|
||||
for (const decorator of decorators) {
|
||||
expressions.push(createParamHelper(transformDecorator(decorator), parameterOffset));
|
||||
const helper = createParamHelper(transformDecorator(decorator), parameterOffset, /*location*/ decorator.expression);
|
||||
setNodeEmitFlags(helper, NodeEmitFlags.NoComments);
|
||||
expressions.push(helper);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1890,16 +1905,23 @@ namespace ts {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return setOriginalNode(
|
||||
createMethod(
|
||||
visitNodes(node.modifiers, visitor, isModifier),
|
||||
visitPropertyNameOfClassElement(node),
|
||||
visitNodes(node.parameters, visitor, isParameter),
|
||||
transformFunctionBody(node),
|
||||
node
|
||||
),
|
||||
node
|
||||
const method = createMethod(
|
||||
visitNodes(node.modifiers, visitor, isModifier),
|
||||
visitPropertyNameOfClassElement(node),
|
||||
visitNodes(node.parameters, visitor, isParameter),
|
||||
transformFunctionBody(node),
|
||||
/*location*/ getUndecoratedRange(node)
|
||||
);
|
||||
|
||||
setOriginalNode(method, node);
|
||||
|
||||
// While we emit the source map for the node after skipping the decorators,
|
||||
// we need to emit the comments for the original range.
|
||||
if (node.decorators) {
|
||||
context.setNodeCustomCommentRange(method, node);
|
||||
}
|
||||
|
||||
return method;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1926,12 +1948,22 @@ namespace ts {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return createGetAccessor(
|
||||
const accessor = createGetAccessor(
|
||||
visitNodes(node.modifiers, visitor, isModifier),
|
||||
visitPropertyNameOfClassElement(node),
|
||||
node.body ? visitEachChild(node.body, visitor, context) : createBlock([]),
|
||||
node
|
||||
/*location*/ getUndecoratedRange(node)
|
||||
);
|
||||
|
||||
setOriginalNode(accessor, node);
|
||||
|
||||
// While we emit the source map for the node after skipping the decorators,
|
||||
// we need to emit the comments for the original range.
|
||||
if (node.decorators) {
|
||||
context.setNodeCustomCommentRange(accessor, node);
|
||||
}
|
||||
|
||||
return accessor;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1948,13 +1980,23 @@ namespace ts {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return createSetAccessor(
|
||||
const accessor = createSetAccessor(
|
||||
visitNodes(node.modifiers, visitor, isModifier),
|
||||
visitPropertyNameOfClassElement(node),
|
||||
visitNode(firstOrUndefined(node.parameters), visitor, isParameter),
|
||||
node.body ? visitEachChild(node.body, visitor, context) : createBlock([]),
|
||||
node
|
||||
/*location*/ getUndecoratedRange(node)
|
||||
);
|
||||
|
||||
setOriginalNode(accessor, node);
|
||||
|
||||
// While we emit the source map for the node after skipping the decorators,
|
||||
// we need to emit the comments for the original range.
|
||||
if (node.decorators) {
|
||||
context.setNodeCustomCommentRange(accessor, node);
|
||||
}
|
||||
|
||||
return accessor;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2137,11 +2179,16 @@ namespace ts {
|
||||
if (node.name && (node.name as Identifier).originalKeywordKind === SyntaxKind.ThisKeyword) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const clone = getMutableClone(node);
|
||||
clone.decorators = undefined;
|
||||
clone.modifiers = undefined;
|
||||
clone.questionToken = undefined;
|
||||
clone.type = undefined;
|
||||
if (node.decorators) {
|
||||
setTextRange(clone, getUndecoratedRange(node));
|
||||
}
|
||||
|
||||
aggregateTransformFlags(clone);
|
||||
return visitEachChild(clone, visitor, context);
|
||||
}
|
||||
|
||||
@@ -2966,6 +2966,8 @@ namespace ts {
|
||||
getEmitHost(): EmitHost;
|
||||
getNodeEmitFlags(node: Node): NodeEmitFlags;
|
||||
setNodeEmitFlags<T extends Node>(node: T, flags: NodeEmitFlags): T;
|
||||
getNodeCustomCommentRange(node: Node): TextRange;
|
||||
setNodeCustomCommentRange(node: Node, range: TextRange): void;
|
||||
hoistFunctionDeclaration(node: FunctionDeclaration): void;
|
||||
hoistVariableDeclaration(node: Identifier): void;
|
||||
|
||||
|
||||
@@ -3061,6 +3061,15 @@ namespace ts {
|
||||
return { pos, end: range.end };
|
||||
}
|
||||
|
||||
/**
|
||||
* Moves the start position of a range past any decorators.
|
||||
*/
|
||||
export function getUndecoratedRange(node: Node): TextRange {
|
||||
return node.decorators && node.decorators.length > 0
|
||||
? moveRangePos(node, node.decorators.end)
|
||||
: node;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines whether a TextRange has the same start and end positions.
|
||||
*
|
||||
|
||||
+1
-1
@@ -1,2 +1,2 @@
|
||||
//// [sourceMapValidationClassWithDefaultConstructorAndCapturedThisStatement.js.map]
|
||||
{"version":3,"file":"sourceMapValidationClassWithDefaultConstructorAndCapturedThisStatement.js","sourceRoot":"","sources":["sourceMapValidationClassWithDefaultConstructorAndCapturedThisStatement.ts"],"names":[],"mappings":"AAAA;IAAA;QAAA,iBAGC;QAFU,MAAC,GAAG,EAAE,CAAC;QACP,YAAO,GAAG,cAAM,OAAA,KAAI,CAAC,CAAC,EAAN,CAAM,CAAC;IAClC,CAAC;IAAD,cAAC;AAAD,CAAC,AAHD,IAGC"}
|
||||
{"version":3,"file":"sourceMapValidationClassWithDefaultConstructorAndCapturedThisStatement.js","sourceRoot":"","sources":["sourceMapValidationClassWithDefaultConstructorAndCapturedThisStatement.ts"],"names":[],"mappings":"AAAA;IAAA;QAAA,iBAGC;QAFU,MAAC,GAAG,EAAE,CAAC;QACP,YAAO,GAAG,cAAM,OAAA,KAAI,CAAC,CAAC,GAAA,CAAC;IAClC,CAAC;IAAD,cAAC;AAAD,CAAC,AAHD,IAGC"}
|
||||
+5
-8
@@ -58,9 +58,8 @@ sourceFile:sourceMapValidationClassWithDefaultConstructorAndCapturedThisStatemen
|
||||
6 > ^^^^^
|
||||
7 > ^
|
||||
8 > ^
|
||||
9 > ^^
|
||||
10> ^
|
||||
11> ^
|
||||
9 > ^^^
|
||||
10> ^
|
||||
1->
|
||||
> public
|
||||
2 > returnA
|
||||
@@ -71,8 +70,7 @@ sourceFile:sourceMapValidationClassWithDefaultConstructorAndCapturedThisStatemen
|
||||
7 > .
|
||||
8 > a
|
||||
9 >
|
||||
10> this.a
|
||||
11> ;
|
||||
10> ;
|
||||
1->Emitted(5, 9) Source(3, 12) + SourceIndex(0)
|
||||
2 >Emitted(5, 21) Source(3, 19) + SourceIndex(0)
|
||||
3 >Emitted(5, 24) Source(3, 22) + SourceIndex(0)
|
||||
@@ -81,9 +79,8 @@ sourceFile:sourceMapValidationClassWithDefaultConstructorAndCapturedThisStatemen
|
||||
6 >Emitted(5, 50) Source(3, 32) + SourceIndex(0)
|
||||
7 >Emitted(5, 51) Source(3, 33) + SourceIndex(0)
|
||||
8 >Emitted(5, 52) Source(3, 34) + SourceIndex(0)
|
||||
9 >Emitted(5, 54) Source(3, 28) + SourceIndex(0)
|
||||
10>Emitted(5, 55) Source(3, 34) + SourceIndex(0)
|
||||
11>Emitted(5, 56) Source(3, 35) + SourceIndex(0)
|
||||
9 >Emitted(5, 55) Source(3, 34) + SourceIndex(0)
|
||||
10>Emitted(5, 56) Source(3, 35) + SourceIndex(0)
|
||||
---
|
||||
>>> }
|
||||
1 >^^^^
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
//// [sourceMapValidationDecorators.js.map]
|
||||
{"version":3,"file":"sourceMapValidationDecorators.js","sourceRoot":"","sources":["sourceMapValidationDecorators.ts"],"names":[],"mappings":";;;;;;;;;AASA;IACI,iBAGS,QAAgB;QAIvB,WAAc;aAAd,WAAc,CAAd,sBAAc,CAAd,IAAc;YAAd,0BAAc;;QAJP,aAAQ,GAAR,QAAQ,CAAQ;IAKzB,CAAC;I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CAAC;IAC5C,CAAC;IAUO,oBAAE,GAAV,UAGE,CAAS;QACP,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC;IACzB,CAAC;IAID,sBAAI,8BAAS;aAAb;YACI,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC;QACzB,CAAC;aAED,UAGE,SAAiB;YACf,IAAI,CAAC,QAAQ,GAAG,SAAS,CAAC;QAC9B,CAAC;;;OAPA;IAQL,cAAC;AAAD,CAAC,AA5CD,IA4CC;AArBkB,UAAE,GAAW,EAAE,CAAC;AAV/B;IAFC,kBAAkB;IAClB,kBAAkB,CAAC,EAAE,CAAC;oCAGtB;AAID;IAFC,kBAAkB;IAClB,kBAAkB,CAAC,EAAE,CAAC;kCACL;AAMlB;IACG,WAAA,mBAAmB,CAAA;IACnB,WAAA,mBAAmB,CAAC,EAAE,CAAC,CAAA;iCAGzB;AAID;IAFC,kBAAkB;IAClB,kBAAkB,CAAC,EAAE,CAAC;IAMpB,WAAA,mBAAmB,CAAA;IACnB,WAAA,mBAAmB,CAAC,EAAE,CAAC,CAAA;wCAJzB;AAbD;IAFC,kBAAkB;IAClB,kBAAkB,CAAC,EAAE,CAAC;yBACQ;AAvBnC;IAFC,eAAe;IACf,eAAe,CAAC,EAAE,CAAC;IAGb,WAAA,mBAAmB,CAAA;IACnB,WAAA,mBAAmB,CAAC,EAAE,CAAC,CAAA;IAGvB,WAAA,mBAAmB,CAAA;IACnB,WAAA,mBAAmB,CAAC,EAAE,CAAC,CAAA;WAqC7B"}
|
||||
@@ -380,13 +380,60 @@ sourceFile:sourceMapValidationDecorators.ts
|
||||
1 >
|
||||
2 >^
|
||||
3 >
|
||||
4 > ^^^^^^^^^^^^^^^^->
|
||||
4 > ^^^^
|
||||
5 > ^^^^^^^^^^^^->
|
||||
1 >
|
||||
2 >}
|
||||
3 >
|
||||
4 > class Greeter {
|
||||
> constructor(
|
||||
> @ParameterDecorator1
|
||||
> @ParameterDecorator2(20)
|
||||
> public greeting: string,
|
||||
>
|
||||
> @ParameterDecorator1
|
||||
> @ParameterDecorator2(30)
|
||||
> ...b: string[]) {
|
||||
> }
|
||||
>
|
||||
> @PropertyDecorator1
|
||||
> @PropertyDecorator2(40)
|
||||
> greet() {
|
||||
> return "<h1>" + this.greeting + "</h1>";
|
||||
> }
|
||||
>
|
||||
> @PropertyDecorator1
|
||||
> @PropertyDecorator2(50)
|
||||
> private x: string;
|
||||
>
|
||||
> @PropertyDecorator1
|
||||
> @PropertyDecorator2(60)
|
||||
> private static x1: number = 10;
|
||||
>
|
||||
> private fn(
|
||||
> @ParameterDecorator1
|
||||
> @ParameterDecorator2(70)
|
||||
> x: number) {
|
||||
> return this.greeting;
|
||||
> }
|
||||
>
|
||||
> @PropertyDecorator1
|
||||
> @PropertyDecorator2(80)
|
||||
> get greetings() {
|
||||
> return this.greeting;
|
||||
> }
|
||||
>
|
||||
> set greetings(
|
||||
> @ParameterDecorator1
|
||||
> @ParameterDecorator2(90)
|
||||
> greetings: string) {
|
||||
> this.greeting = greetings;
|
||||
> }
|
||||
> }
|
||||
1 >Emitted(35, 1) Source(54, 1) + SourceIndex(0)
|
||||
2 >Emitted(35, 2) Source(54, 2) + SourceIndex(0)
|
||||
3 >Emitted(35, 2) Source(10, 1) + SourceIndex(0)
|
||||
4 >Emitted(35, 6) Source(54, 2) + SourceIndex(0)
|
||||
---
|
||||
>>>Greeter.x1 = 10;
|
||||
1->
|
||||
@@ -394,30 +441,7 @@ sourceFile:sourceMapValidationDecorators.ts
|
||||
3 > ^^^
|
||||
4 > ^^
|
||||
5 > ^
|
||||
1->class Greeter {
|
||||
> constructor(
|
||||
> @ParameterDecorator1
|
||||
> @ParameterDecorator2(20)
|
||||
> public greeting: string,
|
||||
>
|
||||
> @ParameterDecorator1
|
||||
> @ParameterDecorator2(30)
|
||||
> ...b: string[]) {
|
||||
> }
|
||||
>
|
||||
> @PropertyDecorator1
|
||||
> @PropertyDecorator2(40)
|
||||
> greet() {
|
||||
> return "<h1>" + this.greeting + "</h1>";
|
||||
> }
|
||||
>
|
||||
> @PropertyDecorator1
|
||||
> @PropertyDecorator2(50)
|
||||
> private x: string;
|
||||
>
|
||||
> @PropertyDecorator1
|
||||
> @PropertyDecorator2(60)
|
||||
> private static
|
||||
1->
|
||||
2 >x1
|
||||
3 > : number =
|
||||
4 > 10
|
||||
@@ -432,13 +456,13 @@ sourceFile:sourceMapValidationDecorators.ts
|
||||
1 >
|
||||
2 >^^^^^^^^^^^^^^^^^^^^^^^^->
|
||||
1 >
|
||||
1 >Emitted(37, 1) Source(21, 5) + SourceIndex(0)
|
||||
1 >Emitted(37, 1) Source(23, 5) + SourceIndex(0)
|
||||
---
|
||||
>>> PropertyDecorator1,
|
||||
1->^^^^
|
||||
2 > ^^^^^^^^^^^^^^^^^^
|
||||
3 > ^^^^^->
|
||||
1->@
|
||||
1->
|
||||
2 > PropertyDecorator1
|
||||
1->Emitted(38, 5) Source(21, 6) + SourceIndex(0)
|
||||
2 >Emitted(38, 23) Source(21, 24) + SourceIndex(0)
|
||||
@@ -464,25 +488,27 @@ sourceFile:sourceMapValidationDecorators.ts
|
||||
---
|
||||
>>>], Greeter.prototype, "greet", null);
|
||||
1->^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
1->
|
||||
1->Emitted(40, 37) Source(22, 28) + SourceIndex(0)
|
||||
1->
|
||||
> greet() {
|
||||
> return "<h1>" + this.greeting + "</h1>";
|
||||
> }
|
||||
1->Emitted(40, 37) Source(25, 6) + SourceIndex(0)
|
||||
---
|
||||
>>>__decorate([
|
||||
1 >
|
||||
2 >^^^^^^^^^^^^^^^^^^^^^^^^->
|
||||
1 >
|
||||
> greet() {
|
||||
> return "<h1>" + this.greeting + "</h1>";
|
||||
> }
|
||||
>
|
||||
> @PropertyDecorator1
|
||||
> @PropertyDecorator2(50)
|
||||
>
|
||||
1 >Emitted(41, 1) Source(27, 5) + SourceIndex(0)
|
||||
1 >Emitted(41, 1) Source(29, 5) + SourceIndex(0)
|
||||
---
|
||||
>>> PropertyDecorator1,
|
||||
1->^^^^
|
||||
2 > ^^^^^^^^^^^^^^^^^^
|
||||
3 > ^^^^^->
|
||||
1->@
|
||||
1->
|
||||
2 > PropertyDecorator1
|
||||
1->Emitted(42, 5) Source(27, 6) + SourceIndex(0)
|
||||
2 >Emitted(42, 23) Source(27, 24) + SourceIndex(0)
|
||||
@@ -508,71 +534,85 @@ sourceFile:sourceMapValidationDecorators.ts
|
||||
---
|
||||
>>>], Greeter.prototype, "x", void 0);
|
||||
1->^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
1->
|
||||
1->Emitted(44, 35) Source(28, 28) + SourceIndex(0)
|
||||
1->
|
||||
> private x: string;
|
||||
1->Emitted(44, 35) Source(29, 23) + SourceIndex(0)
|
||||
---
|
||||
>>>__decorate([
|
||||
1 >
|
||||
2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
|
||||
1 >
|
||||
> private x: string;
|
||||
>
|
||||
> @PropertyDecorator1
|
||||
> @PropertyDecorator2(60)
|
||||
> private static x1: number = 10;
|
||||
>
|
||||
> private fn(
|
||||
>
|
||||
1 >Emitted(45, 1) Source(36, 7) + SourceIndex(0)
|
||||
>
|
||||
1 >Emitted(45, 1) Source(35, 5) + SourceIndex(0)
|
||||
---
|
||||
>>> __param(0, ParameterDecorator1),
|
||||
1->^^^^^^^^^^^^^^^
|
||||
2 > ^^^^^^^^^^^^^^^^^^^
|
||||
3 > ^^^^^^->
|
||||
1->@
|
||||
2 > ParameterDecorator1
|
||||
1->Emitted(46, 16) Source(36, 8) + SourceIndex(0)
|
||||
2 >Emitted(46, 35) Source(36, 27) + SourceIndex(0)
|
||||
1->^^^^
|
||||
2 > ^^^^^^^^^^^
|
||||
3 > ^^^^^^^^^^^^^^^^^^^
|
||||
4 > ^
|
||||
5 > ^^^^^->
|
||||
1->private fn(
|
||||
> @
|
||||
2 >
|
||||
3 > ParameterDecorator1
|
||||
4 >
|
||||
1->Emitted(46, 5) Source(36, 8) + SourceIndex(0)
|
||||
2 >Emitted(46, 16) Source(36, 8) + SourceIndex(0)
|
||||
3 >Emitted(46, 35) Source(36, 27) + SourceIndex(0)
|
||||
4 >Emitted(46, 36) Source(36, 27) + SourceIndex(0)
|
||||
---
|
||||
>>> __param(0, ParameterDecorator2(70))
|
||||
1->^^^^^^^^^^^^^^^
|
||||
2 > ^^^^^^^^^^^^^^^^^^^
|
||||
3 > ^
|
||||
4 > ^^
|
||||
5 > ^
|
||||
1->^^^^
|
||||
2 > ^^^^^^^^^^^
|
||||
3 > ^^^^^^^^^^^^^^^^^^^
|
||||
4 > ^
|
||||
5 > ^^
|
||||
6 > ^
|
||||
7 > ^
|
||||
1->
|
||||
> @
|
||||
2 > ParameterDecorator2
|
||||
3 > (
|
||||
4 > 70
|
||||
5 > )
|
||||
1->Emitted(47, 16) Source(37, 8) + SourceIndex(0)
|
||||
2 >Emitted(47, 35) Source(37, 27) + SourceIndex(0)
|
||||
3 >Emitted(47, 36) Source(37, 28) + SourceIndex(0)
|
||||
4 >Emitted(47, 38) Source(37, 30) + SourceIndex(0)
|
||||
5 >Emitted(47, 39) Source(37, 31) + SourceIndex(0)
|
||||
2 >
|
||||
3 > ParameterDecorator2
|
||||
4 > (
|
||||
5 > 70
|
||||
6 > )
|
||||
7 >
|
||||
1->Emitted(47, 5) Source(37, 8) + SourceIndex(0)
|
||||
2 >Emitted(47, 16) Source(37, 8) + SourceIndex(0)
|
||||
3 >Emitted(47, 35) Source(37, 27) + SourceIndex(0)
|
||||
4 >Emitted(47, 36) Source(37, 28) + SourceIndex(0)
|
||||
5 >Emitted(47, 38) Source(37, 30) + SourceIndex(0)
|
||||
6 >Emitted(47, 39) Source(37, 31) + SourceIndex(0)
|
||||
7 >Emitted(47, 40) Source(37, 31) + SourceIndex(0)
|
||||
---
|
||||
>>>], Greeter.prototype, "fn", null);
|
||||
1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
1 >
|
||||
1 >Emitted(48, 34) Source(37, 31) + SourceIndex(0)
|
||||
1 >
|
||||
> x: number) {
|
||||
> return this.greeting;
|
||||
> }
|
||||
1 >Emitted(48, 34) Source(40, 6) + SourceIndex(0)
|
||||
---
|
||||
>>>__decorate([
|
||||
1 >
|
||||
2 >^^^^^^^^^^^^^^^^^^^^^^^^->
|
||||
1 >
|
||||
> x: number) {
|
||||
> return this.greeting;
|
||||
> }
|
||||
1 >
|
||||
>
|
||||
> @PropertyDecorator1
|
||||
> @PropertyDecorator2(80)
|
||||
>
|
||||
1 >Emitted(49, 1) Source(42, 5) + SourceIndex(0)
|
||||
1 >Emitted(49, 1) Source(44, 5) + SourceIndex(0)
|
||||
---
|
||||
>>> PropertyDecorator1,
|
||||
1->^^^^
|
||||
2 > ^^^^^^^^^^^^^^^^^^
|
||||
3 > ^^^^^^->
|
||||
1->@
|
||||
1->
|
||||
2 > PropertyDecorator1
|
||||
1->Emitted(50, 5) Source(42, 6) + SourceIndex(0)
|
||||
2 >Emitted(50, 23) Source(42, 24) + SourceIndex(0)
|
||||
@@ -597,9 +637,11 @@ sourceFile:sourceMapValidationDecorators.ts
|
||||
5 >Emitted(51, 27) Source(43, 28) + SourceIndex(0)
|
||||
---
|
||||
>>> __param(0, ParameterDecorator1),
|
||||
1->^^^^^^^^^^^^^^^
|
||||
2 > ^^^^^^^^^^^^^^^^^^^
|
||||
3 > ^^^^^^->
|
||||
1->^^^^
|
||||
2 > ^^^^^^^^^^^
|
||||
3 > ^^^^^^^^^^^^^^^^^^^
|
||||
4 > ^
|
||||
5 > ^^^^^->
|
||||
1->
|
||||
> get greetings() {
|
||||
> return this.greeting;
|
||||
@@ -607,45 +649,55 @@ sourceFile:sourceMapValidationDecorators.ts
|
||||
>
|
||||
> set greetings(
|
||||
> @
|
||||
2 > ParameterDecorator1
|
||||
1->Emitted(52, 16) Source(49, 8) + SourceIndex(0)
|
||||
2 >Emitted(52, 35) Source(49, 27) + SourceIndex(0)
|
||||
2 >
|
||||
3 > ParameterDecorator1
|
||||
4 >
|
||||
1->Emitted(52, 5) Source(49, 8) + SourceIndex(0)
|
||||
2 >Emitted(52, 16) Source(49, 8) + SourceIndex(0)
|
||||
3 >Emitted(52, 35) Source(49, 27) + SourceIndex(0)
|
||||
4 >Emitted(52, 36) Source(49, 27) + SourceIndex(0)
|
||||
---
|
||||
>>> __param(0, ParameterDecorator2(90))
|
||||
1->^^^^^^^^^^^^^^^
|
||||
2 > ^^^^^^^^^^^^^^^^^^^
|
||||
3 > ^
|
||||
4 > ^^
|
||||
5 > ^
|
||||
6 > ^^^^->
|
||||
1->^^^^
|
||||
2 > ^^^^^^^^^^^
|
||||
3 > ^^^^^^^^^^^^^^^^^^^
|
||||
4 > ^
|
||||
5 > ^^
|
||||
6 > ^
|
||||
7 > ^
|
||||
8 > ^^^->
|
||||
1->
|
||||
> @
|
||||
2 > ParameterDecorator2
|
||||
3 > (
|
||||
4 > 90
|
||||
5 > )
|
||||
1->Emitted(53, 16) Source(50, 8) + SourceIndex(0)
|
||||
2 >Emitted(53, 35) Source(50, 27) + SourceIndex(0)
|
||||
3 >Emitted(53, 36) Source(50, 28) + SourceIndex(0)
|
||||
4 >Emitted(53, 38) Source(50, 30) + SourceIndex(0)
|
||||
5 >Emitted(53, 39) Source(50, 31) + SourceIndex(0)
|
||||
2 >
|
||||
3 > ParameterDecorator2
|
||||
4 > (
|
||||
5 > 90
|
||||
6 > )
|
||||
7 >
|
||||
1->Emitted(53, 5) Source(50, 8) + SourceIndex(0)
|
||||
2 >Emitted(53, 16) Source(50, 8) + SourceIndex(0)
|
||||
3 >Emitted(53, 35) Source(50, 27) + SourceIndex(0)
|
||||
4 >Emitted(53, 36) Source(50, 28) + SourceIndex(0)
|
||||
5 >Emitted(53, 38) Source(50, 30) + SourceIndex(0)
|
||||
6 >Emitted(53, 39) Source(50, 31) + SourceIndex(0)
|
||||
7 >Emitted(53, 40) Source(50, 31) + SourceIndex(0)
|
||||
---
|
||||
>>>], Greeter.prototype, "greetings", null);
|
||||
1->^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
1->
|
||||
1->Emitted(54, 41) Source(43, 28) + SourceIndex(0)
|
||||
1->Emitted(54, 41) Source(46, 6) + SourceIndex(0)
|
||||
---
|
||||
>>>__decorate([
|
||||
1 >
|
||||
2 >^^^^^^^^^^^^^^^^^^^^^^^^->
|
||||
1 >
|
||||
1 >Emitted(55, 1) Source(31, 5) + SourceIndex(0)
|
||||
1 >Emitted(55, 1) Source(33, 5) + SourceIndex(0)
|
||||
---
|
||||
>>> PropertyDecorator1,
|
||||
1->^^^^
|
||||
2 > ^^^^^^^^^^^^^^^^^^
|
||||
3 > ^^^^^->
|
||||
1->@
|
||||
1->
|
||||
2 > PropertyDecorator1
|
||||
1->Emitted(56, 5) Source(31, 6) + SourceIndex(0)
|
||||
2 >Emitted(56, 23) Source(31, 24) + SourceIndex(0)
|
||||
@@ -671,20 +723,21 @@ sourceFile:sourceMapValidationDecorators.ts
|
||||
---
|
||||
>>>], Greeter, "x1", void 0);
|
||||
1->^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
1->
|
||||
1->Emitted(58, 26) Source(32, 28) + SourceIndex(0)
|
||||
1->
|
||||
> private static x1: number = 10;
|
||||
1->Emitted(58, 26) Source(33, 36) + SourceIndex(0)
|
||||
---
|
||||
>>>Greeter = __decorate([
|
||||
1 >
|
||||
2 >^^^^^^^^^^^^^^^^^^^^^->
|
||||
1 >
|
||||
1 >Emitted(59, 1) Source(8, 1) + SourceIndex(0)
|
||||
1 >Emitted(59, 1) Source(10, 1) + SourceIndex(0)
|
||||
---
|
||||
>>> ClassDecorator1,
|
||||
1->^^^^
|
||||
2 > ^^^^^^^^^^^^^^^
|
||||
3 > ^^^^^^->
|
||||
1->@
|
||||
1->
|
||||
2 > ClassDecorator1
|
||||
1->Emitted(60, 5) Source(8, 2) + SourceIndex(0)
|
||||
2 >Emitted(60, 20) Source(8, 17) + SourceIndex(0)
|
||||
@@ -709,82 +762,93 @@ sourceFile:sourceMapValidationDecorators.ts
|
||||
5 >Emitted(61, 24) Source(9, 21) + SourceIndex(0)
|
||||
---
|
||||
>>> __param(0, ParameterDecorator1),
|
||||
1->^^^^^^^^^^^^^^^
|
||||
2 > ^^^^^^^^^^^^^^^^^^^
|
||||
3 > ^^^^^^^->
|
||||
1->^^^^
|
||||
2 > ^^^^^^^^^^^
|
||||
3 > ^^^^^^^^^^^^^^^^^^^
|
||||
4 > ^
|
||||
5 > ^^^^^^->
|
||||
1->
|
||||
>class Greeter {
|
||||
> constructor(
|
||||
> @
|
||||
2 > ParameterDecorator1
|
||||
1->Emitted(62, 16) Source(12, 8) + SourceIndex(0)
|
||||
2 >Emitted(62, 35) Source(12, 27) + SourceIndex(0)
|
||||
2 >
|
||||
3 > ParameterDecorator1
|
||||
4 >
|
||||
1->Emitted(62, 5) Source(12, 8) + SourceIndex(0)
|
||||
2 >Emitted(62, 16) Source(12, 8) + SourceIndex(0)
|
||||
3 >Emitted(62, 35) Source(12, 27) + SourceIndex(0)
|
||||
4 >Emitted(62, 36) Source(12, 27) + SourceIndex(0)
|
||||
---
|
||||
>>> __param(0, ParameterDecorator2(20)),
|
||||
1->^^^^^^^^^^^^^^^
|
||||
2 > ^^^^^^^^^^^^^^^^^^^
|
||||
3 > ^
|
||||
4 > ^^
|
||||
5 > ^
|
||||
1->^^^^
|
||||
2 > ^^^^^^^^^^^
|
||||
3 > ^^^^^^^^^^^^^^^^^^^
|
||||
4 > ^
|
||||
5 > ^^
|
||||
6 > ^
|
||||
7 > ^
|
||||
1->
|
||||
> @
|
||||
2 > ParameterDecorator2
|
||||
3 > (
|
||||
4 > 20
|
||||
5 > )
|
||||
1->Emitted(63, 16) Source(13, 8) + SourceIndex(0)
|
||||
2 >Emitted(63, 35) Source(13, 27) + SourceIndex(0)
|
||||
3 >Emitted(63, 36) Source(13, 28) + SourceIndex(0)
|
||||
4 >Emitted(63, 38) Source(13, 30) + SourceIndex(0)
|
||||
5 >Emitted(63, 39) Source(13, 31) + SourceIndex(0)
|
||||
2 >
|
||||
3 > ParameterDecorator2
|
||||
4 > (
|
||||
5 > 20
|
||||
6 > )
|
||||
7 >
|
||||
1->Emitted(63, 5) Source(13, 8) + SourceIndex(0)
|
||||
2 >Emitted(63, 16) Source(13, 8) + SourceIndex(0)
|
||||
3 >Emitted(63, 35) Source(13, 27) + SourceIndex(0)
|
||||
4 >Emitted(63, 36) Source(13, 28) + SourceIndex(0)
|
||||
5 >Emitted(63, 38) Source(13, 30) + SourceIndex(0)
|
||||
6 >Emitted(63, 39) Source(13, 31) + SourceIndex(0)
|
||||
7 >Emitted(63, 40) Source(13, 31) + SourceIndex(0)
|
||||
---
|
||||
>>> __param(1, ParameterDecorator1),
|
||||
1 >^^^^^^^^^^^^^^^
|
||||
2 > ^^^^^^^^^^^^^^^^^^^
|
||||
3 > ^^^^^^->
|
||||
1 >^^^^
|
||||
2 > ^^^^^^^^^^^
|
||||
3 > ^^^^^^^^^^^^^^^^^^^
|
||||
4 > ^
|
||||
5 > ^^^^^->
|
||||
1 >
|
||||
> public greeting: string,
|
||||
>
|
||||
> @
|
||||
2 > ParameterDecorator1
|
||||
1 >Emitted(64, 16) Source(16, 8) + SourceIndex(0)
|
||||
2 >Emitted(64, 35) Source(16, 27) + SourceIndex(0)
|
||||
2 >
|
||||
3 > ParameterDecorator1
|
||||
4 >
|
||||
1 >Emitted(64, 5) Source(16, 8) + SourceIndex(0)
|
||||
2 >Emitted(64, 16) Source(16, 8) + SourceIndex(0)
|
||||
3 >Emitted(64, 35) Source(16, 27) + SourceIndex(0)
|
||||
4 >Emitted(64, 36) Source(16, 27) + SourceIndex(0)
|
||||
---
|
||||
>>> __param(1, ParameterDecorator2(30))
|
||||
1->^^^^^^^^^^^^^^^
|
||||
2 > ^^^^^^^^^^^^^^^^^^^
|
||||
3 > ^
|
||||
4 > ^^
|
||||
5 > ^
|
||||
1->^^^^
|
||||
2 > ^^^^^^^^^^^
|
||||
3 > ^^^^^^^^^^^^^^^^^^^
|
||||
4 > ^
|
||||
5 > ^^
|
||||
6 > ^
|
||||
7 > ^
|
||||
1->
|
||||
> @
|
||||
2 > ParameterDecorator2
|
||||
3 > (
|
||||
4 > 30
|
||||
5 > )
|
||||
1->Emitted(65, 16) Source(17, 8) + SourceIndex(0)
|
||||
2 >Emitted(65, 35) Source(17, 27) + SourceIndex(0)
|
||||
3 >Emitted(65, 36) Source(17, 28) + SourceIndex(0)
|
||||
4 >Emitted(65, 38) Source(17, 30) + SourceIndex(0)
|
||||
5 >Emitted(65, 39) Source(17, 31) + SourceIndex(0)
|
||||
2 >
|
||||
3 > ParameterDecorator2
|
||||
4 > (
|
||||
5 > 30
|
||||
6 > )
|
||||
7 >
|
||||
1->Emitted(65, 5) Source(17, 8) + SourceIndex(0)
|
||||
2 >Emitted(65, 16) Source(17, 8) + SourceIndex(0)
|
||||
3 >Emitted(65, 35) Source(17, 27) + SourceIndex(0)
|
||||
4 >Emitted(65, 36) Source(17, 28) + SourceIndex(0)
|
||||
5 >Emitted(65, 38) Source(17, 30) + SourceIndex(0)
|
||||
6 >Emitted(65, 39) Source(17, 31) + SourceIndex(0)
|
||||
7 >Emitted(65, 40) Source(17, 31) + SourceIndex(0)
|
||||
---
|
||||
>>>], Greeter);
|
||||
1 >^^^^^^^^^^^
|
||||
2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
|
||||
1 >
|
||||
1 >Emitted(66, 12) Source(9, 21) + SourceIndex(0)
|
||||
---
|
||||
>>>//# sourceMappingURL=sourceMapValidationDecorators.js.map1->
|
||||
2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^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^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
|
||||
1->
|
||||
>class Greeter {
|
||||
> constructor(
|
||||
> @ParameterDecorator1
|
||||
> @ParameterDecorator2(20)
|
||||
> public greeting: string,
|
||||
>
|
||||
> @ParameterDecorator1
|
||||
> @ParameterDecorator2(30)
|
||||
1 >
|
||||
> ...b: string[]) {
|
||||
> }
|
||||
>
|
||||
@@ -822,5 +886,6 @@ sourceFile:sourceMapValidationDecorators.ts
|
||||
> this.greeting = greetings;
|
||||
> }
|
||||
>}
|
||||
1->Emitted(67, 1) Source(54, 2) + SourceIndex(0)
|
||||
---
|
||||
1 >Emitted(66, 12) Source(54, 2) + SourceIndex(0)
|
||||
---
|
||||
>>>//# sourceMappingURL=sourceMapValidationDecorators.js.map
|
||||
Reference in New Issue
Block a user