insteadof operator

Bergi a.d.bergi at web.de
Thu Jun 25 23:48:28 UTC 2015


Bucaran schrieb:

> It would be nice if there was a special construct like `typeof` or `instanceof` that would take a name and evaluate to whatever
> variable / function of the same name existing in the parent scope (or undefined otherwise).

Sorry, no. Please not.
This would be a horrible feature, making name collisions (which are 
already confusing as hell at times) even more confusing. Scoping is 
already complicated, no need to introduce an edge case that all tooling 
(including human brains) would need to get learned.

There already does exist a simple, familiar, and working solution (well, 
multiple ones actually), it's not worth the trouble of introducing a new 
operator.

  Bergi


More information about the es-discuss mailing list