Skip to content

Infinite loop detection triggers on await loadImage etc in setup #4295

Description

@gohai

p5.js version

2.3.2

What is your operating system?

Mac OS

Web browser and version

152.0.7977.82

Actual Behavior

Using a for-loop inside setup that loads resources (e.g. loadImage):

let fns = ["a.jpg", "b.jpg", "c.jpg"];
let imgs = [];

async function setup() {
  for (let i=0; i < fns.length; i++) {
    imgs.push(await loadImage(fns[i]));
  }
}

Expected Behavior

The could should run, as it isn't an infinite loop, and await loadImage() the expected pattern to use with p5.js 2.0.

Steps to reproduce

See above.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Awaiting Maintainer ApprovalNeeds review from a maintainer before moving forwardBugError or unexpected behaviors

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions