[js] compiler: add code chaining so that compiled code can be as long as needed