debug information/ meta coding in javascript

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • foldface@yahoo.co.uk

    debug information/ meta coding in javascript

    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.javascr iptCalls[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
  • Lasse Reichstein Nielsen

    #2
    Re: debug information/ meta coding in javascript

    foldface@yahoo. co.uk writes:
    [color=blue]
    > Hi
    > I'm after information on the hard stuff in javascript (no, not alt.binaries... )
    >
    > (1) Is there anyway of tracing calls in javascript.[/color]

    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.
    [color=blue]
    > (2) Can I determine the methods and data of any object in javascript
    > somehow?[/color]

    Not all of it. Propertie of objects can be set "don't enumerate". Only
    original propertie (like the toString property of Object.prototyp e)
    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 - lrn@hotpop.com
    DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
    'Faith without judgement merely degrades the spirit divine.'

    Comment

    • Douglas Crockford

      #3
      Re: debug information/ meta coding in javascript

      > (1) Is there anyway of tracing calls in javascript. Ideally I'd have a[color=blue]
      > background function, periodically popping up via setTimeout and it would
      > be able to say something like, browser.javascr iptCalls[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?[/color]

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

      Comment

      Working...