David-Sarah Hopwood wrote:
> Allowing keywords as function names makes for worse diagnostics in cases
> where the use of a keyword was unintentional. Consider
> 
>   function delete(foo) { ... }
>   ...
>   delete(bar);
> 
[...]
> 'delete' in this example could also be 'if' (as also pointed out by MarkM),
> 'new', 'this', 'throw', 'typeof', 'while', and probably 'yield' in a
> future ES version.

Also 'void' and 'return', and some identifiers that are technically not
keywords but which I think have been proposed to be disallowed as function
names, such as 'arguments' and 'eval'.

-- 
David-Sarah Hopwood ⚥

_______________________________________________
Es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to