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

fix operator precedence bug in WWOBJLoader2.js #11182

Merged
merged 1 commit into from
Apr 16, 2017
Merged

Conversation

evanw
Copy link
Contributor

@evanw evanw commented Apr 15, 2017

I'm writing a static analyzer for JavaScript and I noticed an operator precedence bug in this library during my testing. It turns out !a instanceof b is parsed (!a) instanceof b instead of !(a instanceof b). You need to use parentheses around the operands to get it to parse correctly. I know it's a bug in one of the examples and not in the core library, but I figured you'd still appreciate me sending in a fix for it :)

@mrdoob
Copy link
Owner

mrdoob commented Apr 16, 2017

FYI @kaisalmen

@mrdoob mrdoob merged commit 59d5a95 into mrdoob:dev Apr 16, 2017
@mrdoob
Copy link
Owner

mrdoob commented Apr 16, 2017

Many thanks!

@mrdoob
Copy link
Owner

mrdoob commented Apr 16, 2017

Have you tried running the analyzer in /src? 😇

@evanw evanw deleted the precedence-fix branch April 16, 2017 01:50
@evanw
Copy link
Contributor Author

evanw commented Apr 16, 2017

I ran it on everything including /src but I didn't find anything in there. I did find another minor thing in a unit test though, which I fixed in #11183. I'm still working on the static analyzer and I'll let you know if anything else comes up later :)

@mrdoob
Copy link
Owner

mrdoob commented Apr 16, 2017

Sweet!

@kaisalmen
Copy link
Contributor

kaisalmen commented Apr 16, 2017

@evanw Thank you! I have fixed it in my repository as well.

kaisalmen added a commit to kaisalmen/WWOBJLoader that referenced this pull request Apr 16, 2017
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

3 participants