Closed GoogleCodeExporter closed 9 years ago
I think you're looking for the @consistentIdGenerator annotation.
Original comment by dim...@google.com
on 30 Dec 2013 at 6:29
Hi, either the example on this page is wrong:
https://code.google.com/p/closure-compiler/wiki/IdGeneratorAnnotations
Or there is a problem with the compiler, as even the example on the wiki fails
to give the same results.
Additionally, I was under the impression @idGenerator and
@consistentIdGenerator difference is only that the consistent generator will
try to use a provided mapping file.
Original comment by jhiswin
on 1 Jan 2014 at 9:58
Although I do submit that @idGenerator creating a new id on every invocation
makes sense and matches other implementations (such as Closure Library's
idGenerator), but the specs on the wiki do not match this.
Additionally, I do think a distinction needs to be made between an
"idGenerator" that uses a predefined map, and one that just returns the same id
for the same string, so perhaps another annotation for a different type of id
generator should be provided.
Original comment by jhiswin
on 1 Jan 2014 at 10:06
Good point, I didn't realize the docs said otherwise. I answered by looking at
the behavior of the tests here.
https://code.google.com/p/closure-compiler/source/browse/test/com/google/javascr
ipt/jscomp/ReplaceIdGeneratorsTest.java
Nick, John (or whoever wrote the wiki page), can you take a look and fix the
mismatch between the code and the doc?
Original comment by dim...@google.com
on 2 Jan 2014 at 6:15
Issue tracking has been migrated to github. Please make any further comments on
this issue through https://github.com/google/closure-compiler/issues
Original comment by blic...@google.com
on 1 May 2014 at 6:31
Original comment by blic...@google.com
on 1 May 2014 at 6:34
Original issue reported on code.google.com by
jhiswin
on 30 Dec 2013 at 11:36