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

Math: Covert to ES6 default value. #20472

Merged
merged 2 commits into from
Oct 8, 2020
Merged

Conversation

linbingquan
Copy link
Contributor

Description

Math: Covert to ES6 default value.

fromArray( array, offset ) {

if ( offset === undefined ) offset = 0;
fromArray( array = [], offset = 0 ) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The array parameter should never be optional when using fromArray().

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your review, I corrected it.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Mugen87 I do not think the array parameter should be optional when using .toArray() either. It is supposed to be populating an existing array, not instantiating one. Instantiating one violates the three.js policy.

@mrdoob mrdoob added this to the r122 milestone Oct 8, 2020
@mrdoob mrdoob merged commit 4b1a71a into mrdoob:dev Oct 8, 2020
@mrdoob
Copy link
Owner

mrdoob commented Oct 8, 2020

Thanks!

@linbingquan linbingquan deleted the dev-cleanup-math branch November 24, 2020 00:15
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.

None yet

4 participants