- 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.
32 lines
822 B
JavaScript
32 lines
822 B
JavaScript
// @flow
|
|
|
|
function f(x : $Tainted<number>, y : $Tainted<number>) {
|
|
var z : $Tainted<number> = x + y;
|
|
}
|
|
function f1(x : $Tainted<number>, y : number) {
|
|
var z : $Tainted<number> = x + y;
|
|
}
|
|
function f2(x : number, y : $Tainted<number>) {
|
|
var z : $Tainted<number> = x + y;
|
|
}
|
|
// This should cause an error.
|
|
function f3(x : $Tainted<number>, y : number) {
|
|
var z : number = x + y;
|
|
}
|
|
// This should cause an error.
|
|
function f4(x : number, y : $Tainted<number>) {
|
|
var z : number = x + y;
|
|
}
|
|
// This should cause an error.
|
|
function f5(x : number, y : $Tainted<number>) {
|
|
var z : string = x + y;
|
|
}
|
|
// This should cause an error.
|
|
function f6(x : string, y : $Tainted<number>) {
|
|
var z : string = x + y;
|
|
}
|
|
// This should cause an error.
|
|
function f7(x : $Tainted<string>, y : $Tainted<number>) {
|
|
var z : string = x + y;
|
|
}
|