请检查以下代码,我在做错什么吗?
/* @flow */
function isObject (y: any): boolean %checks {
return typeof y === "object" && y !== null;
}
const obj = { isObject };
function foo(x: mixed) {
if(isObject(x)) { // Works as expected
return x.abc;
}
}
function foo1(x: mixed) {
if(obj.isObject(x)) { // Not working as expected
return x.abc;
}
}