-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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: Correct GetExportedNames return type #3127
Conversation
|
I assume that, as you say, we gave it that type because the returned list is built from (among other things) the Specifically, To make that clearer for future readers, would you add |
Thanks for reviewing. Just pushed that change. |
@bojavou would you please register as a contributor? |
I'm not willing to compromise my privacy like that. Feel free to revert this if necessary. |
@ljharb The form does require a name and a phone number, which I at least would consider compromising my privacy if I were not using a public identity. If someone doesn't want to fill out the form, that's certainly their prerogative. |
Indeed, but we shouldn't be requiring a phone number, I suspect (and i believe people have previously been told it's ok to put in a fake one) |
The required fields are personally identifying information. I've been sticking sticking to Editorial patches because Normative requires that form. But maybe this one was too close to the line. If it's better, I can stick to issues instead of patches. Sorry about the email issue. Copypasted that wrong. I noticed it after the last one and fixed it for this patch. Is it possible you have the last one cached somewhere ? |
All contributions require that form, it's not just normative ones. The previously merged PRs are indelibly linked to that incorrect email, unfortunately. |
Unfortunately we don't actually currently draw a distinction between editorial and normative changes, as far as I know. I would like to be able to mark contributions as not requiring the IPR form, but thus far that's not something we've been able to get approval for. Issues are fine though. |
This reverts commit 57f427b.
Oh, you're right. It doesn't mention Normative. The Contributing file says it's required for significant patches:
I was thinking of little corrections and typo fixes as trivial, and so not requiring the form. I'll just stick to issues from now on to avoid problems. |
@bojavou It is understandable that you came to that conclusion. The wording there is a bit misleading, as we have not come to an agreement about what constitutes "significant". For now, that includes all patches, so we will update the wording to make it more clear. Sorry about the confusion. |
@bakkot It seems that changes suggested here are reverted. Can I do a follow-up PR containing changes in this PR and one additional modifications? I want to add assertion of |
Also if you don't mind, I would also like to add the following assertions:
Which seems to hold by way of construction of |
@doehyunbaek yes, please open a PR |
The
GetExportedNames
method of Source Text Module Record claims it returns a List of either Strings ornull
. I find no way for it to ever includenull
in the result. Module Record apparently can be subclassed, and I'm unsure how to check all possible subclasses. I'm giving the argument here and hopefully someone familiar with modules can evaluate.Called this Editorial because it changes no behavior, it just corrects the description of the actual behavior. But maybe it needs to be Normative because it does change a signature.
There's only a single use of
GetExportedNames
in the spec, which assumes a String-only result.GetModuleNamespace
calls it an iterates the result, passing each name toResolveExport
. That method accepts only a String for the name.GetExportedNames
produces a list of names fromExportEntry.[[ExportName]]
. The only situation that putsnull
in[[ExportName]]
is a star export.All star exports end up in
Module.[[StarExportEntries]]
.The branch of
GetExportedNames
that handles star exports (line 8 of the algorithm) never reads the export name. It pulls the referenced module and iterates its exported names recursively.I tried to look through history to figure out when the return type was established, but it's difficult to find when a change to a single section happened. Possibly the method return type was just transferred over from the
ExportEntry.[[ExportName]]
type, which does allow both (to handle the star export case).This patch changes the
GetExportedEntries
return type from "List of either Strings or null" to "List of Strings", to accurately describe what it returns.