Easy API Mapping concept

memolus at googlemail.com memolus at googlemail.com
Sun Dec 27 13:13:13 PST 2009

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.

> 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.

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

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

  var priv = { title:null }

Example function for ChooseTarget:

  function() { if(modus===true) return 1; else return 2 }

It's ugly.

More information about the es-discuss mailing list