adjust custom JS generators to typed AST changes (closes #2745)