-
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
Normative: Redefine CatchParameter as FormalParameter #1126
Normative: Redefine CatchParameter as FormalParameter #1126
Conversation
Did you review all of the static and runtime semantics rules associated with FormatParameter to make sure the will work for CatchParameter. They are probably fine, but it needs to be proactively verified. |
@chicoxyzzy Thanks for preparing this patch. At a glance, it seems correct, though I'm not sure why we should bother having a CatchParameter production at this point rather than just using FormalParameter directly. This would require updating many more little parts of the spec, unfortunately. Would you be interested in writing test262 tests for this change? (I think the test wouldn't change regardless of whether you take that editorial suggestion I made above.) |
@littledan sure, no problem. I will create PR in test262 repo within the next few days. |
I know Allen mentioned in #1121 to use |
@anba I think that using @littledan IMO it's better to keep |
I don't have a strong opinion about this editorial question, but in general, I don't think patches like this need to use a minimal number of lines of spec changed as a goal. It would be a little bit of work, but it'd be fine to update all the usages of CatchParameter, even though it's a bigger patch. |
what happens when the initializer is/has the binding name? try {
throw undefined;
} catch (x = x) {} |
@leobalter i think that'd just be the same as |
Let me expand this a bit more: var x;
try {
throw undefined;
} catch (x = x) {} var y = 42;
try {
throw undefined;
} catch (x = y) {
let y = 42;
} try {
throw undefined;
} catch ([x = y, y] = x) {} In functions we have the IteratorBindingInitialization to solve these issues. I believe the catch clause evaluation should get some 👀 as well. |
I'll take a look at it |
Can you clarify what you mean by "consistency"? FormalParameter is more or less only an alias for |
Sorry, I was too busy at work. I'll try to get back to this in next few weeks. |
@chicoxyzzy have you had a chance to get to this? |
I'm trying to make python test generation tool work, but no luck yet |
Do I have any chance to find a champion who can present this normative change to the committee? I'm going to make another attempt at tests soon. |
@chicoxyzzy Once tests are written I'm happy to present it to the committee on your behalf; I'll probably be able to do that in July. |
@chicoxyzzy ping; we've still got some time, but if you can get those tests written I can add this to the July agenda :-) |
Unfortunately I won't have time for that until the end of this week 😞 |
@chicoxyzzy that would work just fine! looking forward to it. |
The committee discussed this today and could not come to consensus on merging the PR - there was skepticism about the value of this change, and concern about it being confusing. If @chicoxyzzy or anyone is still interested in this change, a full proposal would be appropriate. I'll close this PR, but we can reopen it if this becomes a proposal that advances. |
Yes, I'd like to create a proposal repo later. |
This change removes default value restriction for catch parameter.
Closes #1121