trace arbitrary javascript function