Handle comments at the beginning of ClassProperty value (#1692)

We didn't call the helper that handles this use case
This commit is contained in:
Christopher Chedeau authored and GitHub committed 2017-05-23 17:13:40 -07:00
1 parent 9af859f0b2
commit 5671f32c07
3 files changed
+33 -1

No files matched your search

+9 -1
View File
@@ -1631,7 +1631,15 @@ function genericPrintNoParens(path, options, print, args) {
parts.push(": ", path.call(print, "typeAnnotation"));
}
if (n.value) {
parts.push(" = ", path.call(print, "value"));
parts.push(
" =",
printAssignmentRight(
n.value,
path.call(print, "value"),
false, // canBreak
options
)
);
}
parts.push(semi);
@@ -33,6 +33,14 @@ class x {
// do nothing
}
}
class X {
TEMPLATE =
// tab index is needed so we can focus, which is needed for keyboard events
'<div class="ag-large-text" tabindex="0">' +
'<div class="ag-large-textarea"></div>' +
'</div>';
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// comment 1
// comment 2
@@ -69,4 +77,12 @@ class x {
}
}
class X {
TEMPLATE =
// tab index is needed so we can focus, which is needed for keyboard events
'<div class="ag-large-text" tabindex="0">' +
'<div class="ag-large-textarea"></div>' +
"</div>";
}
`;
+8
View File
@@ -30,3 +30,11 @@ class x {
// do nothing
}
}
class X {
TEMPLATE =
// tab index is needed so we can focus, which is needed for keyboard events
'<div class="ag-large-text" tabindex="0">' +
'<div class="ag-large-textarea"></div>' +
'</div>';
}