diff --git a/lib/index.js b/lib/index.js index 3c04df8..f9c76f4 100644 --- a/lib/index.js +++ b/lib/index.js @@ -13,6 +13,8 @@ var Deffy = require("deffy"); * @return {Object|Array} The field value. */ function SetOrGet(input, field, def) { + if (field == '__proto__' || field == 'constructor' || field == 'prototype') + throw new Error('Restricted setting magical attributes') return input[field] = Deffy(input[field], def); }