title: try-catch in JavaScript : how to get stack trace or line number of the original error
body: <p>When using TRY-CATCH in JavaScript, how to get the line number of the line that caused the error?</p>
  
  <p>On many browsers, the below code will work great and I will get the stack trace that points to the actual line that throw the exception. </p>
  
  <p>However, some browsers do not have "e.stack". IPhone's safari is one example. </p>
  
  <p>Is there someway to get the line number that will work for all browsers?</p>
  
  <pre><code>try
  {
     // lots of code here
     var i = v.WillGenerateError; // how to get this line number in catch??
     // lots of code here
  } 
  catch (e) 
  {
       alert (e.stack)  // this will work on chrome, FF. will no not work on safari 
       alert (e.line)  // this will work on safari but not on IPhone
  }
  </code></pre>
  
  <p>Many thanks!</p>
  
  <p>UPDATE: 
  I found that e.line works on safari but still not available on IPhone, latest iOS version</p>