[OpenLayers-Trac] [OpenLayers] #1133: Format a string given a string template and some context.

OpenLayers trac at openlayers.org
Fri Nov 9 19:15:39 EST 2007


#1133: Format a string given a string template and some context.
----------------------+-----------------------------------------------------
  Reporter:  tschaub  |       Owner:             
      Type:  feature  |      Status:  new        
  Priority:  minor    |   Milestone:  2.6 Release
 Component:  general  |     Version:  2.5        
Resolution:           |    Keywords:  review     
----------------------+-----------------------------------------------------
Changes (by tschaub):

  * keywords:  => review

Comment:

 That's nice.

 I made a few other changes.  Ignore any items that start with "}" (last ==
 0).  Also, variable assignment is cheap, array index is expensive - so I
 set item = tokens[i].  Now you do two array lookups instead of four on
 successful match (didn't test performance here).

 Finally, I didn't get the bit about adding "}" on the end (line 122 in
 your patch).  Please set me straight if I missed something.  Better yet,
 add a new test case.

 The tests are pretty simple, but I think they're enough to get this in -
 if someone reviews in IE (can't remember if undefined.toString() ==
 "undefined" there too).

-- 
Ticket URL: <http://trac.openlayers.org/ticket/1133#comment:3>
OpenLayers <http://openlayers.org/>
A free AJAX map viewer


More information about the Trac mailing list