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

OscNode: Fix if timeNode is not a nodeObject() #25588

Merged
merged 1 commit into from
Mar 1, 2023

Conversation

sunag
Copy link
Collaborator

@sunag sunag commented Mar 1, 2023

No description provided.

@sunag sunag added the Nodes label Mar 1, 2023
@sunag sunag added this to the r151 milestone Mar 1, 2023
@@ -22,7 +22,7 @@ class OscNode extends Node {
construct() {

const method = this.method;
const timeNode = this.timeNode;
const timeNode = nodeObject( this.timeNode );
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we should assume that an user always passes a node object?

Copy link
Collaborator Author

@sunag sunag Mar 1, 2023

Choose a reason for hiding this comment

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

I think better added it in construct() as default in case of user added a class based node like (non-nodeObject()):

new OscNode( OscNode.SINE, new CustomNode() );

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we can instruct the user to always pass node objects? E.g. like oscSine( nodeObject( new CustomNode() ) )?

Copy link
Collaborator Author

@sunag sunag Mar 1, 2023

Choose a reason for hiding this comment

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

Maybe we can instruct the user to always pass node objects? E.g. like oscSine( nodeObject( new CustomNode() ) )?

I think the best way would still be to standardize possible non-nodeObjects in construct() to facilitate implementation.

Anyway no object would be converted twice once we have a WeakMap.

@sunag sunag merged commit b77bb45 into mrdoob:dev Mar 1, 2023
@sunag sunag deleted the dev-fix-oscnode branch March 1, 2023 03:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants