Opened 14 years ago

Closed 14 years ago

Last modified 12 years ago

#540 closed enhancement (fixed)

Add context parameter to dojo.evalObjPath() (like dojo.lang.setObjPathValue() has it)

Reported by: wolfram@… Owned by: sjmiles
Priority: high Milestone:
Component: Core Version: 0.3
Keywords: Cc:
Blocked By: Blocking:

Description

/*

  • Evaluate a string like "A.B" without using eval.
  • By default the string will be tried to be found in the global
  • namespace, but you can also give the context explicitly.
  • Which is very helpful for example in the case of evaluating
  • this for a local value:
  • dojo.evalObjPath("env.window.open", false, this)
  • This call passes the context (this) to the function, so the
  • object is tried to be found in this.env.window.open in the
  • object that called the function. *
  • @param string The string to evaluate, ie. "myobj.name", it
  • will return a reference to myobj.name
  • @param boolean If true the object will be created if it
  • doesn't exist.
  • @param object The context to find the object in. */

dojo.evalObjPath = function(objpath, create, context)

Attachments (1)

bootstrap1.diff (1.5 KB) - added by wolfram@… 14 years ago.
bootstrap1.diff

Download all attachments as: .zip

Change History (4)

Changed 14 years ago by wolfram@…

Attachment: bootstrap1.diff added

bootstrap1.diff

comment:1 Changed 14 years ago by sjmiles

Milestone: 0.3release
Owner: changed from anonymous to sjmiles
Type: defectenhancement
Version: 0.20.3

comment:2 Changed 14 years ago by sjmiles

Resolution: fixed
Status: newclosed

dojo.lang.getPathObjValue added to dojo.lang.extras

comment:3 Changed 12 years ago by (none)

Milestone: 0.3release

Milestone 0.3release deleted

Note: See TracTickets for help on using tickets.