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: make single-implementation concrete methods into abstract operations #3381

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

Conversation

bakkot
Copy link
Contributor

@bakkot bakkot commented Jul 29, 2024

AOs are generally nicer for readers (and tooling).

I've left these where they were and just changed their type, but since each section is preceded by a sentence like

The behaviour of the additional concrete specification methods for Function Environment Records is defined by the following algorithms:

we should probably also either reword that sentence or move these somewhere else.

Commits can be reviewed individually but should land as a single commit.

@jmdyck
Copy link
Collaborator

jmdyck commented Jul 29, 2024

(Reading the commit titles, I wondered, "Why not HasRestrictedGlobalProperty?" But I see it's handled in the commit for CanDeclareGlobalVar.)

Copy link
Contributor

@syg syg left a comment

Choose a reason for hiding this comment

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

lgtm!

spec.html Outdated
@@ -19379,7 +19288,7 @@ <h1>
<emu-alg>
1. Let _env_ be GetThisEnvironment().
1. Assert: _env_.HasSuperBinding() is *true*.
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add an assertion in HasSuperBinding() that if it returns true, the environment record is a function environment record.

spec.html Outdated
@@ -19344,7 +19253,7 @@ <h1>Runtime Semantics: Evaluation</h1>
1. If IsConstructor(_func_) is *false*, throw a *TypeError* exception.
1. Let _result_ be ? Construct(_func_, _argList_, _newTarget_).
1. Let _thisER_ be GetThisEnvironment().
1. Perform ? _thisER_.BindThisValue(_result_).
Copy link
Contributor

Choose a reason for hiding this comment

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

Similarly as the GetSuperBase comment, it'd be nice to have an assertion somewhere that _thisER_ is a function environment record.

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 this change. Let's try to prevent this from happening again in the future.

Copy link
Contributor

@syg syg left a comment

Choose a reason for hiding this comment

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

Still lgtm.

@bakkot bakkot added the ready to merge Editors believe this PR needs no further reviews, and is ready to land. label Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

4 participants