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

Make 32-bit limit on VLQs more precise #80

Open
takikawa opened this issue Mar 28, 2024 · 0 comments
Open

Make 32-bit limit on VLQs more precise #80

takikawa opened this issue Mar 28, 2024 · 0 comments

Comments

@takikawa
Copy link
Collaborator

Currently the terminology section of the spec mentions that the VLQ Base64 encoded are limited to 32-bit quantities.

This definition should probably be made more precise, and describe what "limited" means. For example, it could specify that such VLQs are invalid and implementations may reject them (other possible semantics might include clamping values to 32-bits, but I'm not aware of browser implementations that do this).

Firefox seems to consider such VLQs invalid while WebKit & Chrome don't appear to enforce the limit 1, 2.

There's also a question of if the sign bit of the VLQ should be included in the 32 bits. It seems natural to me to include it, as a reason to pick a 32 bit limit to begin with might be to ensure an implementation can use a 32-bit representation to store the whole VLQ. However, I think Firefox actually doesn't include the sign bit in the check linked above (if it checked against i32::MAX instead of u32::MAX it would IIUC).

takikawa added a commit to takikawa/source-map-spec that referenced this issue Jun 24, 2024
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

No branches or pull requests

1 participant