On Mon, Feb 10, 2014 at 11:24 AM, Erik Arvidsson
<erik.arvids...@gmail.com>wrote:

> I also find the mutation of System.normalize slightly worrisome but I do
> believe that good programming practice here would mean that you would call
> the previous version of it after your changes. Mostly like a pre-advice.
>
> {
>   let locate = System.locate;
>   System.locate = function(...) {
>     if (some condition) {
>       return your address;
>     }
>     return locate.call(this, ...);
>   };
> }
>
> This way it should still be possible to load two sets of libraries without
> them getting in each others way.
>

Possible, yes, but:
  We should be thinking in terms of 10s (npm today) or 100s (soon) of
libraries,  with increasing collision potential.
  Potential locate() function 'some condition' collisions are order
dependent.
  We are baking in a flaw and offering a partial workaround, yuk.
On the other hand we gain what?
  Enabling Script to import when we want to deprecate script.
  Marginally fewer lines of code in very few files.
  Something else? I'd like to know.

If the benefits where larger, the costs would make more sense.

jjb
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to