Commit 19daa0fe authored by Nicolas Biri's avatar Nicolas Biri
Browse files

Fix mapping: use new object structure

parent 62b37f7c
......@@ -157,7 +157,7 @@ function Mapping() {
}
Mapping.prototype.findEntry = function(k) {
return _.find(this[k.__jsmfId], function(x) {return x.key === k;});
return _.find(this[k.__meta__.uuid], function(x) {return x.key === k;});
}
Mapping.prototype.valuesFor = function(k) {
......@@ -169,10 +169,10 @@ Mapping.prototype.map = function(k, v) {
var entry = this.findEntry(k);
if (entry === undefined) {
entry = {key: k, values: []};
if (this[k.__jsmfId] === undefined) {
this[k.__jsmfId] = [entry];
if (this[k.__meta__.uuid] === undefined) {
this[k.__meta__.uuid] = [entry];
} else {
this[k.__jsmfId].push(entry);
this[k.__meta__.uuid].push(entry);
}
}
v = v instanceof Array ? v : [v];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment