fix #205: don't rely on ctx var in generated javascript