-
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
Annex B.3.3.1 intention with arguments
parameter shadowing
#815
Comments
The related question from the actual Firefox bug is the following. (function (a = arguments) {
{ function arguments() { } }
print(arguments);
}()); Should this program print Edit: for completeness, SpiderMonkey and V8 both print the function, i.e., apply Annex B semantics. |
@syg I agree with your opinion here. To spell out some more analysis (which you probably already did, but just to verify that my understanding matches yours), looks like adding We could implement this by making two separate Lists, one for the "real" parameterNames which would be referenced in Annex B 3.3, and one for what's used in step 26-27 for determining which var declarations to actually do something in response to. Even without this semantic issue, I think that would've made sense as a helpful editorial change, as step 21 reads and uses the parametersName list before adding |
Which was only discovered thanks to the test cases added in WebKit/WebKit@9dd0775. 😄 |
An editorial change accidentally blocked this hoisting; this patch restores it. Corresponding tests already pass on JSC and ChakraCore. Closes tc39#815
Ref tc39/ecma262#815 Ref tc39/ecma262#889 This is testing the current semantics of the specs, rather than the semantics in the proposed referenced issue.
(Credit to @anba for discovering this in Firefox's bug 1339123)
Consider the following two programs:
and
According to the current spec text (ES2017), both programs should print
[object Arguments]
.According to ES2015, the second program prints
undefined
.PR #677 from @jswalden resulted in the semantics change, though he confirmed over IRC any semantics changes from the PR were unintended.
What is the intended behavior here? I am of the opinion both programs should print
[object Arguments]
. That is, that the current spec is correct, and ES2015 had an inconsistency bug that has since been fixed.For completeness, SpiderMonkey prints
[object Arguments]
for both. V8 printsundefined
for both. I don't have JSC and Chakra handy, but @anba says they both print[object Arguments]
for both tests.The text was updated successfully, but these errors were encountered: