This is used e.g. when your script is inline in <script> tags in HTML. Then the ScriptOrigin will contain the line/column of the opening <script> tag, so stack traces contain the absolute line/column number inside the HTML document.
I don't know if the information is used in other places besides stack traces and debugging though. On Fri, Nov 13, 2020 at 5:26 AM Ben Ernst <boi...@gmail.com> wrote: > Yes that's right, when a debugger or an error message says you're on line > X and column Y, it deducts the values you specify in the offsets. So if you > transform user's code in some form, the error messages can be adjusted to > still have the right line numbers and column numbers. > > > > On Fri, 13 Nov 2020 at 00:43, Bit Cortex <bitcor...@gmail.com> wrote: > >> Thanks, but what's the actual effect of setting the line or column offset >> to a nonzero value? >> >> Based on your description, I'd guess that it might affect stack traces >> and possibly debugging. >> >> Can someone confirm that? Or do I not understand correctly? >> >> On Wednesday, November 11, 2020 at 5:05:50 PM UTC-5 Ben Noordhuis wrote: >> >>> On Wed, Nov 11, 2020 at 9:26 PM Bit Cortex <bitc...@gmail.com> wrote: >>> > >>> > Hello! >>> > >>> > Could someone describe the purpose of the line and column offset >>> properties of v8::ScriptOrigin? What effect do nonzero values have? >>> > >>> > Thanks! >>> >>> I believe they're intended to offset IIFEs[1] and other wrappers that >>> embedders may want to add around the user's script code. >>> >>> [https://en.wikipedia.org/wiki/Immediately-invoked_function_expression] >>> >> -- >> -- >> v8-users mailing list >> v8-users@googlegroups.com >> http://groups.google.com/group/v8-users >> --- >> You received this message because you are subscribed to the Google Groups >> "v8-users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to v8-users+unsubscr...@googlegroups.com. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/v8-users/f9f3c898-d022-48d9-b14b-d670731b8008n%40googlegroups.com >> <https://groups.google.com/d/msgid/v8-users/f9f3c898-d022-48d9-b14b-d670731b8008n%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> > -- > -- > v8-users mailing list > v8-users@googlegroups.com > http://groups.google.com/group/v8-users > --- > You received this message because you are subscribed to the Google Groups > "v8-users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to v8-users+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/v8-users/CABexdQ5hh4Ez1yMvcMNBT%2BMHxKangM6qr8Oi8M7SH%3D_RDtq5rQ%40mail.gmail.com > <https://groups.google.com/d/msgid/v8-users/CABexdQ5hh4Ez1yMvcMNBT%2BMHxKangM6qr8Oi8M7SH%3D_RDtq5rQ%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > -- -- v8-users mailing list v8-users@googlegroups.com http://groups.google.com/group/v8-users --- You received this message because you are subscribed to the Google Groups "v8-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to v8-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/v8-users/CACswSC1fdERKPQPHkQh5XmPVFyJxBdAE%2Bp2fpwpwDoSeqJ3Q%3Dw%40mail.gmail.com.