我只是努力在codewars.com寫一些隨機的難題,並很好奇,如果任何人都可以想辦法給eval代碼下面的代碼已運行後:座EVAL &&新功能
eval = function(){};
delete Function.prototype.constructor;
Function = undefined;
// the following are to block require('vm') -- if anyone wants to run this
// in production it may be better to block that one module (others?)
require = undefined;
module.__proto__.require = undefined; // added this due to alexpod's answer, modified due to Fabrício Matté's :)
module.constructor = undefined; // added this due to alexpod's answer
這是在node.js中,所以setTimeout("string")
不起作用。
你可能是一個編碼的挑戰網站更成功發佈此。 – Barmar 2015-02-07 01:17:32
我認爲這是爲了安全措施?在這種情況下,它是一個黑名單,正如你的問題所暗示的那樣。 – Timmerz 2015-02-07 01:32:12
@Barmar我認爲這是一個編碼挑戰網站? – Timmerz 2015-02-07 01:36:34