I put a example in attachment which shows line number,.. correctly

debugger didn't fire jsds.breakpointHook , so I cant figure out it yet :(

anyway here is the part of the article
*Run Eval-level
For run-time correction we need to trap the eval() before it runs and mark
all of the functions that it defines as coming from the its expression body.
We can trap the eval() by looking for scripts (i.e. functions) with
empty-string names in a jsd.scriptHook.onScriptCreated. We need to
distinguish eval-level from top-level functions, but onScriptCreated has no
stack to check. Therefore when we see an empty-string-named function, we set
a breakpoint on it at PC (program counter) zero triggering a call to
jsd.breakpointHook. (Such breakpoints cannot interfere with the operation of
the conventional debugger since the conventional debugger cannot see the
eval code anyway.) As soon as we return from onScriptCreated, the function
runs and breaks immediately into our jsd.breakpointHook; we can undo our
breakpoint. We now have the stack frame of the just-running empty-string
function. If it has a caller, it must be an eval-level function.*

On Sat, Mar 14, 2009 at 10:42 PM, joe ertaba <[email protected]> wrote:

> For dynamic cases it doesn't
> here is sample:
>
>
> On Sat, Mar 14, 2009 at 9:38 PM, Eric Jung <[email protected]> wrote:
>
>>
>>
>> On Sat, Mar 14, 2009 at 10:31 AM, joe ertaba <[email protected]> wrote:
>>
>>> Hi Eric
>>>
>>> It works but *it cant handle line number correctly*
>>>
>>
>> It always displays the line numbers correctly for me.
>>
>
>
> Create multiline textbox with id =  "MyId"
>
> then use eval for executing it's code
> eval (document.getElementById(" MyId").value)
>
> If there is an error in textbox's script, line number always be same!
>
> Here is an article about it:
>
> http://www.almaden.ibm.com/u/bartonjj/fireclipse/test/DynLoadTest/WebContent/DynamicJavascriptErrors.htm
>
>
>
>
>>
>>
>>
>>>
>>> I have one more problem:
>>> *Can anybody help me how to add breakpoints to my script*
>>>
>>
>> In IE, you can use the *debugger* keyword in your script. Not sure if
>> spidermonkey/tracemonkey support that keyword or not... but give it a try.
>>
>
>

Attachment: Test.xul
Description: Binary data

_______________________________________________
Project_owners mailing list
[email protected]
https://www.mozdev.org/mailman/listinfo/project_owners

Reply via email to