More so to just maintain the argument signature used elsewhere of {data,
type, target}
On Aug 5, 2013 7:46 PM, "Irakli Gozalishvili" <notifications@github.com>
wrote:

> In lib/sdk/places/events.js:
>
> > +function createHandler (type, argNames) {
> > +  argNames = argNames || [];
> > +  return function (...args) {
> > +    let data = argNames.reduce((acc, arg, i) => {
> > +      if (arg === null)
> > +        return acc;
> > +      if (arg === 'type')
> > +        args[i] = mapBookmarkItemType(args[i]);
> > +      if (arg === 'url' && args[i])
> > +        args[i] = args[i].spec;
> > +      acc[arg] = args[i];
> > +      return acc;
> > +    }, {});
> > +    emit(emitter, 'data', {
> > +      type: type,
> > +      data: data
>
> I feel like you're using data objects as a container only to avoid name
> collision on type property. Would it make sense to just rename type to
> something else to avoid this ?
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/mozilla/addon-sdk/pull/1136/files#r5593532>
> .
>