Re: [heycam/webidl] Modernize invoking user code (#113)

> "report an exception" takes a script. It uses that script's filename

Uses it for what?  There is a filename associated with the exception itself, or should be... (in Firefox there isn't one for non-Error exceptions, but that's a bug we should fix).  Note that the filename involved in exceptions is where the exception was thrown/created, not where script was entered anyway, whereas reporting happens at the entry point.

Are we talking about the filename in the error event, basically?

> el.addEventListener("click", el.cloneNode); // purposefully not bound

That will not do the right thing, because event listeners are called with the event target as `this`, so this will clone the event target.  You want something like:

    el.addEventListener("click", document.write);

to make this very simple.  I just tried that, and it reports no useful filename in the console in Safari or Firefox, for what it's worth.  It does report one in Chrome, but that filename doesn't match the `.filename` of the error event that gets fired or the second arg passed to the onerror handler if there is one.  That's set to empty string in Firefox and Chrome.  It's undefined in Safari in this case.  Is this the filename we're talking about here?

> I can't imagine a relevant filename for this

I agree.

I think being vague about precisely what the filename/line/column are is fine for now.  We can revisit it once people get closer to standardizing the .stack of Error instances, since that will involve solving basically this problem....

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/heycam/webidl/pull/113#issuecomment-218632074

Received on Thursday, 12 May 2016 00:55:37 UTC