Add some explaining comments to dictionary code.

This commit is contained in:
Jürg Lehni 2013-02-11 19:35:11 -08:00
parent 15554b8bf2
commit ee73b4e15b

View file

@ -260,6 +260,10 @@ this.Base = Base.inject(/** @lends Base# */{
definitions: {},
references: {},
add: function(item, create) {
// See if we have reference entry with the given id
// already. If not, call create on the item to allow it
// to create the definition, then store the reference
// to it and return it.
var id = '#' + item._id,
ref = this.references[id];
if (!ref) {