Arguments and formal parameters aliasing

David-Sarah Hopwood david.hopwood at industrial-designers.co.uk
Sat Sep 27 20:14:52 PDT 2008


liorean wrote:
[...]
> ~~~~<10.1.3 Variable Instantiation>~~~~
> [...] If two or more formal parameters share the same
> name, hence the same property, the corresponding property is given the
> value that was supplied for the last parameter with this name.

Can anyone explain what the original rationale was for this? To me it
seems like duplicate parameter names are an obvious programming error, and
it makes no sense from a language design point of view to allow them.

(Yes, I understand that they are disallowed in ES3.1 strict mode, and that
disallowing them in non-strict mode would break compatibility. I'm just
curious what was going through the minds of the ES1 standardizers.)

-- 
David-Sarah Hopwood


More information about the Es-discuss mailing list