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

[p5.js 2.0 Beta Bug Report]: FES parameter validation for print not accepting multiple arguments #7597

Open
1 of 17 tasks
limzykenneth opened this issue Mar 4, 2025 · 2 comments

Comments

@limzykenneth
Copy link
Member

Most appropriate sub-area of p5.js?

  • Accessibility
  • Color
  • Core/Environment/Rendering
  • Data
  • DOM
  • Events
  • Image
  • IO
  • Math
  • Typography
  • Utilities
  • WebGL
  • Build process
  • Unit testing
  • Internationalization
  • Friendly errors
  • Other (specify if possible)

p5.js version

2.0.0-beta.4

Web browser and version

No response

Operating system

No response

Steps to reproduce this

Steps:

  1. Use print() with more than 1 arguments will cause FES to print an incorrect message
    🌸 p5.js says: Expected at most 1 argument, but received more in print(). For more information, see https://p5js.org/reference/p5/print. 
    
  2. It should not be printing that message as print() like console.log() accepts any number of arguments. This should either be fixed in the reference and/or in FES parameter validation logic itself.

Snippet:

function setup() {
  createCanvas(400, 400);
  print(1, 2);
}
@swastikCommits
Copy link

I would like to work on this issue

@webermayank
Copy link

@limzykenneth
Hi, i reproduced the issue and yes is printing the error but it is also printing the desired output also,

  • image

Image

the respective code -

function setup() {
  createCanvas(400, 400);
  const a = "jigsaw"
  // OR
  print(1, 2,3,4,5,6,"hello",a);
}

so the issue is that somehow it is triggering the message unnecessarily, please correct me if i am wrong here

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

3 participants