Add support for flow mixins when using babylon (#3391)

master
Kevin Gibbons 2017-12-04 13:58:14 -08:00 committed by Lucas Azzola
parent a05811f8eb
commit 8e377a1e56
4 changed files with 21 additions and 0 deletions

View File

@ -3630,6 +3630,14 @@ function printClass(path, options, print) {
);
}
if (n["mixins"] && n["mixins"].length > 0) {
partsGroup.push(
line,
"mixins ",
group(indent(join(concat([",", line]), path.map(print, "mixins"))))
);
}
if (partsGroup.length > 0) {
parts.push(group(indent(concat(partsGroup))));
}

View File

@ -0,0 +1,10 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`type.js 1`] = `
declare class A<T> extends B<T> mixins C<T> {}
declare class D<T> mixins C<T> {}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
declare class A<T> extends B<T> mixins C<T> {}
declare class D<T> mixins C<T> {}
`;

View File

@ -0,0 +1 @@
run_spec(__dirname, ["babylon"]);

View File

@ -0,0 +1,2 @@
declare class A<T> extends B<T> mixins C<T> {}
declare class D<T> mixins C<T> {}