* new_tests * move_all_clobbered_tests * remove all the tests that no longer exist * re-run flow tests * Move all the flow tests to tests/flow and prettier to tests/ * Move prettier tests to their own folders * Add jsfmt files * run prettier snapshot tests
19 lines
382 B
JavaScript
19 lines
382 B
JavaScript
/* @flow */
|
|
|
|
function foo() {
|
|
this.m();
|
|
}
|
|
|
|
function bar(f: () => void) {
|
|
f(); // passing global object as `this`
|
|
({ f }).f(); // passing container object as `this`
|
|
}
|
|
|
|
bar(foo); // error, since `this` is used non-trivially in `foo`
|
|
|
|
function qux(o: { f: () => void }) {
|
|
o.f(); // passing o as `this`
|
|
}
|
|
|
|
qux({ f: foo }); // error, since `this` is used non-trivially in `foo`
|