By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,460 Members | 1,151 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,460 IT Pros & Developers. It's quick & easy.

debug information/ meta coding in javascript

P: n/a
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
Jul 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
fo******@yahoo.co.uk writes:
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
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #2

P: n/a
> (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?
Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.