Easy API Mapping concept

Mike Samuel mikesamuel at gmail.com
Sun Dec 27 14:51:02 PST 2009

2009/12/27 memolus at googlemail.com <memolus at googlemail.com>:
> Mike Samuel <mikesamuel at gmail.com> wrote:
>>Is modus a global variable or does it bear any relation to this.modus
>>defined above?
> It's an boolean. So it could be this.modus.

Right now it looks like a reference to a global variable since there
is no local variable or parameter of that name.

>> Can't they be achieved with a library function
>> mapApi(xform, source, sourcePropertyName, target, targetPropertyName)
> No. It does not work with private objects and with dynamic references.
> Can you explain what you mean with xForm? Is it sth like my function
> which chooses the reference each time you access the object?
> My concept covers multiple targets.

xform would be a transform which converts from the source form to the
target form and back.

> You would need such an library function:
>  mapApi(ChooseTarget, source, sourcePropertyName, target1,
> targetPropertyName1, target2, targetPropertyName2, target3,
> targetPropertyName3)

Isn't that trivial to implement on top of a single property mapping function?

> For private objects you would have to use (in order to have a property
> of a source):

What is a private object?

>  var priv = { title:null }
> Example function for ChooseTarget:
>  function() { if(modus===true) return 1; else return 2 }
> It's ugly.

> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss

More information about the es-discuss mailing list