Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there an equiv of C's __LINE__ ? #528

Open
TomOnTime opened this issue Jun 30, 2024 · 4 comments
Open

Is there an equiv of C's __LINE__ ? #528

TomOnTime opened this issue Jun 30, 2024 · 4 comments

Comments

@TomOnTime
Copy link

Oddball question but...

Is there an equiv of C's LINE in Otto?

For example, I'd like to call a function like foo(LINE, param1, param2, param3) so that foo can output an error like, "Function foo called improperly on line X".

Thanks!

@stevenh
Copy link
Collaborator

stevenh commented Jun 30, 2024

Not sure it would make as much sense as in raw JS as that's file based where as code here may not be.

@TomOnTime
Copy link
Author

It would help to know the line number.

@stevenh
Copy link
Collaborator

stevenh commented Jul 1, 2024

If you ask go the line number that would be the calling reference not the line in the js code.

Have you tried options in native js such as detailed here?

@tlimoncelli
Copy link

That gets me closer. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants