Add support for this type to Babel 6.x
This commit is contained in:
@@ -140,6 +140,10 @@ export function StringTypeAnnotation() {
|
||||
this.push("string");
|
||||
}
|
||||
|
||||
export function ThisTypeAnnotation() {
|
||||
this.push("this");
|
||||
}
|
||||
|
||||
export function TupleTypeAnnotation(node: Object) {
|
||||
this.push("[");
|
||||
this.printJoin(node.types, node, { separator: ", " });
|
||||
|
||||
5
packages/babel-generator/test/fixtures/flow/this-types/actual.js
vendored
Normal file
5
packages/babel-generator/test/fixtures/flow/this-types/actual.js
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
class Foo {
|
||||
bar(): this {
|
||||
return this;
|
||||
}
|
||||
}
|
||||
5
packages/babel-generator/test/fixtures/flow/this-types/expected.js
vendored
Normal file
5
packages/babel-generator/test/fixtures/flow/this-types/expected.js
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
class Foo {
|
||||
bar(): this {
|
||||
return this;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user