mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-15 11:35:42 -06:00
Merge pull request #7940 from Microsoft/transforms-fix7914
[Transforms] Emits class name with comments.
This commit is contained in:
commit
f61e122f9b
@ -549,7 +549,7 @@ namespace ts {
|
||||
/*modifiers*/ undefined,
|
||||
createVariableDeclarationList([
|
||||
createVariableDeclaration(
|
||||
getDeclarationName(node),
|
||||
getDeclarationName(node, /*allowComments*/ true),
|
||||
transformClassLikeDeclarationToExpression(node)
|
||||
)
|
||||
]),
|
||||
@ -2686,8 +2686,25 @@ namespace ts {
|
||||
return node;
|
||||
}
|
||||
|
||||
function getDeclarationName(node: ClassExpression | ClassDeclaration | FunctionDeclaration) {
|
||||
return node.name ? getSynthesizedClone(node.name) : getGeneratedNameForNode(node);
|
||||
/**
|
||||
* Gets the name of a declaration, without source map or comments.
|
||||
*
|
||||
* @param node The declaration.
|
||||
* @param allowComments Allow comments for the name.
|
||||
*/
|
||||
function getDeclarationName(node: DeclarationStatement | ClassExpression, allowComments?: boolean) {
|
||||
if (node.name) {
|
||||
const name = getMutableClone(node.name);
|
||||
let flags = NodeEmitFlags.NoSourceMap;
|
||||
if (!allowComments) {
|
||||
flags |= NodeEmitFlags.NoComments;
|
||||
}
|
||||
|
||||
setNodeEmitFlags(name, flags | getNodeEmitFlags(name));
|
||||
return name;
|
||||
}
|
||||
|
||||
return getGeneratedNameForNode(node);
|
||||
}
|
||||
|
||||
function getClassMemberPrefix(node: ClassExpression | ClassDeclaration, member: ClassElement) {
|
||||
|
||||
@ -132,11 +132,11 @@ var WinJS;
|
||||
var Errors;
|
||||
(function (Errors) {
|
||||
var ConnectionError /* extends Error */ = (function () {
|
||||
function ConnectionError /* extends Error */(request) {
|
||||
function ConnectionError(request) {
|
||||
}
|
||||
return ConnectionError /* extends Error */;
|
||||
return ConnectionError;
|
||||
}());
|
||||
Errors.ConnectionError /* extends Error */ = ConnectionError /* extends Error */;
|
||||
Errors.ConnectionError = ConnectionError;
|
||||
})(Errors || (Errors = {}));
|
||||
var FileService = (function () {
|
||||
function FileService() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user