Eric proposed to remove the derive method from all API objects and do
something like this:

var loc = new LocaleInfo({....});  // {...} are the options we construct
LocaleInfo object with.
var opt2 = loc.options;  // This returns a copy of options from loc object.
opt2.currency = "USD";
var loc2 = new LocaleInfo(opt2);

This approach yields the same result with more code, but it's a more in sync
with how people expect JavaScript API to work.

In this case LocaleInfo needs to have options property that holds original
inputs. This approach could also help with inferred values - one can compare
options with actual property and see if they are the same.

var loc = LocaleInfo({currency: 'USD'});
if (loc.options.currency == loc.currency) ...

-- 
Nebojša Ćirić
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to