Issue #4294: Resolve bug of JSB: main loop get called again in js

Fixed #4512: JSB script support added to Component