Strange behaviour on stepping.

"Dassburger" <[email protected]>
Newsgroups gmane.comp.mozilla.devel.jsdebugger
Organization http://groups.google.com
Message-ID <[email protected]>
Hello!

One more question from me. Suppose we have the following script:

===================================================
1:   var x = 5;
2:
3:   Log.WriteLine('1');
4:
5:   x = x + 2;
6:
7:   var y = x + 3;
8:   Log.WriteLine('2');
===================================================

First, I set an execution hook at line 1, start the script. Then I add
an interrupt hook and return from execution hook handler. I see a
strange behaviour. SpiderMonkey seems to pass the script twice, first,
it only stops at lines 1 and 7. Then it starts to execute the script as
usual, line by line: 3, 5, 7, 8.

If I put an execution hook at line 3 and start the script, it'll stop
at line 7. Continuing the execution will result in no stop at line 3.
However, if I'll step from no on, it will go by lines 7, 1, 3, 5, 7, 8.

The question is, is it the intended behaviour? How can I implement
stepping and tracing around the code in my debugger so, that a user
will not notice the first pass?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.