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: InstantiateOrdinaryFunctionObject misuses "Ordinary" #2300

Open
jmdyck opened this issue Feb 8, 2021 · 0 comments
Open

Editorial: InstantiateOrdinaryFunctionObject misuses "Ordinary" #2300

jmdyck opened this issue Feb 8, 2021 · 0 comments

Comments

@jmdyck
Copy link
Collaborator

jmdyck commented Feb 8, 2021

As of PR #2271 (specifically 7a5f760), InstantiateFunctionObject delegates to four InstantiateFooFunctionObject operations, depending on the syntax of the function decl:

  • InstantiateOrdinaryFunctionObject
  • InstantiateGeneratorFunctionObject
  • InstantiateAsyncGeneratorFunctionObject
  • InstantiateAsyncFunctionObject

However, using "Ordinary" in this context is misleading. Yes, the functions created by InstantiateOrdinaryFunctionObject are ordinary, but so are the functions created by all the other InstantiateFooFunctionObject ops. (Note that they all call OrdinaryFunctionCreate, whose name uses the word correctly.)

Ditto all the above for InstantiateOrdinaryFunctionExpression (03d44e0).

The spec doesn't explicitly define an adjective for a function that isn't async or generator (or async-generator), but CreateDynamicFunction uses _kind_ = ~normal~ for this. Which suggests renaming the ops in question to:

  • InstantiateNormalFunctionObject
  • InstantiateNormalFunctionExpression

Mind you, the word "normal" is also used in the context of Completion Records. It has a completely different meaning there, so I don't think there's too much chance of confusion, but it might be better to pick a distinct adjective, e.g. "plain".

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

No branches or pull requests

1 participant