- This brings in the flow test suite that contains a ton of JavaScript parsing edge cases - This creates snapshot tests using the pretty printer for all of them - If uncomment `RUN_AST_TESTS` line in `tests/run_specs.js`, it checks ast(pretty_print(x)) == ast(x). Right now, "178 failed, 197 passed, 375 of 377 total". So half of the tests are not passing, most of them are crashes and many of the rest are subtle issues.
26 lines
466 B
JavaScript
26 lines
466 B
JavaScript
// @flow
|
|
|
|
declare class C {
|
|
bar(n1: number, n2: number): number;
|
|
bar(s1: string, s2: string): string;
|
|
}
|
|
|
|
function foo(c: C, x: any): string {
|
|
let y = x.y;
|
|
return c.bar(0, y); // should be able to select first case and error
|
|
}
|
|
|
|
var any_fun1 = require('./nonflowfile');
|
|
function bar1(x: mixed) {
|
|
if (any_fun1(x)) {
|
|
(x: boolean);
|
|
}
|
|
}
|
|
|
|
var any_fun2 = require('./anyexportflowfile');
|
|
function bar2(x: mixed) {
|
|
if (any_fun2(x)) {
|
|
(x: boolean);
|
|
}
|
|
}
|