From 5accf49ebfdde95b2311a0a65f89e37d390234bf Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Mon, 13 Oct 2014 16:36:07 +1100 Subject: [PATCH] fix mutatormap property bug --- lib/6to5/util.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/6to5/util.js b/lib/6to5/util.js index 9a1f25ba2e..3ab08d6900 100644 --- a/lib/6to5/util.js +++ b/lib/6to5/util.js @@ -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 {