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

Don't use octals #3187

Merged
merged 1 commit into from
Feb 15, 2024
Merged

Don't use octals #3187

merged 1 commit into from
Feb 15, 2024

Conversation

atjn
Copy link
Contributor

@atjn atjn commented Feb 10, 2024

I suggest disallowing 0-prefixed numbers in the official apps, as it is not allowed per the Ecmascript standard.

These numbers are disallowed because the original Ecmascript standard allowed some decimal numbers to be 0-prefixed, but also used the 0-prefix to encode octal numbers. Most of the time, octal numbers are simply converted to decimal numbers and everything is good, but sometimes these subtle differences lead to some very weird bugs. The newer strict Ecmascript standard therefore disallows 0-prefixed numbers completely to eliminate this class of bugs.

@atjn atjn mentioned this pull request Feb 10, 2024
@bobrippling
Copy link
Collaborator

Great find, sounds good to me!

@bobrippling bobrippling merged commit 3f8f0f3 into espruino:master Feb 15, 2024
1 check passed
@atjn atjn deleted the no-octal branch February 15, 2024 09:38
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