Thanks for your reply. So I've filed the issue in https://bugs.ecmascript.org/show_bug.cgi?id=368
Regards, Yusuke Suzuki On Mon, May 28, 2012 at 1:54 PM, Allen Wirfs-Brock <[email protected]>wrote: > Yes, that is an issue. There are some others relating to formal parameter > initialization. Basically, I need to make another pass over that algorithm > particular in regard to formals. > > Thanks for point this out. In the future it would be best to report such > issues using bugs.ecmascript.org That makes it easier to track them. > > Allen > > > On May 27, 2012, at 9:00 PM, Yusuke Suzuki wrote: > > Hello, > > In the latest ES.next draft(May 4), section 10.5.3 Function Declaration > Instantiation step 5 is following > > 5. For each String argName in parameterNames, in list order do >> a. Let alreadyDeclared be the result of calling env’s HasBinding >> concrete method passing argName as the argument. >> b. NOTE Duplicate parameter names can only occur in non-strict code. >> c. If alreadyDeclared is false, then >> i. Call env’s CreateMutableBinding concrete method passing argName >> as the argument. >> d. If strict is false, then >> i. Call env’s InitializeBinding concrete method passing argName, >> and undefined as the arguments. > > > In the step d-i, if strict is false, engine always call > env.InitializeBinding(argName, undefined). > But if code is non-strict mode, duplicate parameter names may be provided. > > And section 10.2.1.1.8, InitializeBinding, step 2 is following > > 2. Assert: envRec must have an uninitialised binding for N. > > > So for example, > > // this is non-strict function > function test(a, a) { > } > test(1, 1); > > > engine execute above script and raise assertion failure because of calling > InitializeBinding to the same name twice. > > So I suggest changing like this > > c. If alreadyDeclared is false, then >> i. Call env’s CreateMutableBinding concrete method passing argName >> as the argument. >> ii. If strict is false, then >> 1. Call env’s InitializeBinding concrete method passing argName, >> and undefined as the arguments. > > > If I missed something, please point out. > > Regards, > Yusuke Suzuki > _______________________________________________ > es-discuss mailing list > [email protected] > https://mail.mozilla.org/listinfo/es-discuss > > >
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

