Button-script error-line-numbers wrongly reported

My button-scripts have often been reporting errors one line below the problem line. I have managed to tie the problem down:

  1. Create a new button on a toolbar, set it to 'Script function' using either JScript or VBScript, and delete the example script that appears.
  2. Type XXX in line 1 (or any other faulty script).
  3. Run the script from within the script box by clicking 'Run', and an error is correctly reported in line 1.
  4. Click OK to save the script to the toolbar.
  5. Run the button by clicking on it, and an error is incorrrectly reported in line 2.

Thanks!