From 35fda899a8cf993398adff3dae874d453c56dbd1 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Sun, 4 Jan 2015 15:30:40 +1100 Subject: [PATCH] remove spec-no-duplicate-properties transformer --- lib/6to5/transformation/transform.js | 1 - .../spec-no-duplicate-properties.js | 25 ------------------- 2 files changed, 26 deletions(-) delete mode 100644 lib/6to5/transformation/transformers/spec-no-duplicate-properties.js diff --git a/lib/6to5/transformation/transform.js b/lib/6to5/transformation/transform.js index e78a0ea3b1..bf647e1f69 100644 --- a/lib/6to5/transformation/transform.js +++ b/lib/6to5/transformation/transform.js @@ -42,7 +42,6 @@ _.each({ // spec specBlockHoistFunctions: require("./transformers/spec-block-hoist-functions"), specNoForInOfAssignment: require("./transformers/spec-no-for-in-of-assignment"), - specNoDuplicateProperties: require("./transformers/spec-no-duplicate-properties"), // playground methodBinding: require("./transformers/playground-method-binding"), diff --git a/lib/6to5/transformation/transformers/spec-no-duplicate-properties.js b/lib/6to5/transformation/transformers/spec-no-duplicate-properties.js deleted file mode 100644 index 6c7e93e761..0000000000 --- a/lib/6to5/transformation/transformers/spec-no-duplicate-properties.js +++ /dev/null @@ -1,25 +0,0 @@ -var t = require("../../types"); - -exports.ObjectExpression = function (node, parent, file) { - var keys = []; - - for (var i in node.properties) { - var prop = node.properties[i]; - if (prop.computed || prop.kind !== "init") continue; - - var key = prop.key; - if (t.isIdentifier(key)) { - key = key.name; - } else if (t.isLiteral(key)) { - key = key.value; - } else { - continue; - } - - if (keys.indexOf(key) >= 0) { - throw file.errorWithNode(prop.key, "Duplicate property key"); - } else { - keys.push(key); - } - } -};