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

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -