Files
test-repo/tests/flow/constructor_annots/constructors.js
T
Christopher Chedeau 9ba0d69cb9 Upgrade flow to 0.64 (#3899)
* Upgrade flow to 0.64

This also enables spread operator on jsx on the flow parser:

```js
<div>{...list}</div>
```

I had no idea it was even a thing.

I had to comment out a flow test that no longer parses, but it's no longer in the flow repo and the comment said that it shouldn't be working anyway so I don't think it's going to be a problem.

* Fix build script
2018-02-06 09:01:58 -08:00

22 lines
574 B
JavaScript

// Foo is a class-like function
function Foo() {
this.x = 0; // constructs objects with property x
}
Foo.y = 0; // has static property y
Foo.prototype = { m() { return 0; } };
// exporting Foo directly doesn't work
// Foo's instance and static props are not picked up
exports.Foo = Foo;
// so you want to type Foo, by declaring it as a class
interface IFooPrototype {
m: () => number;
}
interface IFoo extends IFooPrototype {
x: boolean; // error, should have declared x: number instead
static (): void;
constructor(): void;
}
exports.Foo2 = (Foo: Class<IFoo>);