edbrowse-dev - development list for edbrowse
 help / color / mirror / Atom feed
From: Kevin Carhart <kevin@carhart.net>
To: Edbrowse-dev@lists.the-brannons.com
Subject: [Edbrowse-dev] alert(e.stack) !
Date: Fri, 24 Jun 2016 11:58:58 -0700 (PDT)	[thread overview]
Message-ID: <alpine.LRH.2.03.1606241138490.717@carhart.net> (raw)



I just stumbled on something that could make a big difference in 
conjunction with good line numbers.  The thing that is time consuming in 
resolving a runtime error is getting from page code back to our DOM.  The 
runtime errors are expressed in the page code's own variables, like:
widget is undefined on line 123

But the root cause is sure to be in the edbrowse DOM most of the time.
How do you bridge the gap in a methodical way rather than a painstaking 
way with no standard way to go about it?

Apparently call stacks are available for the asking!

Here's an example from http://demos111.mootools.net/Fx.Slide
After an error occurs, page code is available from jdb in 
document.scripts.

I ran one of these inside a try-catch and got:

try { eval(document.scripts[2].data)() } catch (e) { alert(e.stack) }
CSSStyleDeclaration.prototype.getPropertyValue@foo:1574
.getStyle@foo:2311
.getStyle/<@foo:2288
.getStyle@foo:2290
Element.getMany/<@foo:2624
$each@foo:1108
Element.getMany@foo:2623
.getStyles@foo:2335
Fx.Slide<.initialize@foo:4626
Class.Merge/merged@foo:461
Class/klass@foo:368
@foo:4
Element.Events.domready.add@foo:3728
Element.Methods.Events.addEvent@foo:2915
@foo:1
@foo:1

The constructions at the bottom are theirs, and the CSSStyleDeclaration at 
the top is by me in startwindow and contains some sort of misphrasing. 
Music to my ears, if I had known that a call stack was sitting there in e, 
I would have used it a long time ago..
Kevin


                 reply	other threads:[~2016-06-24 18:57 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LRH.2.03.1606241138490.717@carhart.net \
    --to=kevin@carhart.net \
    --cc=Edbrowse-dev@lists.the-brannons.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).