api-docs
api-docs copied to clipboard
set type in function parameters?
I think the syntax of the following lines in docset.js
are wrong. Does JavaScript support type set in function parameters?
Babel enables optional type annotations (see 'use babel' directive at the top of the file).
http://babeljs.io/docs/plugins/transform-flow-strip-types/
How I notice this
Atom always crashes when I let it idle for a long while. Then I check the crash log; The last executed code points to setEnabled_(enabled : boolean) {
. After I remove those type annotations, atom stops crashing.
It is a flow
thing
Based on the link you give, it is a flow
thing. Babel requires a plugin babel-plugin-transform-flow-strip-types
to strip those types.
In
function foo(one: any, two: number, three?): string {}
Out
function foo(one, two, three) {}