codegooglecom / json-template

Automatically exported from code.google.com/p/json-template
0 stars 0 forks source link

token_re_cache in javascript implementation doesn't do anything? #71

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
In the code, the token_re_cache is used to cache regular expressions. But it 
appears nothing is ever put into the cache. A good thing too, as token_re 
should be recreated each time during compilation otherwise its lastIndex 
property isn't reset to 0. At least, I think that's what's going on (I was 
wondering how it could work with the cache in the first place; turned out the 
cache doesn't work).

Original issue reported on code.google.com by martijn....@gmail.com on 10 May 2012 at 2:21

GoogleCodeExporter commented 9 years ago
Good catch, thanks.  I guess I should just get rid of the cache because the 
lack of the caching apparently hasn't any issues for anyone.

I can't imagine that anyone would compile more than 10 or 100 templates per 
page, and it's probably negligible then.  I think it was a carryover from 
Python, where you could imagine a huge server loading thousands of templates.

Original comment by andyc...@gmail.com on 19 May 2012 at 12:26

GoogleCodeExporter commented 9 years ago
Fixed with changeset:   440:42ec17bd6386

Original comment by andyc...@gmail.com on 19 May 2012 at 12:31