If I remember rightly, DOM 0 events e.g. onclick="blah()" use line 0.
On 25/08/2016 16:10, Eddy Bruel wrote:
> The debugger API allows you to get the line number of a script relative to
> the source from which it was compiled (via
> Debugger.Script.prototype.startLine). I'm currently working on an API that
> allows you to get the line number of a source relative to the resource that
> introduced it (see bug 1288084
> <
https://bugzilla.mozilla.org/show_bug.cgi?id=1288084>). Eventually, I
> would like the same information for column numbers as well.
>
> It's not 100% clear to me whether line/column numbers are supposed to start
> at 0 or 1. I *think* line numbers are supposed to start at 1 in the JS
> engine. However, I've also seen places where we use 0 for the line number.
> To add to the confusion, we also seem to use 0 and 1 as default values for
> when the line number is unknown. Columns numbers are similarly confusing.
>
> I'd like to establish what the desired convention is here before I start
> landing any patches in bug 1288084. Should line/column numbers start at 0
> or at 1? And what should be the default value if those numbers are unknown?