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

non case sensistive reserved names checking generates incorrect warnings #6026

Closed
3 of 17 tasks
Wildernesss opened this issue Feb 21, 2023 · 3 comments
Closed
3 of 17 tasks

Comments

@Wildernesss
Copy link

Wildernesss commented Feb 21, 2023

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
  • Internalization
  • Friendly Errors
  • Other (specify if possible)

p5.js version

v1.5.0

Web browser and version

Google Chrome Version 110.0.5481.104 (Official Build) (64-bit)

Operating System

Windows 10

Steps to reproduce this

Hi everyone,

I’ve been defining and using in one of my sketch for year a move() function as this one:

function move(){
  
  print('hello');
  
}

I’ve just updated p5js library used by this sketch (the previous one was 3 years old…) and since I get the following warning in Chrome Dev Tools:

p5.js says: you have used a p5.js reserved function “move” make sure you change the function name to something else.

More info: reference | p5.js
p5js.org/reference/#/p5/move

But I cannot find any move() function in p5js, excepted a .move() method in camera object https://p5js.org/reference/#/p5.Camera/move and MOVE constant (with capital letters for the id of course) used as argument by the cursor() function (p5js.org/reference/#/p5/move)

I’ve written a small IDE for my students that offers them opportunity to learn programming first steps with Blocky and Javascript in parallel. The Javascript library I’ve developped contains basic functions to program a game and one of them that is called move(). As I’ve already written all the documentation, including exercices, screen and video captures, so I want to keep this function with this name move() into my library.

I don’t see any standalone move() function into p5js library. So why this warning? Is this an issue in p5js? How to get rid off this warning without changing the function name? It seems the cause of these incorrect warning are non case sensitive reserved names checking.

Thanks a lot for your lights!

Laurent

Steps:

  1. create a new sketch
  2. define a new function called move() (see below)
  3. run and watch console in Dev Tools
@Wildernesss Wildernesss changed the title non case sensistive reserved names checking generating incorrect warnings non case sensistive reserved names checking generates incorrect warnings Feb 21, 2023
@davepagurek
Copy link
Contributor

Hi! I think this is the same bug as #5753, and should be fixed by my proposed solution in there (currently we are adding all methods from all p5 classes to the reserved name list, when, as you pointed out, some are only ever used as a method on a camera object.) I'm going to close this issue for now for organizational purposes since we're tracking this issue there.

In the mean time, does this go away if you disable friendly errors? https://p5js.org/reference/#/p5/disableFriendlyErrors

@Wildernesss
Copy link
Author

Wildernesss commented Feb 23, 2023 via email

@davepagurek
Copy link
Contributor

Ah ok, I think there may not be a way to avoid the warning in the console for now unfortunately. At the very least, it can be safely ignored. There's some movement on that issue so hopefully we'll get this fixed for real soon!

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