Issue 71 in json-template: token_re_cache in javascript implementation doesn't do anything?

9 views
Skip to first unread message

json-t...@googlecode.com

unread,
May 10, 2012, 10:21:54 AM5/10/12
to json-t...@googlegroups.com
Status: Accepted
Owner: martijn....@gmail.com
Labels: Type-Review Priority-Low

New issue 71 by martijn....@gmail.com: token_re_cache in javascript
implementation doesn't do anything?
http://code.google.com/p/json-template/issues/detail?id=71

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


json-t...@googlecode.com

unread,
May 18, 2012, 8:26:48 PM5/18/12
to json-t...@googlegroups.com

Comment #1 on issue 71 by andyc...@gmail.com: token_re_cache in javascript
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.

json-t...@googlecode.com

unread,
May 18, 2012, 8:31:30 PM5/18/12
to json-t...@googlegroups.com
Updates:
Status: Fixed

Comment #2 on issue 71 by andyc...@gmail.com: token_re_cache in javascript
Fixed with changeset: 440:42ec17bd6386

Reply all
Reply to author
Forward
0 new messages