8000 Use early return in optimizeComponents and avoid using setAttribute followed by removeAttribute by vincentfretin · Pull Request #803 · aframevr/aframe-inspector · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Use early return in optimizeComponents and avoid using setAttribute followed by removeAttribute #803

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

Merged
merged 1 commit into from
Feb 15, 2025

Conversation

vincentfretin
Copy link
Contributor

I got a warning while playing with jsdoc and typescript about the condition value === '' on a not defined variable.
There was no bug here because a var is hoisted so the check was against undefined != '' so that still worked but the logic was not optimal here, also the attribute was set to later be removed.
I rewrote that to use an early return and call the setAttribute at the end after the condition.

@dmarcos dmarcos merged commit 912da4c into aframevr:master Feb 15, 2025
1 check passed
@vincentfretin vincentfretin deleted the move-check-in-else branch February 16, 2025 08:42
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.

2 participants
0