Capture locations from parse errors in JavaScript