debug information/ meta coding in javascript

F

foldface

Hi
I'm after information on the hard stuff in javascript (no, not alt.binaries...)

(1) Is there anyway of tracing calls in javascript. Ideally I'd have a
background function, periodically popping up via setTimeout and it would
be able to say something like, browser.javascriptCalls[0], or..
On every javascript call of any kind have another method called which could
then identify the caller and trace it

(2) Can I determine the methods and data of any object in javascript
somehow?

Thanks

F
 
L

Lasse Reichstein Nielsen

Hi
I'm after information on the hard stuff in javascript (no, not alt.binaries...)

(1) Is there anyway of tracing calls in javascript.

Not generally. Different browsers have different extensions to
Javascript that might allow that. I am not sure how, but the Venkman
debugger for Gecko browsers has breakpoints, so something must be
possible.
(2) Can I determine the methods and data of any object in javascript
somehow?

Not all of it. Propertie of objects can be set "don't enumerate". Only
original propertie (like the toString property of Object.prototype)
are note enumerable. All properties you add yourself will be enumerate.
You can go through all the enuymerable properties of an object with
the for(in) construction:
for (propertyName in objectRef) {
... objectRef[propertyName] ...
}
Again, there might be proprietary methods for accessing the
non-enumerable properties, but it is not part of Javascript core.

/L
 
D

Douglas Crockford

(1) Is there anyway of tracing calls in javascript. Ideally I'd have a
background function, periodically popping up via setTimeout and it would
be able to say something like, browser.javascriptCalls[0], or..
On every javascript call of any kind have another method called which could
then identify the caller and trace it

(2) Can I determine the methods and data of any object in javascript
somehow?

No. Certainly not with setTimeout, which only runs when the interpreter
is idle. What is it that you hope to accomplish?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,430
Messages
2,571,676
Members
48,796
Latest member
Greg L.

Latest Threads

Top