Skip to content

Comments

Change object member functions to use regular functions#4199

Merged
lmccart merged 1 commit intoprocessing:masterfrom
limzykenneth:arrow-functions-revert
Dec 19, 2019
Merged

Change object member functions to use regular functions#4199
lmccart merged 1 commit intoprocessing:masterfrom
limzykenneth:arrow-functions-revert

Conversation

@limzykenneth
Copy link
Member

Resolves #3875

Changes:

As per the issue, prototype methods are all reverted to using regular function regardless of whether they use this in the function body or not. One additional thing I think is necessary but I'm not 100% sure about (90% sure) is static methods of objects. From what I found, in particular this stackoverflow question, it seems it is good practice to use regular functions for static members but I found only reference to class syntax static members only.

In any case, none of the converted functions use this in their function body so the functionalities will be exactly the same as before.

PR Checklist

@lmccart
Copy link
Member

lmccart commented Dec 19, 2019

thanks @limzykenneth this all looks good. I think you're correct on using regular functions for all static members.

@lmccart lmccart merged commit 27d9299 into processing:master Dec 19, 2019
@limzykenneth limzykenneth deleted the arrow-functions-revert branch January 19, 2020 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use of arrow functions for prototype definition

2 participants