Comments (5)
If it's passing out of asm.js land, then it must be signed, as JS doesn't have unsigned integers. If the function is being called by another asm.js function, then my guess would be that the |0 is a nop, but I'm not certain on that.
from validator.
JavaScript does have unsigned integers, as forced with the >>>
operator: -1 >>> 0 == 4294967295
, as far as I know. But I am mostly talking about code within the asm.js land.
from validator.
For simplicity, we use signed values both when entering an asm.js function and when exiting. Standardizing on that is simpler, and matches what JS engines optimize well today anyhow (32-bit signed integers are faster than 32-bit unsigned ones, which often become doubles).
from validator.
I believe this issue can be closed.
from validator.
Closing; see kripken's explanation above. The functionality of unsigned return types can be achieved by casting unsigned values to signed for the return, and casting them back to unsigned on the caller side.
from validator.
Related Issues (20)
- Request: Fast integer overflow checks HOT 1
- is this repository maintained? HOT 4
- Accept comma-separated function table declarations HOT 2
- Command line utility? HOT 1
- Validator accepts code that it shouldn't HOT 4
- congrats HOT 1
- Allow constants in case blocks
- undefined cannot "flow freely" but can "escape"
- Spec allows standard library functions to be exported HOT 1
- Heap indexing expressions should be subtypes of intish
- Fround annotations break hoisting semantics HOT 1
- If doesn't work? HOT 4
- Mentioned on The Changelog "#189: JSON API with Yehuda Katz"
- Assignment operators are not validated HOT 1
- Foreign function invocations do not validate HOT 1
- Consider allowing x|=0 as a valid Parameter Type Annotation
- Byte Addressing for TypedArray views of heaps - why, and what does it accomplish? HOT 4
- anything with fround doesn't validate
- Warning Chrome : Invalid asm.js: Unexpected token
- Grammar incorrect in document
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from validator.