javascript: collapse nested continuations
javascript: recognize more redundant continuations