-
Notifications
You must be signed in to change notification settings - Fork 23
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
Can we have AssertedPositionalParameterName
interface which contains index?
#50
Comments
the bug in SpiderMonkey side: https://bugzilla.mozilla.org/show_bug.cgi?id=1475458 |
@syg can I have your opinion, about this issue and https://github.com/binast/ecmascript-binary-ast/issues/51 and https://bugzilla.mozilla.org/show_bug.cgi?id=1475458 ? |
@arai-a Sorry for missing this. Yeah, the current parameter scope is definitely deficient for capturing positional parameters. I had hoped that The additional interface for assigning positions to asserted parameter names looks good to me. |
here's WIP patch that adds above interfaces. |
I think we can workaround the rest parameter issue for now by a cheat (https://bugzilla.mozilla.org/show_bug.cgi?id=1475458#c9) as long as we know which is simple rest parameter. |
At first I thought this is the same issue as https://github.com/binast/ecmascript-binary-ast/issues/30, but I guess it's a bit different.
While creating binding data for parameters, we want a list of positional formal parameters+indices which directly maps to
arguments
element, so that the binding name maps to arguments slot at the point of reading scope data.With current spec, it's unknown before parsing
FormalParameters
.What I propose is the following:
AssertedPositionalParameterName
contains the index, which is the index in parameter list, and also the index inarguments
. (to be clear, it's not the index inparamNames
array).AssertedParameterName
is basically the same thing as currentAssertedBoundName
.for example,
function f(a, b=10, {c}, [d, e] = [], f, ...g) {}
has the following scope data:there
a
andf
are positional parameters and their indices are 0 and 4.isSimpleParameterList
field is removed, because it's obvious fromparamNames
(by, whether there's at leastAssertedParameterName
).The text was updated successfully, but these errors were encountered: