avoid Function.prototype pollution by test/sandbox.js (#2581)

This commit is contained in:
Alex Lam S.L 2017-12-12 05:02:01 +08:00 committed by GitHub
parent ebfd5c5c74
commit ddf96cfda2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -37,6 +37,7 @@ var FUNC_TOSTRING = [
' return "[Function: " + i + "]";',
" }",
"}();",
'Object.defineProperty(Function.prototype, "valueOf", { enumerable: false });',
]).join("\n");
exports.run_code = function(code) {
var stdout = "";