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

Editorial: Improve integer index operations #2936

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

gibson042
Copy link
Contributor

  • Rename StringGetOwnProperty to StringGetIndexPropertyDescriptor
  • Rename IsValidIntegerIndex to IntegerIndexedElementExists
  • Introduce IsIntegerIndexInRange to support both

@ljharb
Copy link
Member

ljharb commented Oct 16, 2022

What’s the improvement here?

@gibson042
Copy link
Contributor Author

The name of "StringGetOwnProperty" suggests that it gets any own property, when in reality it is limited to index properties (and returns a descriptor rather than just a value). Similarly, "IsValidIntegerIndex" suggests a static test of arbitrary integer index properties, when in reality it is limited to those of a specific typed array instance. Both of those are renamed for clarity, and "IsIntegerIndexInRange" is introduced as a generic operation backing them both (basically, what the "IsValidIntegerIndex" name suggests).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants