JavaScript debugging

In order to simplify JavaScript debugging, it's useful to have the following code in the [Visualizer] section of Common7\Packages\Debugger\autoexp.dat:

;------------------------------------------------------------------------------
;  JSString
;------------------------------------------------------------------------------
JSString{
 preview ( [$e.mChars,su] )
 stringview ( [$e.mChars,sub] )
 children
 (
  #if(!($e.mLength & JSString::DEPENDENT))
  (
   #(
    [actual members]: [$e,!] ,
    #array
    (
     expr: $e.mChars[$i],
     size: $e.mLength & JSString::LENGTH_MASK
    )
   )
  )
  #else
  (
   ; Dependent strings aren't done yet
   #(
    [actual members]: [$e,!],
    #array
    (
     expr: $e.mChars[$i],
     size: $e.mLength & JSString::LENGTH_MASK
    )
   )
  )
 )
}
;------------------------------------------------------------------------------
;  JSObject
;------------------------------------------------------------------------------
JSObject{
 preview (
  #(
   (void *)&$e,
   " [object ",
   [((JSClass *)($e.classword & ~3))->name,s],
   "]"
  )
 )
 children (
  #(
   #(#(#(
   [actual members]: [$e,!],
   #if ($e.fslots[0])
   (
    #(prototype : (JSObject *)($e.fslots[0] & ~7))
   )),
   #if ($e.fslots[1])
   (
    #(parent : (JSObject *)($e.fslots[1] & ~7))
   )),
   #if (((JSClass *)($e.classword & ~3))->flags & 1)
   (
    #(private : (void *)($e.fslots[2]))
   )),
   #(class : (JSClass *)($e.classword & ~3))
  )
 )
}

Comments