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

Disallow numeric constant name #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tangrufus
Copy link
Member

@tangrufus tangrufus commented Mar 13, 2020

close #4

Note: There are a few more constant names will break, e.g: null, true, false.
Haven't think of a good way to catch them all.

@tangrufus tangrufus requested a review from austinpray March 13, 2020 14:59
@coveralls
Copy link

Pull Request Test Coverage Report for Build 39

  • 2 of 2 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build 38: 0.0%
Covered Lines: 19
Relevant Lines: 19

💛 - Coveralls

@QWp6t
Copy link
Member

QWp6t commented Apr 28, 2021

Update: I just noticed that you mentioned this in #4 and the intention of this PR is to disable that behavior anyway.

Fair enough. 😅


It's technically valid to use numeric constants. You can access them using the constant() function.

image

null, true, and false are already predefined constants, so they should already fail if a user attempts to redefine them.

image

@retlehs retlehs requested review from QWp6t and removed request for austinpray January 26, 2024 16:36
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.

Prevent using integers or numeric strings as keys
3 participants