fix mutatormap property bug

This commit is contained in:
Sebastian McKenzie
2014-10-13 16:36:07 +11:00
parent 647e33ef96
commit 5accf49ebf

View File

@@ -91,7 +91,14 @@ exports.sourceMapToComment = function (map) {
};
exports.pushMutatorMap = function (mutatorMap, key, kind, method) {
var map = mutatorMap[key] = mutatorMap[key] || {};
var map;
if (_.has(mutatorMap, key)) {
map = mutatorMap[key];
} else {
map = {};
}
mutatorMap[key] = map;
if (map[kind]) {
throw new Error("a " + kind + " already exists for this property");
} else {