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