Skip to content

Conversation

@nicolo-ribaudo
Copy link
Member

[[BindingName]] can either be a String or NAMESPACE (source: https://tc39.es/ecma262/#resolvedbinding-record).

These two checks are basically doing

if (resolution.BindingName === NAMESPACE || starResolution.BindingName === NAMESPACE) {
  if (resolution.BindingName !== starResolution.BindingName) return AMBIGUOUS;
}
if (resolution.BindingName !== NAMESPACE && starResolution.BindingName !== NAMESPACE) {
  if (resolution.BindingName !== starResolution.BindingName) return AMBIGUOUS;
}

Which is just

if (resolution.BindingName !== starResolution.BindingName) return AMBIGUOUS;

Because the two conditions are the complement of each other.

@github-actions
Copy link

The rendered spec for this PR is available at https://tc39.es/ecma262/pr/3711.

Copy link
Member

@michaelficarra michaelficarra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love that we're getting rid of that stray "either ... or ... is ..." construction as well.

Copy link
Member

@bakkot bakkot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I believe I introduced this in #2566, although at that time it was not clearly wrong because we were using SameValue, which does not support enum values.

@bakkot bakkot added the ready to merge Editors believe this PR needs no further reviews, and is ready to land. label Oct 27, 2025
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants