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: MakeMatchIndicesIndexPairArray: avoid creating a property on undefined #2714

Merged
merged 1 commit into from
Mar 27, 2022

Conversation

ljharb
Copy link
Member

@ljharb ljharb commented Mar 27, 2022

This is currently a potential spec bug, not an actual one. This AO is not called such that this would be an error, but there are no assertions to prevent it from being one.

@bakkot
Copy link
Contributor

bakkot commented Mar 27, 2022

I'd prefer to add an assertion, rather than a guard.

@ljharb
Copy link
Member Author

ljharb commented Mar 27, 2022

How would you word it? That groupNames only contains strings when hasGroups is true?

spec.html Show resolved Hide resolved
…on undefined (tc39#2714)

This is currently a _potential_ spec bug, not an actual one. This AO is not called such that this would be an error, but there are no assertions to prevent it from being one.
@bakkot bakkot added the ready to merge Editors believe this PR needs no further reviews, and is ready to land. label Mar 27, 2022
@ljharb ljharb merged commit caa6e3f into tc39:main Mar 27, 2022
@ljharb ljharb deleted the matchindicesarraybug branch March 27, 2022 18:25
@syg
Copy link
Contributor

syg commented Mar 28, 2022

Assert is fine, though the confusion here points to a possible larger refactoring around groups and groupNames to make the paths less confusing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
editorial change ready to merge Editors believe this PR needs no further reviews, and is ready to land. spec bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants