processing / p5.js

p5.js is a client-side JS platform that empowers artists, designers, students, and anyone to learn to code and express themselves creatively on the web. It is based on the core principles of Processing. http://twitter.com/p5xjs —
http://p5js.org/
GNU Lesser General Public License v2.1
21.2k stars 3.23k forks source link

Default values of arguments && modernize some code #6807

Closed asukaminato0721 closed 5 months ago

asukaminato0721 commented 5 months ago

Resolves #6721

Changes:

use default values of arguments, fix some missing ...args, use some native apis.

Screenshots of the change:

PR Checklist

nickmcintyre commented 5 months ago

@limzykenneth consistency with no space function() seems like the way to go for now. I'd generally recommend against anonymous functions for documentation, but they're fine in source code.

Longer term, both Airbnb and StandardJS suggest space before parentheses for anonymous functions. Maybe we can revisit style guides on the road to 2.0.

limzykenneth commented 5 months ago

I'll do a final review later today to see if private methods will work or not. After that I will merge this.

limzykenneth commented 5 months ago

The new syntax doesn't seem to work with browserify, we'll re-explore this as part of 2.0. I'll merge this for now. Thanks @asukaminato0721

adonis-jimenez commented 4 months ago

Resolves #6721

Changes:

use default values of arguments, fix some missing ...args, use some native apis.

Screenshots of the change:

PR Checklist