refine typecheck method
Merge pull request #1365 from isayme/master

update object typecheck method, no third variable required