2016年4月6日 星期三

[Javascript] How to insert line number automatically for debug

  1. add “Line # 999 \n” to each line in the script that you want numbered, e.g.,
    alert ( “Line # 999 \n”);
  2. run the perl below:
    cat my_js.js | perl -ane “{ s/Line # \d+ /Line # _;}” > C_my_js.js; mv C_my_js.js my_js.js
Reference:

0 意見:

張貼留言