node.js - javascript setter injection without eval -
I am trying to use a setter injection in this example below, it works, but I have yet to It can not know how to achieve the same result without using Eval ().
var action = function () {}; Action.prototype.create = function (type, name) {var action = eval ("this." + Type); Action.create (name); }; Action.prototype.review = {create: function (name) {console.log ("hey" + name); }}; Var bang = new action (); Bang.create ('review', 'john'); I'm running it on nodejs v0.10
In that context, eval ("this." + Type) should be equal to [type] . This is one.
Comments
Post a Comment