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
space-infix-ops: need to exclude "a|0" pattern from warnings #1295
Comments
|
I know. But all write |
Here is example from real code https://github.com/nodeca/pica/blob/adb2b2c78f784b2385c6aa00e973c1b2063e056a/lib/pure/resize.js#L182-L185 . That helps JIT to remove some types check in generated inline caches. |
We definitely can't support this by default, this would have to be some sort of exception if we end up supporting it. I'd like to hear more opinions p. |
I don’t think it is a good idea to write such code by hand. JavaScript doesn’t have 32bit integers. |
Okay, let's stop the could vs. should conversation, as that's not very helpful. I took a look at the asm.js spec and it makes a clear distinction between So I think we should support this exception as an option. What should it be called? |
Don't know, is this syntax initially related to May be, As far as i know, we have only one widely known exclusion. Sometime it's possible to cast Uint32 with |
|
Argee. |
The name should have no semantic meaning. It should refer only to the exceptional syntactic form: |
bitwiseOrZero is confusing because why not also bitwiseOrOne? The only real reason to use this option is for type hinting, so having the option refer to this is important IMHO. |
New: Added option int32Hint for space-infix-ops (fixes #1295)
"a|0" is well known pattern, when result is forced to be signed 32 bit integer (makes sense when writing high speed js). It should not give warning about missed spaces.
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: