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

Any way to disable the infinite loop detection? #655

Open
bschlenk opened this issue Jun 16, 2022 · 2 comments
Open

Any way to disable the infinite loop detection? #655

bschlenk opened this issue Jun 16, 2022 · 2 comments

Comments

@bschlenk
Copy link

Describe the bug
Hey! First off, I love this tool! Long time user, don't know how I'd get by without it.

I'm trying to debug an eslint plugin in the explorer, but the infinite loop checks make that impossible. It looks like they add a time check in the body of every function and loop, and these always get triggered while debugging, making it almost impossible. I'd be great if there was a checkbox or something to disable this, or maybe if there was a way to detect that devtools are open and the code contains a debugger statement then disable?

To Reproduce
Steps to reproduce the behavior:

  1. Parser: babel-eslint
  2. Transform: ESLint v8
  3. Open up devtools
  4. Write some code in the bottom left panel with a debugger statement
    module.exports = {
      meta: {
        messages: {
          error: 'How do I debug??',
        },
      },
     
      create(context) {
        return {
          FunctionDeclaration(node) {
            debugger;
            // try stepping into this loop, you'll hit the infinite loop detection
            for (let i = 0; i < 100; ++i) {
              console.log('something')
            }
        }
      }
    }
  5. Try to step through

Expected behavior
I'd expect to be able to debug this code instead of running into infinite loop detection.

Screenshots
N/A

Browser (please complete the following information):

  • OS: macos
  • Browser: Chrome
  • Version: 102.0.5005.115

astexplorer settings:

  • Selected parser: babel-eslint
  • Selected transformer (if applicable): ESLint v8
  • Contents of the local storage key explorerSettingsV1 (code can be removed if you don't want it to be public)

Additional context
Add any other context about the problem here.

@bschlenk
Copy link
Author

Found an ugly workaround: monkey patch Date.now

Date.now = () => 0

@fkling
Copy link
Owner

fkling commented Nov 25, 2022

First off, I love this tool! Long time user, don't know how I'd get by without it.

Thank you 🙂

I'm glad you found a workaround (even if ugly). It's not possible to disable this but I'll take this into account for the next bigger update.

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

No branches or pull requests

2 participants